当前位置: 首页>>代码示例>>PHP>>正文


PHP ChangesList::flagLegend方法代码示例

本文整理汇总了PHP中ChangesList::flagLegend方法的典型用法代码示例。如果您正苦于以下问题:PHP ChangesList::flagLegend方法的具体用法?PHP ChangesList::flagLegend怎么用?PHP ChangesList::flagLegend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChangesList的用法示例。


在下文中一共展示了ChangesList::flagLegend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doHeader

 /**
  * Return the text to be displayed above the changes
  *
  * @param $opts FormOptions
  * @return String: XHTML
  */
 public function doHeader($opts)
 {
     global $wgScript, $wgOut;
     $this->setTopText($wgOut, $opts);
     $defaults = $opts->getAllValues();
     $nondefaults = $opts->getChangedValues();
     $opts->consumeValues(array('namespace', 'invert', 'tagfilter'));
     $panel = array();
     $panel[] = $this->optionsPanel($defaults, $nondefaults);
     $panel[] = '<hr />';
     $extraOpts = $this->getExtraOptions($opts);
     $extraOptsCount = count($extraOpts);
     $count = 0;
     $submit = ' ' . Xml::submitbutton(wfMsg('allpagessubmit'));
     $out = Xml::openElement('table', array('class' => 'mw-recentchanges-table'));
     foreach ($extraOpts as $optionRow) {
         # Add submit button to the last row only
         ++$count;
         $addSubmit = $count === $extraOptsCount ? $submit : '';
         $out .= Xml::openElement('tr');
         if (is_array($optionRow)) {
             $out .= Xml::tags('td', array('class' => 'mw-label'), $optionRow[0]);
             $out .= Xml::tags('td', array('class' => 'mw-input'), $optionRow[1] . $addSubmit);
         } else {
             $out .= Xml::tags('td', array('class' => 'mw-input', 'colspan' => 2), $optionRow . $addSubmit);
         }
         $out .= Xml::closeElement('tr');
     }
     $out .= Xml::closeElement('table');
     $unconsumed = $opts->getUnconsumedValues();
     foreach ($unconsumed as $key => $value) {
         $out .= Xml::hidden($key, $value);
     }
     $t = $this->getTitle();
     $out .= Xml::hidden('title', $t->getPrefixedText());
     $form = Xml::tags('form', array('action' => $wgScript), $out);
     $panel[] = $form;
     $panelString = implode("\n", $panel);
     $wgOut->addHTML(Xml::fieldset(wfMsg('recentchanges-legend'), $panelString, array('class' => 'rcoptions')));
     $wgOut->addHTML(ChangesList::flagLegend());
     $this->setBottomText($wgOut, $opts);
 }
开发者ID:rocLv,项目名称:conference,代码行数:48,代码来源:SpecialRecentchanges.php

示例2: wfSpecialWatchlist


