public function execute() { $params = $this->extractRequestParams(); $prop = array_flip($params['prop']); $this->fld_displayname = isset($prop['displayname']); $this->fld_description = isset($prop['description']); $this->fld_hitcount = isset($prop['hitcount']); $this->limit = $params['limit']; $this->result = $this->getResult(); $this->addTables('change_tag'); $this->addFields('ct_tag'); $this->addFieldsIf(array('hitcount' => 'COUNT(*)'), $this->fld_hitcount); $this->addOption('LIMIT', $this->limit + 1); $this->addOption('GROUP BY', 'ct_tag'); $this->addWhereRange('ct_tag', 'newer', $params['continue'], null); $res = $this->select(__METHOD__); $ok = true; foreach ($res as $row) { if (!$ok) { break; } $ok = $this->doTag($row->ct_tag, $this->fld_hitcount ? $row->hitcount : 0); } // include tags with no hits yet foreach (ChangeTags::listDefinedTags() as $tag) { if (!$ok) { break; } $ok = $this->doTag($tag, 0); } $this->result->setIndexedTagName_internal(array('query', $this->getModuleName()), 'tag'); }
function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->setPageTitle($this->msg('tags-title')); $out->wrapWikiMsg("<div class='mw-tags-intro'>\n\$1\n</div>", 'tags-intro'); // Write the headers $html = Xml::tags('tr', null, Xml::tags('th', null, $this->msg('tags-tag')->parse()) . Xml::tags('th', null, $this->msg('tags-display-header')->parse()) . Xml::tags('th', null, $this->msg('tags-description-header')->parse()) . Xml::tags('th', null, $this->msg('tags-active-header')->parse()) . Xml::tags('th', null, $this->msg('tags-hitcount-header')->parse())); // Used in #doTagRow() $this->definedTags = array_fill_keys(ChangeTags::listDefinedTags(), true); foreach (ChangeTags::tagUsageStatistics() as $tag => $hitcount) { $html .= $this->doTagRow($tag, $hitcount); } $out->addHTML(Xml::tags('table', array('class' => 'wikitable sortable mw-tags-table'), $html)); }
function execute($par) { global $wgOut; $wgOut->setPageTitle(wfMsg('tags-title')); $wgOut->wrapWikiMsg("<div class='mw-tags-intro'>\n\$1\n</div>", 'tags-intro'); // Write the headers $html = Xml::tags('tr', null, Xml::tags('th', null, wfMsgExt('tags-tag', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-display-header', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-description-header', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-hitcount-header', 'parseinline'))); $dbr = wfGetDB(DB_SLAVE); $res = $dbr->select('change_tag', array('ct_tag', 'count(*) AS hitcount'), array(), __METHOD__, array('GROUP BY' => 'ct_tag', 'ORDER BY' => 'hitcount DESC')); foreach ($res as $row) { $html .= $this->doTagRow($row->ct_tag, $row->hitcount); } foreach (ChangeTags::listDefinedTags() as $tag) { $html .= $this->doTagRow($tag, 0); } $wgOut->addHTML(Xml::tags('table', array('class' => 'wikitable mw-tags-table'), $html)); }
function execute($par) { global $wgOut, $wgUser, $wgMessageCache; $wgMessageCache->loadAllMessages(); $sk = $wgUser->getSkin(); $wgOut->setPageTitle(wfMsg('tags-title')); $wgOut->wrapWikiMsg("<div class='mw-tags-intro'>\n\$1</div>", 'tags-intro'); // Write the headers $html = ''; $html = Xml::tags('tr', null, Xml::tags('th', null, wfMsgExt('tags-tag', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-display-header', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-description-header', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-hitcount-header', 'parseinline'))); $dbr = wfGetDB(DB_SLAVE); $res = $dbr->select('change_tag', array('ct_tag', 'count(*) as hitcount'), array(), __METHOD__, array('GROUP BY' => 'ct_tag', 'ORDER BY' => 'hitcount DESC')); while ($row = $res->fetchObject()) { $html .= $this->doTagRow($row->ct_tag, $row->hitcount); } foreach (ChangeTags::listDefinedTags() as $tag) { $html .= $this->doTagRow($tag, 0); } $wgOut->addHTML(Xml::tags('table', array('class' => 'mw-tags-table'), $html)); }
function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->setPageTitle($this->msg('tags-title')); $out->wrapWikiMsg("<div class='mw-tags-intro'>\n\$1\n</div>", 'tags-intro'); // Write the headers $html = Xml::tags('tr', null, Xml::tags('th', null, wfMsgExt('tags-tag', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-display-header', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-description-header', 'parseinline')) . Xml::tags('th', null, wfMsgExt('tags-hitcount-header', 'parseinline'))); $dbr = wfGetDB(DB_SLAVE); $res = $dbr->select('change_tag', array('ct_tag', 'count(*) AS hitcount'), array(), __METHOD__, array('GROUP BY' => 'ct_tag', 'ORDER BY' => 'hitcount DESC')); $used_tags = []; foreach ($res as $row) { $used_tags[] = ['ct_tag' => $row->ct_tag, 'hitcount' => $row->hitcount]; } wfRunHooks('SpecialTags::UsedTags', [&$used_tags]); foreach ($used_tags as $used_tag) { $html .= $this->doTagRow($used_tag['ct_tag'], $used_tag['hitcount']); } foreach (ChangeTags::listDefinedTags() as $tag) { $html .= $this->doTagRow($tag, 0); } $out->addHTML(Xml::tags('table', array('class' => 'wikitable mw-tags-table'), $html)); }
public function getAllowedParams() { $feedFormatNames = array_keys($this->getConfig()->get('FeedClasses')); $ret = array('feedformat' => array(ApiBase::PARAM_DFLT => 'rss', ApiBase::PARAM_TYPE => $feedFormatNames), 'user' => array(ApiBase::PARAM_TYPE => 'user', ApiBase::PARAM_REQUIRED => true), 'namespace' => array(ApiBase::PARAM_TYPE => 'namespace'), 'year' => array(ApiBase::PARAM_TYPE => 'integer'), 'month' => array(ApiBase::PARAM_TYPE => 'integer'), 'tagfilter' => array(ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => array_values(ChangeTags::listDefinedTags()), ApiBase::PARAM_DFLT => ''), 'deletedonly' => false, 'toponly' => false, 'newonly' => false, 'showsizediff' => array(ApiBase::PARAM_DFLT => false)); if ($this->getConfig()->get('MiserMode')) { $ret['showsizediff'][ApiBase::PARAM_HELP_MSG] = 'api-help-param-disabled-in-miser-mode'; } return $ret; }
public function getAllowedParams() { global $wgFeedClasses; $feedFormatNames = array_keys($wgFeedClasses); return array('feedformat' => array(ApiBase::PARAM_DFLT => 'rss', ApiBase::PARAM_TYPE => $feedFormatNames), 'user' => array(ApiBase::PARAM_TYPE => 'user', ApiBase::PARAM_REQUIRED => true), 'namespace' => array(ApiBase::PARAM_TYPE => 'namespace'), 'year' => array(ApiBase::PARAM_TYPE => 'integer'), 'month' => array(ApiBase::PARAM_TYPE => 'integer'), 'tagfilter' => array(ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_TYPE => array_values(ChangeTags::listDefinedTags()), ApiBase::PARAM_DFLT => ''), 'deletedonly' => false, 'toponly' => false, 'showsizediff' => false); }