<?php

$cms_root_path = "../../../";
require_once($cms_root_path."includes/compatibility_includer.php");
$_SESSION['content_manager']['language'] = ""; // set language to default just in case.
$sub_id = 0;

if ( isset($_GET['sub_id']) && is_numeric($_GET['sub_id']) ) {
	$sub_id = $_GET['sub_id'];
}

$cm = new ContentManager();
$page_id = $cm->CreateNewPage($sub_id);
$page = new Page($page_id);
$page->preview_page = clone $page;

echo json_encode($page);