public function formatRow($row) { $title = Title::newFromRow($row); # Link to page $link = Linker::link($title); # Direction mark $dirmark = wfUILang()->getDirMark(); # Size (bytes) $stxt = ''; if (!is_null($size = $row->page_len)) { if ($size == 0) { $stxt = ' <small>' . wfMsgHtml('historyempty') . '</small>'; } else { $stxt = ' <small>' . wfMsgExt('historysize', 'parsemag', $this->getLang()->formatNum($size)) . '</small>'; } } # Link to list of reviewed versions for page $list = Linker::linkKnown(SpecialPage::getTitleFor('ReviewedVersions'), wfMsgHtml('reviewedpages-all'), array(), 'page=' . $title->getPrefixedUrl()); # Link to highest tier rev $best = ''; if (FlaggedRevs::qualityVersions()) { $best = Linker::linkKnown($title, wfMsgHtml('reviewedpages-best'), array(), 'stableid=best'); $best = " [{$best}]"; } return "<li>{$link} {$dirmark} {$stxt} ({$list}){$best}</li>"; }
/** * Shows the search form */ private function showForm() { global $wgScript, $wgOut, $wgRequest; /* Build form */ $html = Xml::openElement('form', array('action' => $wgScript)) . "\n"; // Name of SpecialPage $html .= Html::hidden('title', $this->getTitle()->getPrefixedText()) . "\n"; // Limit $html .= Html::hidden('limit', $wgRequest->getInt('limit', 50)); // Input box with target prefilled if available $formContent = "\t" . Xml::input('target', 40, is_null($this->target) ? '' : $this->target->getText()) . "\n\t" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('globalusage-ok'))) . "\n\t<p>" . Xml::checkLabel(wfMsg('globalusage-filterlocal'), 'filterlocal', 'mw-filterlocal', $this->filterLocal) . '</p>'; if (!is_null($this->target) && wfFindFile($this->target)) { // Show the image if it exists $html .= Linker::makeThumbLinkObj($this->target, wfFindFile($this->target), $this->target->getPrefixedText(), '', wfUILang()->alignEnd(), array(), false, false); } // Wrap the entire form in a nice fieldset $html .= Xml::fieldSet(wfMsg('globalusage-text'), $formContent) . "\n</form>"; $wgOut->addHtml($html); }
/** * @param CodeComment $comment * @return string */ protected function commentStyle($comment) { $align = wfUILang()->AlignStart(); $depth = $comment->threadDepth(); $margin = ($depth - 1) * 48; return "margin-{$align}: {$margin}px"; }
function setHeaders($out) { global $wgOggScriptVersion, $wgCortadoJarFile; if ($out->hasHeadItem('OggHandlerScript') && $out->hasHeadItem('OggHandlerInlineScript') && $out->hasHeadItem('OggHandlerInlineCSS')) { return; } $msgNames = array('ogg-play', 'ogg-pause', 'ogg-stop', 'ogg-no-player', 'ogg-player-videoElement', 'ogg-player-oggPlugin', 'ogg-player-cortado', 'ogg-player-vlc-mozilla', 'ogg-player-vlc-activex', 'ogg-player-quicktime-mozilla', 'ogg-player-quicktime-activex', 'ogg-player-totem', 'ogg-player-kaffeine', 'ogg-player-kmplayer', 'ogg-player-mplayerplug-in', 'ogg-player-thumbnail', 'ogg-player-selected', 'ogg-use-player', 'ogg-more', 'ogg-download', 'ogg-desc-link', 'ogg-dismiss', 'ogg-player-soundthumb', 'ogg-no-xiphqt'); $msgValues = array_map('wfMsg', $msgNames); $jsMsgs = Xml::encodeJsVar((object) array_combine($msgNames, $msgValues)); $cortadoUrl = $wgCortadoJarFile; $scriptPath = self::getMyScriptPath(); if (substr($cortadoUrl, 0, 1) != '/' && substr($cortadoUrl, 0, 4) != 'http') { $cortadoUrl = wfExpandUrl("{$scriptPath}/{$cortadoUrl}", PROTO_CURRENT); } $encCortadoUrl = Xml::encodeJsVar($cortadoUrl); $encExtPathUrl = Xml::encodeJsVar($scriptPath); $alignStart = wfUILang()->alignStart(); $out->addHeadItem('OggHandlerScript', Html::linkedScript("{$scriptPath}/OggPlayer.js?{$wgOggScriptVersion}")); $out->addHeadItem('OggHandlerInlineScript', Html::inlineScript(<<<EOT wgOggPlayer.msg = {$jsMsgs}; wgOggPlayer.cortadoUrl = {$encCortadoUrl}; wgOggPlayer.extPathUrl = {$encExtPathUrl}; EOT )); $out->addHeadItem('OggHandlerInlineCSS', Html::inlineStyle(<<<EOT .ogg-player-options { \tborder: solid 1px #ccc; \tpadding: 2pt; \ttext-align: {$alignStart}; \tfont-size: 10pt; } .center .ogg-player-options ul { \tmargin: 0.3em 0px 0px 1.5em; } EOT )); }
public function formatRow($row) { $title = Title::newFromRow($row); $stxt = $underReview = $watching = ''; $link = Linker::link($title, null, array(), 'redirect=no'); $dirmark = wfUILang()->getDirMark(); $hist = Linker::linkKnown($title, wfMsgHtml('hist'), array(), 'action=history'); if (!is_null($size = $row->page_len)) { $stxt = $size == 0 ? wfMsgHtml('historyempty') : wfMsgExt('historysize', 'parsemag', $this->getLang()->formatNum($size)); $stxt = " <small>{$stxt}</small>"; } # Get how long the first unreviewed edit has been waiting... $firstPendingTime = wfTimestamp(TS_UNIX, $row->creation); $hours = ($this->currentUnixTS - $firstPendingTime) / 3600; // After three days, just use days if ($hours > 3 * 24) { $days = round($hours / 24, 0); $age = ' ' . wfMsgExt('unreviewedpages-days', 'parsemag', $this->getLang()->formatNum($days)); // If one or more hours, use hours } elseif ($hours >= 1) { $hours = round($hours, 0); $age = ' ' . wfMsgExt('unreviewedpages-hours', 'parsemag', $this->getLang()->formatNum($hours)); } else { $age = ' ' . wfMsg('unreviewedpages-recent'); // hot off the press :) } if ($this->getUser()->isAllowed('unwatchedpages')) { $uw = FRUserActivity::numUsersWatchingPage($title); $watching = $uw ? wfMsgExt('unreviewedpages-watched', 'parsemag', $this->getLang()->formatNum($uw)) : wfMsgHtml('unreviewedpages-unwatched'); $watching = " {$watching}"; // Oh-noes! } else { $uw = -1; } $css = self::getLineClass($hours, $uw); $css = $css ? " class='{$css}'" : ""; # Show if a user is looking at this page list($u, $ts) = FRUserActivity::getUserReviewingPage($row->page_id); if ($u !== null) { $underReview = " <span class='fr-under-review'>" . wfMsgHtml('unreviewedpages-viewing') . '</span>'; } return "<li{$css}>{$link} {$dirmark} {$stxt} ({$hist})" . "{$age}{$watching}{$underReview}</li>"; }
/** * Render one or more navigations elements by name, automatically reveresed * when UI is in RTL mode */ private function renderNavigation($elements) { global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser; // If only one element was given, wrap it in an array, allowing more // flexible arguments if (!is_array($elements)) { $elements = array($elements); // If there's a series of elements, reverse them when in RTL mode } else { if (wfUILang()->isRTL()) { $elements = array_reverse($elements); } } // Render elements foreach ($elements as $name => $element) { echo "\n<!-- {$name} -->\n"; switch ($element) { case 'NAMESPACES': ?> <div id="p-namespaces" class="vectorTabs<?php if (count($this->data['namespace_urls']) == 0) { echo ' emptyPortlet'; } ?> "> <h5><?php $this->msg('namespaces'); ?> </h5> <ul<?php $this->html('userlangattributes'); ?> > <?php foreach ($this->data['namespace_urls'] as $link) { ?> <li <?php echo $link['attributes']; ?> ><span><a href="<?php echo htmlspecialchars($link['href']); ?> " <?php echo $link['key']; ?> ><?php echo htmlspecialchars($link['text']); ?> </a></span></li> <?php } ?> </ul> </div> <?php break; case 'VARIANTS': ?> <div id="p-variants" class="vectorMenu<?php if (count($this->data['variant_urls']) == 0) { echo ' emptyPortlet'; } ?> "> <?php if ($wgVectorShowVariantName) { ?> <h4> <?php foreach ($this->data['variant_urls'] as $link) { ?> <?php if (stripos($link['attributes'], 'selected') !== false) { ?> <?php echo htmlspecialchars($link['text']); ?> <?php } ?> <?php } ?> </h4> <?php } ?> <h5><span><?php $this->msg('variants'); ?> </span><a href="#"></a></h5> <div class="menu"> <ul<?php $this->html('userlangattributes'); ?> > <?php foreach ($this->data['variant_urls'] as $link) { ?> <li<?php echo $link['attributes']; ?> ><a href="<?php echo htmlspecialchars($link['href']); ?> " <?php echo $link['key']; ?> ><?php echo htmlspecialchars($link['text']); ?> </a></li> <?php } ?> </ul> </div> </div> <?php break; case 'VIEWS': ?> <div id="p-views" class="vectorTabs<?php if (count($this->data['view_urls']) == 0) { echo ' emptyPortlet'; } ?> "> <h5><?php $this->msg('views'); ?> </h5> <ul<?php $this->html('userlangattributes'); ?> > <?php foreach ($this->data['view_urls'] as $link) { ?> <li<?php echo $link['attributes']; ?> ><span><a href="<?php echo htmlspecialchars($link['href']); ?> " <?php echo $link['key']; ?> ><?php echo array_key_exists('img', $link) ? '<img src="' . $link['img'] . '" alt="' . $link['text'] . '" />' : htmlspecialchars($link['text']); ?> </a></span></li> <?php } ?> </ul> </div> <?php break; case 'ACTIONS': ?> <div id="p-cactions" class="vectorMenu<?php if (count($this->data['action_urls']) == 0) { echo ' emptyPortlet'; } ?> "> <h5><span><?php $this->msg('actions'); ?> </span><a href="#"></a></h5> <div class="menu"> <ul<?php $this->html('userlangattributes'); ?> > <?php foreach ($this->data['action_urls'] as $link) { ?> <li<?php echo $link['attributes']; ?> ><a href="<?php echo htmlspecialchars($link['href']); ?> " <?php echo $link['key']; ?> ><?php echo htmlspecialchars($link['text']); ?> </a></li> <?php } ?> </ul> </div> </div> <?php break; case 'PERSONAL': ?> <div id="p-personal" class="<?php if (count($this->data['personal_urls']) == 0) { echo ' emptyPortlet'; } ?> "> <h5><?php $this->msg('personaltools'); ?> </h5> <ul<?php $this->html('userlangattributes'); ?> > <?php foreach ($this->data['personal_urls'] as $item) { ?> <li <?php echo $item['attributes']; ?> ><a href="<?php echo htmlspecialchars($item['href']); ?> "<?php echo $item['key']; if (!empty($item['class'])) { ?> class="<?php echo htmlspecialchars($item['class']); ?> "<?php } ?> ><?php echo htmlspecialchars($item['text']); ?> </a></li> <?php } ?> </ul> </div> <?php break; case 'SEARCH': ?> <div id="p-search"> <h5<?php $this->html('userlangattributes'); ?> ><label for="searchInput"><?php $this->msg('search'); ?> </label></h5> <form action="<?php $this->text('wgScript'); ?> " id="searchform"> <input type='hidden' name="title" value="<?php $this->text('searchtitle'); ?> "/> <?php if ($wgVectorUseSimpleSearch && $wgUser->getOption('vector-simplesearch')) { ?> <div id="simpleSearch"> <?php if ($this->data['rtl']) { ?> <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey('search-fulltext'); ?> ><img src="<?php echo $this->skin->getSkinStylePath('images/search-rtl.png'); ?> " alt="<?php $this->msg('searchbutton'); ?> " /></button> <?php } ?> <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey('search'); ?> <?php if (isset($this->data['search'])) { ?> value="<?php $this->text('search'); ?> "<?php } ?> /> <?php if (!$this->data['rtl']) { ?> <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey('search-fulltext'); ?> ><img src="<?php echo $this->skin->getSkinStylePath('images/search-ltr.png'); ?> " alt="<?php $this->msg('searchbutton'); ?> " /></button> <?php } ?> </div> <?php } else { ?> <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey('search'); ?> <?php if (isset($this->data['search'])) { ?> value="<?php $this->text('search'); ?> "<?php } ?> /> <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('searcharticle'); ?> "<?php echo $this->skin->tooltipAndAccesskey('search-go'); ?> /> <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg('searchbutton'); ?> "<?php echo $this->skin->tooltipAndAccesskey('search-fulltext'); ?> /> <?php } ?> </form> </div> <?php break; } echo "\n<!-- /{$name} -->\n"; } }
/** * Generate \<link\> tags for stylesheets * * @param $style String: URL to the file * @param $options Array: option, can contain 'condition', 'dir', 'media' * keys * @return String: HTML fragment */ protected function styleLink($style, $options) { if (isset($options['dir'])) { $siteDir = wfUILang()->getDir(); if ($siteDir != $options['dir']) { return ''; } } if (isset($options['media'])) { $media = self::transformCssMedia($options['media']); if (is_null($media)) { return ''; } } else { $media = 'all'; } if (substr($style, 0, 1) == '/' || substr($style, 0, 5) == 'http:' || substr($style, 0, 6) == 'https:') { $url = $style; } else { global $wgStylePath, $wgStyleVersion; $url = $wgStylePath . '/' . $style . '?' . $wgStyleVersion; } $link = Html::linkedStyle($url, $media); if (isset($options['condition'])) { $condition = htmlspecialchars($options['condition']); $link = "<!--[if {$condition}]>{$link}<![endif]-->"; } return $link; }
/** * A navigation bar with images * Stolen from TablePager because it's pretty. */ function getNavigationBar() { global $wgStylePath; if (method_exists($this, 'isNavigationBarShown') && !$this->isNavigationBarShown()) { return ''; } $path = "{$wgStylePath}/common/images"; $labels = array('first' => 'table_pager_first', 'prev' => 'table_pager_prev', 'next' => 'table_pager_next', 'last' => 'table_pager_last'); $images = array('first' => 'arrow_first_25.png', 'prev' => 'arrow_left_25.png', 'next' => 'arrow_right_25.png', 'last' => 'arrow_last_25.png'); $disabledImages = array('first' => 'arrow_disabled_first_25.png', 'prev' => 'arrow_disabled_left_25.png', 'next' => 'arrow_disabled_right_25.png', 'last' => 'arrow_disabled_last_25.png'); if (wfUILang()->isRTL()) { $keys = array_keys($labels); $images = array_combine($keys, array_reverse($images)); $disabledImages = array_combine($keys, array_reverse($disabledImages)); } $linkTexts = array(); $disabledTexts = array(); foreach ($labels as $type => $label) { $msgLabel = wfMsgHtml($label); $linkTexts[$type] = "<img src=\"{$path}/{$images[$type]}\" alt=\"{$msgLabel}\"/><br />{$msgLabel}"; $disabledTexts[$type] = "<img src=\"{$path}/{$disabledImages[$type]}\" alt=\"{$msgLabel}\"/><br />{$msgLabel}"; } $links = $this->getPagingLinks($linkTexts, $disabledTexts); $navClass = htmlspecialchars($this->getNavClass()); $s = "<table class=\"{$navClass}\" align=\"center\" cellpadding=\"3\"><tr>\n"; $cellAttrs = 'valign="top" align="center" width="' . 100 / count($links) . '%"'; foreach ($labels as $type => $label) { $s .= "<td {$cellAttrs}>{$links[$type]}</td>\n"; } $s .= "</tr></table>\n"; return $s; }
/** * initialize various variables and generate the template * * @param $out OutputPage */ function outputPage(OutputPage $out) { global $wgArticle, $wgUser, $wgLang, $wgContLang; global $wgScript, $wgStylePath, $wgLanguageCode; global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks; global $wgMaxCredits, $wgShowCreditsIfMax; global $wgPageShowWatchingUsers; global $wgUseTrackbacks, $wgUseSiteJs, $wgDebugComments; global $wgArticlePath, $wgScriptPath, $wgServer, $wgProfiler; wfProfileIn(__METHOD__); if (is_object($wgProfiler)) { $wgProfiler->setTemplated(true); } $oldid = $wgRequest->getVal('oldid'); $diff = $wgRequest->getVal('diff'); $action = $wgRequest->getVal('action', 'view'); wfProfileIn(__METHOD__ . '-init'); $this->initPage($out); $this->setMembers(); $tpl = $this->setupTemplate($this->template, 'skins'); #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText $tpl->setTranslator(new MediaWiki_I18N()); #} wfProfileOut(__METHOD__ . '-init'); wfProfileIn(__METHOD__ . '-stuff'); $this->thispage = $this->mTitle->getPrefixedDBkey(); $this->thisurl = $this->mTitle->getPrefixedURL(); $query = array(); if (!$wgRequest->wasPosted()) { $query = $wgRequest->getValues(); unset($query['title']); unset($query['returnto']); unset($query['returntoquery']); } $this->thisquery = wfUrlencode(wfArrayToCGI($query)); $this->loggedin = $wgUser->isLoggedIn(); $this->iscontent = $this->mTitle->getNamespace() != NS_SPECIAL; $this->iseditable = ($this->iscontent and !($action == 'edit' or $action == 'submit')); $this->username = $wgUser->getName(); if ($wgUser->isLoggedIn() || $this->showIPinHeader()) { $this->userpageUrlDetails = self::makeUrlDetails($this->userpage); } else { # This won't be used in the standard skins, but we define it to preserve the interface # To save time, we check for existence $this->userpageUrlDetails = self::makeKnownUrlDetails($this->userpage); } $this->titletxt = $this->mTitle->getPrefixedText(); wfProfileOut(__METHOD__ . '-stuff'); wfProfileIn(__METHOD__ . '-stuff-head'); if ($this->useHeadElement) { $pagecss = $this->setupPageCss(); if ($pagecss) { $out->addInlineStyle($pagecss); } } else { $this->setupUserCss($out); $tpl->set('pagecss', $this->setupPageCss()); $tpl->setRef('usercss', $this->usercss); $this->userjs = $this->userjsprev = false; $this->setupUserJs($out->isUserJsAllowed()); $tpl->setRef('userjs', $this->userjs); $tpl->setRef('userjsprev', $this->userjsprev); if ($wgUseSiteJs) { $jsCache = $this->loggedin ? '&smaxage=0' : ''; $tpl->set('jsvarurl', self::makeUrl('-', "action=raw{$jsCache}&gen=js&useskin=" . urlencode($this->getSkinName()))); } else { $tpl->set('jsvarurl', false); } $tpl->setRef('xhtmldefaultnamespace', $wgXhtmlDefaultNamespace); $tpl->set('xhtmlnamespaces', $wgXhtmlNamespaces); $tpl->set('html5version', $wgHtml5Version); $tpl->set('headlinks', $out->getHeadLinks($this)); $tpl->set('csslinks', $out->buildCssLinks($this)); if ($wgUseTrackbacks && $out->isArticleRelated()) { $tpl->set('trackbackhtml', $out->getTitle()->trackbackRDF()); } else { $tpl->set('trackbackhtml', null); } } wfProfileOut(__METHOD__ . '-stuff-head'); wfProfileIn(__METHOD__ . '-stuff2'); $tpl->set('title', $out->getPageTitle()); $tpl->set('pagetitle', $out->getHTMLTitle()); $tpl->set('displaytitle', $out->mPageLinkTitle); $tpl->set('pageclass', $this->getPageClasses($this->mTitle)); $tpl->set('skinnameclass', 'skin-' . Sanitizer::escapeClass($this->getSkinName())); $nsname = MWNamespace::exists($this->mTitle->getNamespace()) ? MWNamespace::getCanonicalName($this->mTitle->getNamespace()) : $this->mTitle->getNsText(); $tpl->set('nscanonical', $nsname); $tpl->set('nsnumber', $this->mTitle->getNamespace()); $tpl->set('titleprefixeddbkey', $this->mTitle->getPrefixedDBKey()); $tpl->set('titletext', $this->mTitle->getText()); $tpl->set('articleid', $this->mTitle->getArticleId()); $tpl->set('currevisionid', isset($wgArticle) ? $wgArticle->getLatest() : 0); $tpl->set('isarticle', $out->isArticle()); $tpl->setRef('thispage', $this->thispage); $subpagestr = $this->subPageSubtitle(); $tpl->set('subtitle', !empty($subpagestr) ? '<span class="subpages">' . $subpagestr . '</span>' . $out->getSubtitle() : $out->getSubtitle()); $undelete = $this->getUndeleteLink(); $tpl->set('undelete', !empty($undelete) ? '<span class="subpages">' . $undelete . '</span>' : ''); $tpl->set('catlinks', $this->getCategories()); if ($out->isSyndicated()) { $feeds = array(); foreach ($out->getSyndicationLinks() as $format => $link) { $feeds[$format] = array('text' => wfMsg("feed-{$format}"), 'href' => $link); } $tpl->setRef('feeds', $feeds); } else { $tpl->set('feeds', false); } $tpl->setRef('mimetype', $wgMimeType); $tpl->setRef('jsmimetype', $wgJsMimeType); $tpl->setRef('charset', $wgOutputEncoding); $tpl->setRef('wgScript', $wgScript); $tpl->setRef('skinname', $this->skinname); $tpl->set('skinclass', get_class($this)); $tpl->setRef('stylename', $this->stylename); $tpl->set('printable', $out->isPrintable()); $tpl->set('handheld', $wgRequest->getBool('handheld')); $tpl->setRef('loggedin', $this->loggedin); $tpl->set('notspecialpage', $this->mTitle->getNamespace() != NS_SPECIAL); /* XXX currently unused, might get useful later $tpl->set( "editable", ($this->mTitle->getNamespace() != NS_SPECIAL ) ); $tpl->set( "exists", $this->mTitle->getArticleID() != 0 ); $tpl->set( "watch", $this->mTitle->userIsWatching() ? "unwatch" : "watch" ); $tpl->set( "protect", count($this->mTitle->isProtected()) ? "unprotect" : "protect" ); $tpl->set( "helppage", wfMsg('helppage')); */ $tpl->set('searchaction', $this->escapeSearchLink()); $tpl->set('searchtitle', SpecialPage::getTitleFor('Search')->getPrefixedDBKey()); $tpl->set('search', trim($wgRequest->getVal('search'))); $tpl->setRef('stylepath', $wgStylePath); $tpl->setRef('articlepath', $wgArticlePath); $tpl->setRef('scriptpath', $wgScriptPath); $tpl->setRef('serverurl', $wgServer); $tpl->setRef('logopath', $wgLogo); $lang = wfUILang(); $tpl->set('lang', $lang->getCode()); $tpl->set('dir', $lang->getDir()); $tpl->set('rtl', $lang->isRTL()); $tpl->set('capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : ''); $tpl->set('showjumplinks', $wgUser->getOption('showjumplinks')); $tpl->set('username', $wgUser->isAnon() ? null : $this->username); $tpl->setRef('userpage', $this->userpage); $tpl->setRef('userpageurl', $this->userpageUrlDetails['href']); $tpl->set('userlang', $wgLang->getCode()); // Users can have their language set differently than the // content of the wiki. For these users, tell the web browser // that interface elements are in a different language. $tpl->set('userlangattributes', ''); $tpl->set('specialpageattributes', ''); $lang = $wgLang->getCode(); $dir = $wgLang->getDir(); if ($lang !== $wgContLang->getCode() || $dir !== $wgContLang->getDir()) { $attrs = " lang='{$lang}' dir='{$dir}'"; $tpl->set('userlangattributes', $attrs); // The content of SpecialPages should be presented in the // user's language. Content of regular pages should not be touched. if ($this->mTitle->isSpecialPage()) { $tpl->set('specialpageattributes', $attrs); } } $newtalks = $this->getNewtalks(); wfProfileOut(__METHOD__ . '-stuff2'); wfProfileIn(__METHOD__ . '-stuff3'); $tpl->setRef('newtalk', $newtalks); $tpl->setRef('skin', $this); $tpl->set('logo', $this->logoText()); if ($out->isArticle() and (!isset($oldid) or isset($diff)) and $wgArticle and 0 != $wgArticle->getID()) { if (!$wgDisableCounters) { $viewcount = $wgLang->formatNum($wgArticle->getCount()); if ($viewcount) { $tpl->set('viewcount', wfMsgExt('viewcount', array('parseinline'), $viewcount)); } else { $tpl->set('viewcount', false); } } else { $tpl->set('viewcount', false); } if ($wgPageShowWatchingUsers) { $dbr = wfGetDB(DB_SLAVE); $res = $dbr->select('watchlist', array('COUNT(*) AS n'), array('wl_title' => $dbr->strencode($this->mTitle->getDBkey()), 'wl_namespace' => $this->mTitle->getNamespace()), __METHOD__); $x = $dbr->fetchObject($res); $numberofwatchingusers = $x->n; if ($numberofwatchingusers > 0) { $tpl->set('numberofwatchingusers', wfMsgExt('number_of_watching_users_pageview', array('parseinline'), $wgLang->formatNum($numberofwatchingusers))); } else { $tpl->set('numberofwatchingusers', false); } } else { $tpl->set('numberofwatchingusers', false); } $tpl->set('copyright', $this->getCopyright()); $this->credits = false; if ($wgMaxCredits != 0) { $this->credits = Credits::getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax); } else { $tpl->set('lastmod', $this->lastModified()); } $tpl->setRef('credits', $this->credits); } elseif (isset($oldid) && !isset($diff)) { $tpl->set('copyright', $this->getCopyright()); $tpl->set('viewcount', false); $tpl->set('lastmod', false); $tpl->set('credits', false); $tpl->set('numberofwatchingusers', false); } else { $tpl->set('copyright', false); $tpl->set('viewcount', false); $tpl->set('lastmod', false); $tpl->set('credits', false); $tpl->set('numberofwatchingusers', false); } wfProfileOut(__METHOD__ . '-stuff3'); wfProfileIn(__METHOD__ . '-stuff4'); $tpl->set('copyrightico', $this->getCopyrightIcon()); $tpl->set('poweredbyico', $this->getPoweredBy()); $tpl->set('disclaimer', $this->disclaimerLink()); $tpl->set('privacy', $this->privacyLink()); $tpl->set('about', $this->aboutLink()); $tpl->set('footerlinks', array('info' => array('lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright'), 'places' => array('privacy', 'about', 'disclaimer'))); global $wgFooterIcons; $tpl->set('footericons', $wgFooterIcons); foreach ($tpl->data["footericons"] as $footerIconsKey => &$footerIconsBlock) { if (count($footerIconsBlock) > 0) { foreach ($footerIconsBlock as &$footerIcon) { if (isset($footerIcon["src"])) { if (!isset($footerIcon["width"])) { $footerIcon["width"] = 88; } if (!isset($footerIcon["height"])) { $footerIcon["height"] = 31; } } } } else { unset($tpl->data["footericons"][$footerIconsKey]); } } if ($wgDebugComments) { $tpl->setRef('debug', $out->mDebugtext); } else { $tpl->set('debug', ''); } $tpl->set('reporttime', wfReportTime()); $tpl->set('sitenotice', wfGetSiteNotice()); $tpl->set('bottomscripts', $this->bottomScripts($out)); $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n"; global $wgBetterDirectionality; if ($wgBetterDirectionality) { $realBodyAttribs = array('lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir()); $out->mBodytext = Html::rawElement('div', $realBodyAttribs, $out->mBodytext); } $out->mBodytext .= $printfooter . $this->generateDebugHTML(); $tpl->setRef('bodytext', $out->mBodytext); # Language links $language_urls = array(); if (!$wgHideInterlanguageLinks) { foreach ($out->getLanguageLinks() as $l) { $tmp = explode(':', $l, 2); $class = 'interwiki-' . $tmp[0]; unset($tmp); $nt = Title::newFromText($l); if ($nt) { $language_urls[] = array('href' => $nt->getFullURL(), 'text' => $wgContLang->getLanguageName($nt->getInterwiki()) != '' ? $wgContLang->getLanguageName($nt->getInterwiki()) : $l, 'title' => $nt->getText(), 'class' => $class); } } } if (count($language_urls)) { $tpl->setRef('language_urls', $language_urls); } else { $tpl->set('language_urls', false); } wfProfileOut(__METHOD__ . '-stuff4'); wfProfileIn(__METHOD__ . '-stuff5'); # Personal toolbar $tpl->set('personal_urls', $this->buildPersonalUrls()); $content_actions = $this->buildContentActionUrls(); $tpl->setRef('content_actions', $content_actions); $tpl->set('sidebar', $this->buildSidebar()); $tpl->set('nav_urls', $this->buildNavUrls()); // Set the head scripts near the end, in case the above actions resulted in added scripts if ($this->useHeadElement) { $tpl->set('headelement', $out->headElement($this)); } else { $tpl->set('headscripts', $out->getScript()); } // original version by hansm if (!wfRunHooks('SkinTemplateOutputPageBeforeExec', array(&$this, &$tpl))) { wfDebug(__METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n"); } // allow extensions adding stuff after the page content. // See Skin::afterContentHook() for further documentation. $tpl->set('dataAfterContent', $this->afterContentHook()); wfProfileOut(__METHOD__ . '-stuff5'); // execute template wfProfileIn(__METHOD__ . '-execute'); $res = $tpl->execute(); wfProfileOut(__METHOD__ . '-execute'); // result may be an error $this->printOrError($res); wfProfileOut(__METHOD__); }