Пример #1
0
 function format($changes)
 {
     $this->_args['daylist'] = false;
     //don't show day buttons in Mozilla sidebar
     $html = _RecentChanges_HtmlFormatter::format($changes);
     $html = HTML::div(array('class' => 'wikitext'), $html);
     global $request;
     $request->discardOutput();
     printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", $GLOBALS['charset']);
     printf('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"');
     printf('  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
     printf('<html xmlns="http://www.w3.org/1999/xhtml">');
     printf("<head>\n");
     extract($this->_args);
     if (!empty($category)) {
         $title = $category;
     } elseif (!empty($pagematch)) {
         $title = $pagematch;
     } else {
         $title = WIKI_NAME . $show_minor ? _("RecentEdits") : _("RecentChanges");
     }
     printf("<title>" . $title . "</title>\n");
     global $WikiTheme;
     $css = $WikiTheme->getCSS();
     $css->PrintXML();
     printf("</head>\n");
     printf("<body class=\"sidebar\">\n");
     $html->PrintXML();
     echo '<a href="http://www.feedvalidator.org/check.cgi?url=http://phpwiki.org/RecentChanges?format=rss"><img src="themes/default/buttons/valid-rss.png" alt="[Valid RSS]" title="Validate the RSS feed" width="44" height="15" /></a>';
     printf("\n</body>\n");
     printf("</html>\n");
     $request->finish();
     // cut rest of page processing short
 }
Пример #2
0
    function format($changes)
    {
        $this->_itemcount = 0;
        $pagename = $this->_args['page'];
        $fmt = _RecentChanges_HtmlFormatter::format($changes);
        $fmt->action = _("PageHistory");
        $html[] = $fmt;
        $html[] = HTML::input(array('type' => 'hidden', 'name' => 'action', 'value' => 'diff'));
        if (USE_PATH_INFO) {
            $action = WikiURL($pagename);
        } else {
            $action = SCRIPT_NAME;
            $html[] = HTML::input(array('type' => 'hidden', 'name' => 'pagename', 'value' => $pagename));
        }
        return HTML(HTML::form(array('method' => 'get', 'action' => $action, 'id' => 'diff-select'), $html), "\n", JavaScript('
        var diffCkBoxes = document.forms["diff-select"].elements["versions[]"];

        function diffCkBox_onclick() {
            var nchecked = 0, box = diffCkBoxes;
            for (i = 0; i < box.length; i++)
                if (box[i].checked) nchecked++;
            if (nchecked == 2)
                this.form.submit();
            else if (nchecked > 2) {
                for (i = 0; i < box.length; i++)
                    if (box[i] != this) box[i].checked = 0;
            }
        }

        for (i = 0; i < diffCkBoxes.length; i++)
            diffCkBoxes[i].onclick = diffCkBox_onclick;'));
    }