<?php

$is_new = template_var('new_page');


$data = array();
$data['id'] = 0;
$data['content_type'] = 'page';
$data['title'] = false;
$data['content'] = false;
$data['url'] = '';

$data['thumbnail'] = '';

$data['is_active'] = 1;
$data['is_home'] = 0;

$data['is_shop'] = 0;

$data['require_login'] = 'n';

$data['subtype'] = 'static';
$data['description'] = '';
$data['active_site_template'] = '';
$data['subtype_value'] = '';
$data['parent'] = 0;
$data['layout_name'] = '';
$data['layout_file'] = '';
$data['original_link'] = '';
$data['content_meta_title'] = '';
$data['content_meta_keywords'] = '';
if ($is_new == false) {

} else {
    foreach ($is_new as $k => $v) {
        $data[$k] = $v;

    }

}


if (!isset($title_placeholder)) {
    $title_placeholder = false;
}
if (isset($params['content-type'])) {
	$params['content_type'] = $params['content-type'];
}



if (isset($params['content_type'])) {
    $data['content_type'] = $params['content_type'];
    $title_placeholder = "New {$data['content_type']} title";
    if ($params['content_type'] == 'product') {
        //$data['content_type'] = 'post';
//        $data['subtype'] = 'product';
    } elseif (isset($params['subtype']) && $params['subtype'] == 'post') {
    //    $data['content_type'] = 'post';
//        $data['subtype'] = 'post';

    } elseif (isset($params['subtype'])) {

        if ($params['subtype'] == 'static' or $params['subtype'] == 'dynamic') {
            $title_placeholder = "New page title";
        }

    }
}
if ($title_placeholder == false and isset($params['content_type'])) {
    $title_placeholder = "New " . $params['content_type'];
} else if ($title_placeholder == false and isset($data['subtype'])) {
    $title_placeholder = "New " . $data['subtype'];
    if ($data['subtype'] == 'static' or $data['subtype'] == 'dynamic') {
        $title_placeholder = "New page title";
    }
}