//.........这里部分代码省略.........
        $tables[] = 'page';
        $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
        if ($rollbacker) {
            $fields[] = 'page_latest';
        }
    }
    ChangeTags::modifyDisplayQuery($tables, $fields, $conds, $join_conds, $options, '');
    wfRunHooks('SpecialWatchlistQuery', array(&$conds, &$tables, &$join_conds, &$fields));
    $res = $dbr->select($tables, $fields, $conds, __METHOD__, $options, $join_conds);
    $numRows = $dbr->numRows($res);
    /* Start bottom header */
    $wlInfo = '';
    if ($days >= 1) {
        $wlInfo = wfMsgExt('rcnote', 'parseinline', $wgLang->formatNum($numRows), $wgLang->formatNum($days), $wgLang->timeAndDate(wfTimestampNow(), true), $wgLang->date(wfTimestampNow(), true), $wgLang->time(wfTimestampNow(), true)) . '<br />';
    } elseif ($days > 0) {
        $wlInfo = wfMsgExt('wlnote', 'parseinline', $wgLang->formatNum($numRows), $wgLang->formatNum(round($days * 24))) . '<br />';
    }
    $cutofflinks = "\n" . wlCutoffLinks($days, 'Watchlist', $nondefaults) . "<br />\n";
    $thisTitle = SpecialPage::getTitleFor('Watchlist');
    # Spit out some control panel links
    $links[] = wlShowHideLink($nondefaults, 'rcshowhideminor', 'hideMinor', $hideMinor);
    $links[] = wlShowHideLink($nondefaults, 'rcshowhidebots', 'hideBots', $hideBots);
    $links[] = wlShowHideLink($nondefaults, 'rcshowhideanons', 'hideAnons', $hideAnons);
    $links[] = wlShowHideLink($nondefaults, 'rcshowhideliu', 'hideLiu', $hideLiu);
    $links[] = wlShowHideLink($nondefaults, 'rcshowhidemine', 'hideOwn', $hideOwn);
    if ($wgUser->useRCPatrol()) {
        $links[] = wlShowHideLink($nondefaults, 'rcshowhidepatr', 'hidePatrolled', $hidePatrolled);
    }
    # Namespace filter and put the whole form together.
    $form .= $wlInfo;
    $form .= $cutofflinks;
    $form .= $wgLang->pipeList($links);
    $form .= Xml::openElement('form', array('method' => 'post', 'action' => $thisTitle->getLocalUrl()));
    $form .= '<hr /><p>';
    $form .= Xml::label(wfMsg('namespace'), 'namespace') . '&nbsp;';
    $form .= Xml::namespaceSelector($nameSpace, '') . '&nbsp;';
    $form .= Xml::checkLabel(wfMsg('invert'), 'invert', 'nsinvert', $invert) . '&nbsp;';
    $form .= Xml::submitButton(wfMsg('allpagessubmit')) . '</p>';
    $form .= Xml::hidden('days', $days);
    if ($hideMinor) {
        $form .= Xml::hidden('hideMinor', 1);
    }
    if ($hideBots) {
        $form .= Xml::hidden('hideBots', 1);
    }
    if ($hideAnons) {
        $form .= Xml::hidden('hideAnons', 1);
    }
    if ($hideLiu) {
        $form .= Xml::hidden('hideLiu', 1);
    }
    if ($hideOwn) {
        $form .= Xml::hidden('hideOwn', 1);
    }
    $form .= Xml::closeElement('form');
    $form .= Xml::closeElement('fieldset');
    $wgOut->addHTML($form);
    $wgOut->addHTML(ChangesList::flagLegend());
    # If there's nothing to show, stop here
    if ($numRows == 0) {
        $wgOut->addWikiMsg('watchnochange');
        return;
    }
    /* End bottom header */
    /* Do link batch query */
    $linkBatch = new LinkBatch();
    while ($row = $dbr->fetchObject($res)) {
        $userNameUnderscored = str_replace(' ', '_', $row->rc_user_text);
        if ($row->rc_user != 0) {
            $linkBatch->add(NS_USER, $userNameUnderscored);
        }
        $linkBatch->add(NS_USER_TALK, $userNameUnderscored);
        $linkBatch->add($row->rc_namespace, $row->rc_title);
    }
    $linkBatch->execute();
    $dbr->dataSeek($res, 0);
    $list = ChangesList::newFromUser($wgUser);
    $list->setWatchlistDivs();
    $s = $list->beginRecentChangesList();
    $counter = 1;
    while ($obj = $dbr->fetchObject($res)) {
        # Make RC entry
        $rc = RecentChange::newFromRow($obj);
        $rc->counter = $counter++;
        if ($wgShowUpdatedMarker) {
            $updated = $obj->wl_notificationtimestamp;
        } else {
            $updated = false;
        }
        if ($wgRCShowWatchingUsers && $wgUser->getOption('shownumberswatching')) {
            $rc->numberofWatchingusers = $dbr->selectField('watchlist', 'COUNT(*)', array('wl_namespace' => $obj->rc_namespace, 'wl_title' => $obj->rc_title), __METHOD__);
        } else {
            $rc->numberofWatchingusers = 0;
        }
        $s .= $list->recentChangesLine($rc, $updated, $counter);
    }
    $s .= $list->endRecentChangesList();
    $dbr->freeResult($res);
    $wgOut->addHTML($s);
}
开发者ID:rocLv,项目名称:conference,代码行数:101,代码来源:SpecialWatchlist.php


注:本文中的ChangesList::flagLegend方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。