function wfCreatePageConfirmEdit(&$captcha, &$editPage, $newtext, $section, $merged, &$result) { global $wgTitle, $wgCreatePageCoverRedLinks; // Enable only if the configuration global is set to true, // only for Special:CreatePage and only when ConfirmEdit is installed $canonspname = SpecialPage::resolveAlias($wgTitle->getDBkey()); if (!$wgCreatePageCoverRedLinks) { return true; } if ($canonspname != 'CreatePage') { return true; } if (!class_exists('SimpleCaptcha')) { return true; } if ($captcha->shouldCheck($editPage, $newtext, $section, $merged)) { if ($captcha->passCaptcha()) { $result = true; return false; } else { // display CAP page $mainform = new CreatePageCreatePlateForm(); $mainform->showForm('', false, array(&$captcha, 'editCallback')); $editor = new CreatePageMultiEditor($_SESSION['article_createplate']); $editor->generateForm($newtext); $result = false; return false; } } else { return true; } }
function showCreateplate($isInitial = false) { if ($this->mCreateplate) { $editor = new CreatePageMultiEditor($this->mCreateplate); } else { $editor = new CreatePageMultiEditor('Blank'); } $editor->mRedLinked = false; if ($this->mRedLinked) { $editor->mRedLinked = true; } $editor->mInitial = false; if ($isInitial) { $editor->mInitial = true; } $editor->generateForm(); }
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); }