/** * Set page title and show header for this log type * @param $type Array */ public function showHeader($type) { // If only one log type is used, then show a special message... $headerType = count($type) == 1 ? $type[0] : ''; if (LogPage::isLogType($headerType)) { $this->out->setPageTitle(LogPage::logName($headerType)); $this->out->addHTML(LogPage::logHeader($headerType)); } else { $this->out->addHTML(wfMsgExt('alllogstext', array('parseinline'))); } }
/** * Set page title and show header for this log type * @param $type Array * @deprecated in 1.19 */ public function showHeader($type) { wfDeprecated(__METHOD__, '1.19'); // If only one log type is used, then show a special message... $headerType = count($type) == 1 ? $type[0] : ''; if (LogPage::isLogType($headerType)) { $page = new LogPage($headerType); $this->out->setPageTitle($page->getName()->text()); $this->out->addHTML($page->getDescription()->parseAsBlock()); } else { $this->out->addHTML(wfMsgExt('alllogstext', array('parseinline'))); } }
/** * Main execution point * * @param User $user * @param OutputPage $output * @param WebRequest $request * @param int $mode */ public function execute($user, $output, $request, $mode) { global $wgUser; if (wfReadOnly()) { $output->readOnlyPage(); return; } switch ($mode) { case self::EDIT_CLEAR: // The "Clear" link scared people too much. // Pass on to the raw editor, from which it's very easy to clear. // The "Clear" link scared people too much. // Pass on to the raw editor, from which it's very easy to clear. case self::EDIT_RAW: $output->setPageTitle(wfMsg('watchlistedit-raw-title')); if ($request->wasPosted() && $this->checkToken($request, $wgUser)) { $wanted = $this->extractTitles($request->getText('titles')); $current = $this->getWatchlist($user); if (count($wanted) > 0) { $toWatch = array_diff($wanted, $current); $toUnwatch = array_diff($current, $wanted); $this->watchTitles($toWatch, $user); $this->unwatchTitles($toUnwatch, $user); $user->invalidateCache(); if (count($toWatch) > 0 || count($toUnwatch) > 0) { $output->addHtml(wfMsgExt('watchlistedit-raw-done', 'parse')); } if (($count = count($toWatch)) > 0) { $output->addHtml(wfMsgExt('watchlistedit-raw-added', 'parse', $count)); $this->showTitles($toWatch, $output, $wgUser->getSkin()); } if (($count = count($toUnwatch)) > 0) { $output->addHtml(wfMsgExt('watchlistedit-raw-removed', 'parse', $count)); $this->showTitles($toUnwatch, $output, $wgUser->getSkin()); } } else { $this->clearWatchlist($user); $user->invalidateCache(); $output->addHtml(wfMsgExt('watchlistedit-raw-removed', 'parse', count($current))); $this->showTitles($current, $output, $wgUser->getSkin()); } } $this->showRawForm($output, $user); break; case self::EDIT_NORMAL: $output->setPageTitle(wfMsg('watchlistedit-normal-title')); if ($request->wasPosted() && $this->checkToken($request, $wgUser)) { $titles = $this->extractTitles($request->getArray('titles')); $this->unwatchTitles($titles, $user); $user->invalidateCache(); $output->addHtml(wfMsgExt('watchlistedit-normal-done', 'parse', $GLOBALS['wgLang']->formatNum(count($titles)))); $this->showTitles($titles, $output, $wgUser->getSkin()); } $this->showNormalForm($output, $user); } }
function lyricsH1_onBeforePageDisplay(OutputPage &$out, Skin &$skin) { global $wgTitle; // lyrics pages will only be in the main namespace after the merge if ($wgTitle->getNamespace() == NS_MAIN) { $origTitle = $out->getPageTitle(); if (0 == preg_match("/\\([12][0-9]{3}\\)\$/", $origTitle) && 0 < preg_match("/.+:+/", $origTitle)) { $out->setPageTitle($origTitle . wfMsg('H1-lyricssuffix')); // added as a message so that it can be translated } } return true; }
public function execute( $params ) { global $wgOut, $wgUser; $this->out = $wgOut; $this->user = $wgUser; $this->skin = $wgUser->getSkin(); $this->out->addWikiMsg( 'translate-fs-intro' ); $step = false; $step = $this->showSignup( $step ); $step = $this->showSettings( $step ); $step = $this->showUserpage( $step ); $step = $this->showPermissions( $step ); $step = $this->showTarget( $step ); $step = $this->showEmail( $step ); if ( $step === 'translate-fs-target-title' ) { global $wgLang; $this->out->redirect( SpecialPage::getTitleFor( 'LanguageStats', $wgLang->getCode() )->getLocalUrl() ); } $this->out->setPageTitle( htmlspecialchars( wfMsg( 'translate-fs-pagetitle', wfMsg( $step ) ) ) ); }
/** * Dispatched from execute(); */ private function outputInformation() { // TODO RBV (14.12.10 09:59): Display information about WebService availability, configuration settings, etc... Could also be used to monitor Webservice and manually empty cache. $this->oOutputPage->setPageTitle(wfMessage('bs-universalexport-page-title-without-param')->text()); $this->oOutputPage->addHtml(wfMessage('bs-universalexport-page-text-without-param')->text()); $this->oOutputPage->addHtml('<hr />'); if (empty($this->aModules)) { $this->oOutputPage->addHtml(wfMessage('bs-universalexport-page-text-without-param-no-modules-registered')->text()); return; } foreach ($this->aModules as $sKey => $oModule) { if ($oModule instanceof BsUniversalExportModule) { $oModuleOverview = $oModule->getOverview(); $this->oOutputPage->addHtml($oModuleOverview->execute()); } else { wfDebugLog('BS::UniversalExport', 'SpecialUniversalExport::outputInformation: Invalid view.'); } } }
/** * @param \OutputPage $out */ public function setPageTitle(\OutputPage $out) { $topic = $this->findTopicTitle(); $title = $this->workflow->getOwnerTitle(); $out->setPageTitle($out->msg('flow-topic-first-heading', $title->getPrefixedText())); if ($this->permissions->isAllowed($topic, 'view')) { if ($this->action === 'undo-edit-topic-summary') { $key = 'flow-undo-edit-topic-summary'; } else { $key = 'flow-topic-html-title'; } $out->setHtmlTitle($out->msg($key, array(Message::rawParam($topic->getContent('wikitext')), $title->getPrefixedText()))); } else { $out->setHtmlTitle($title->getPrefixedText()); } $out->setSubtitle('< ' . \Linker::link($title)); }
/** * Print extra field for 'title' * * @param OutputPage $wgOut */ public function renderFormHeader($wgOut) { global $wgRequest; $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/"); $oTmpl->set_vars(array("formErrors" => $this->mFormErrors, "formData" => $this->mFormData, "isReload" => $wgRequest->getVal('wpIsReload', 0) == 1, "editIntro" => $wgOut->parse($this->mEditIntro))); $wgOut->setPageTitle(wfMsg("createpage")); $wgOut->addScriptFile('edit.js'); if ($this->mPreviewTitle == null) { $wgOut->addHTML('<div id="custom_createpagetext">'); $wgOut->addWikiText(wfMsgForContent('newarticletext')); $wgOut->addHTML('</div>'); } $wgOut->addHTML($oTmpl->render("createFormHeader")); }
/** * @param \OutputPage $out */ public function setPageTitle(\OutputPage $out) { if ($out->getPageTitle()) { // Don't override page title if another block has already set it. // If this should *really* be done, the specific block extending // this AbstractBlock should just implement this itself ;) return; } $out->setPageTitle($this->workflow->getArticleTitle()->getFullText()); }
public function execute($par) { global $wgRequest; $this->out->setPageTitle(htmlspecialchars(wfMsg('translate-managegroups'))); $group = $wgRequest->getText('group'); $group = MessageGroups::getGroup($group); if (!$group instanceof FileBasedMessageGroup) { $group = null; } if ($group) { if ($wgRequest->getBool('rebuildall', false) && $wgRequest->wasPosted() && $this->user->isAllowed('translate-manage') && $this->user->matchEditToken($wgRequest->getVal('token'))) { $languages = explode(',', $wgRequest->getText('codes')); foreach ($languages as $code) { $cache = new MessageGroupCache($group, $code); $cache->create(); } } $code = $wgRequest->getText('language', 'en'); // Go to English for undefined codes. $codes = array_keys(Language::getLanguageNames(false)); if (!in_array($code, $codes)) { $code = 'en'; } if ($wgRequest->getVal('from') !== 'main') { $this->importForm($group, $code); return; } } // Main list global $wgLang, $wgOut; $groups = MessageGroups::singleton()->getGroups(); TranslateUtils::addSpecialHelpLink($wgOut, 'Help:Extension:Translate/Group_management'); $wgOut->wrapWikiMsg('<h2>$1</h2>', 'translate-manage-listgroups'); $separator = wfMsg('word-separator'); $languages = array_keys(Language::getLanguageNames(false)); foreach ($groups as $group) { if (!$group instanceof FileBasedMessageGroup) { continue; } wfDebug(__METHOD__ . ": {$group->getId()}\n"); $id = $group->getId(); $link = $this->skin->link($this->getTitle(), $group->getLabel(), array('id' => "mw-group-{$id}"), array('group' => $id)); $out = $link . $separator; $cache = new MessageGroupCache($group); if ($cache->exists()) { $timestamp = wfTimestamp(TS_MW, $cache->getTimestamp()); $out .= wfMsg('translate-manage-cacheat', $wgLang->date($timestamp), $wgLang->time($timestamp)); $modified = array(); foreach ($languages as $code) { $cache = new MessageGroupCache($group, $code); if (!$cache->isValid()) { $modified[] = $code; } } if (count($modified)) { $out = '[' . implode(",", $modified) . '] ' . $out; if (!in_array('en', $modified) && $this->user->isAllowed('translate-manage')) { $out .= $this->rebuildButton($group, $modified, 'main'); } } else { // @todo FIXME: should be in CSS file. $out = Html::rawElement('span', array('style' => 'color:grey'), $out); } } else { $out .= wfMsg('translate-manage-newgroup'); } $wgOut->addHtml($out); $wgOut->addHtml('<hr>'); } $wgOut->wrapWikiMsg('<h2>$1</h2>', 'translate-manage-listgroups-old'); $wgOut->addHTML('<ul>'); foreach ($groups as $group) { if ($group instanceof FileBasedMessageGroup) { continue; } $wgOut->addHtml(Xml::element('li', null, $group->getLabel())); } $wgOut->addHTML('</ul>'); }