function __construct(User $user) { $app = F::App(); $this->user = $user; $this->memc = $app->wg->Memc; $this->namespaces = wfGetNamespaces(); }
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)); }