function showPreview($content, $title)
    {
        global $wgOut, $wgUser, $wgParser;
        $parserOptions = ParserOptions::newFromUser($wgUser);
        $parserOptions->setEditSection(false);
        $rtitle = Title::newFromText($title);
        if (is_object($rtitle)) {
            wfCreatePageUnescapeKnownMarkupTags($content);
            $pre_parsed = $wgParser->preSaveTransform($content, $rtitle, $wgUser, $parserOptions, true);
            $output = $wgParser->parse($pre_parsed, $rtitle, $parserOptions);
            $wgOut->addParserOutputNoText($output);
            $wgOut->addHTML("<div id=\"createpagepreview\">\n\t\t\t\t\t{$output->mText}\n\t\t\t\t\t<div id=\"createpage_preview_delimiter\" class=\"actionBar actionBarStrong\">" . wfMsg('createpage-preview-end') . '</div>
				</div>');
        }
    }
function axCreatepageAdvancedSwitch()
{
    global $wgRequest;
    $mCreateplate = $wgRequest->getVal('createplates');
    $editor = new CreatePageMultiEditor($mCreateplate);
    $content = CreateMultiPage::unescapeBlankMarker($editor->glueArticle());
    wfCreatePageUnescapeKnownMarkupTags($content);
    $_SESSION['article_content'] = $content;
    return json_encode(true);
}