예제 #1
0
/**
 * Called to display the Special:Compare page
 *
 * @param unknown_type $par
 * @param unknown_type $specialPage
 */
function wfSpecialCompare($par = NULL, $specialPage)
{
    global $wgOut, $wgScriptPath, $wgUser, $wrSidebarHtml;
    $compareForm = new CompareForm();
    $wgOut->setPageTitle('Compare pages');
    // read query parameters into variables
    if (!$compareForm->readQueryParms($par)) {
        $sideText = '';
        $results = $compareForm->getCompareForm();
    } else {
        $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/compare.7.js\"></script>");
        $isGedcom = $compareForm->isGedcom();
        $sideText = '<p>' . ($isGedcom ? 'Matching GEDCOM families' : 'Merge') . ' is a two-step process.  In this compare step, check the boxes above the matching pages.</p>' . ($compareForm->getNamespace() == 'Family' ? '<p>To match children, choose the child number to match with.</p>' : '') . ($isGedcom ? '<p>Then scroll to the bottom of the page and click "Match" to match this family.</p>' . '<p>In the next step you\'ll be given a chance to update the matched pages with information from your GEDCOM</p>' : '<p>Then click "Prepare to merge" at the bottom of the page.</p>' . '<p>In the next step you\\ll be given a chance to decide what information to keep on the merged page.</p>') . '<p><font color="green">Green</font> boxes mean the information is specific and matches exactly.</p>' . '<p><font color="yellow">Yellow</font> boxes mean the information is non-specific (missing some pieces) or is a partial match.</p>' . '<p><font color="red">Red</font> boxes mean the information differs.</p>' . '<p>(<a href="/wiki/Help:Merging_pages">more help</a>)</p>';
        $results = $compareForm->getCompareResults();
    }
    $skin = $wgUser->getSkin();
    //$wrSidebarHtml = $skin->makeKnownLink('Help:Merging pages', "Help", '', '', '', 'class="popup"');
    $wrSidebarHtml = wfMsgWikiHtml('CompareHelp');
    $wgOut->addHTML($results);
}