public static function onGetRecentChangeQuery(&$conds, &$tables, &$join_conds, $opts) { $app = F::app(); if ($app->wg->User->isAnon()) { return true; } if ($app->wg->Title->isSpecial('RecentChanges')) { return true; } if ($opts['invert'] !== false) { return true; } if (!isset($opts['namespace']) || empty($opts['namespace'])) { $rcfs = new RecentChangesFiltersStorage($app->wg->User); $selected = $rcfs->get(); if (empty($selected)) { return true; } $db = wfGetDB(DB_SLAVE); $cond = 'rc_namespace IN (' . $db->makeList($selected) . ')'; $flag = true; foreach ($conds as $key => &$value) { if (strpos($value, 'rc_namespace') !== false) { $value = $cond; $flag = false; break; } } if ($flag) { $conds[] = $cond; } } return true; }
public function dropdownNamespaces() { $all = $this->getVal('all', null); $selected = $this->getVal('selected', array()); $namespaces = $this->wf->GetNamespaces(); $options = array(); foreach ($namespaces as $index => $name) { if ($index < NS_MAIN) { continue; } $options[] = array('value' => $index, 'label' => $index === 0 ? $this->wf->Msg('blanknamespace') : $name); } $rcfs = new RecentChangesFiltersStorage($this->wg->User); $selected = $rcfs->get(); $this->html = $this->app->renderView('WikiaStyleGuideDropdownController', 'multiSelect', array('options' => $options, 'selected' => $selected, 'selectAll' => true)); }
public function dropdownNamespaces() { $selected = $this->getVal('selected', array()); $namespaces = wfGetNamespaces(); if (!empty($this->wg->EnableWallEngine)) { $namespaces = WallHelper::clearNamespaceList($namespaces); } $options = array(); foreach ($namespaces as $index => $name) { if ($index < NS_MAIN) { continue; } $options[] = array('value' => $index, 'label' => $index === 0 ? wfMessage('blanknamespace')->escaped() : $name); } if (empty($selected)) { $rcfs = new RecentChangesFiltersStorage($this->wg->User); $selected = $rcfs->get(); } $this->html = $this->app->renderView('WikiaStyleGuideDropdownController', 'multiSelect', array('options' => $options, 'selected' => $selected, 'selectAll' => true)); }