Esempio n. 1
1
/**
 * Called to display the Special:ReviewMerge page
 *
 * @param unknown_type $par
 * @param unknown_type $specialPage
 */
function wfSpecialReviewMerge($par = NULL, $specialPage)
{
    global $wgOut, $wgScriptPath, $wgUser, $wrSidebarHtml;
    $reviewForm = new ReviewForm();
    // read query parameters into variables
    $unmerge = '';
    if (!$reviewForm->readQueryParms($par)) {
        $wgOut->setPageTitle('Review merge');
        $results = '<p>You must click on a "review" link on Recent Changes or a page history in order to review the merge.</p>';
    } else {
        if ($reviewForm->isMarkPatrolled()) {
            $wgOut->setPagetitle(wfMsg('markedaspatrolled'));
            $results = $reviewForm->markPatrolled();
        } else {
            if ($reviewForm->isUnmerge()) {
                if (!$wgUser->isLoggedIn()) {
                    if (!$wgCommandLineMode && !isset($_COOKIE[session_name()])) {
                        User::SetupSession();
                    }
                    $title = Title::makeTitle(NS_SPECIAL, 'ReviewMerge/' . $par);
                    $requestData = array();
                    if ($title) {
                        $requestData['returnto'] = $title->getPrefixedUrl();
                    }
                    $request = new FauxRequest($requestData);
                    require_once 'includes/SpecialUserlogin.php';
                    $form = new LoginForm($request);
                    $form->mainLoginForm("You need to sign in to unmerge pages<br/><br/>", '');
                    return;
                }
                if ($wgUser->isBlocked()) {
                    $wgOut->blockedPage();
                    return;
                } else {
                    if (wfReadOnly()) {
                        $wgOut->readOnlyPage();
                        return;
                    }
                }
                $wgOut->setPagetitle('Unmerge');
                $results = $reviewForm->unmerge();
            } else {
                $wgOut->setPageTitle('Review merge');
                $wrSidebarHtml = $reviewForm->getReviewSideText();
                $results = $reviewForm->getReviewResults();
                $unmerge = $reviewForm->getUnmergeInfo();
            }
        }
    }
    $wgOut->addHTML($unmerge . $results);
}