function execute() { wfProfileIn(__METHOD__); global $wgContLang, $wgUser, $wgLogo, $wgStyleVersion, $wgRequest, $wgTitle, $wgSitename; global $wgMonacoUseSitenoticeIsland; $skin = $this->data['skin']; $action = $wgRequest->getText('action'); $namespace = $wgTitle->getNamespace(); $this->set('blankimg', $this->data['stylepath'] . '/monaco/style/images/blank.gif'); // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); $this->setupRightSidebar(); ob_start(); wfRunHooks('MonacoRightSidebar', array($this)); $this->addToRightSidebar(ob_get_contents()); ob_end_clean(); $this->html('headelement'); $this->printAdditionalHead(); // @fixme not valid wfProfileOut(__METHOD__ . '-head'); ?> <?php wfProfileIn(__METHOD__ . '-body'); // this hook allows adding extra HTML just after <body> opening tag // append your content to $html variable instead of echoing $html = ''; wfRunHooks('GetHTMLAfterBody', array($this, &$html)); echo $html; ?> <div id="skiplinks"> <a class="skiplink" href="#article" tabIndex=1>Skip to Content</a> <a class="skiplink wikinav" href="#widget_sidebar" tabIndex=1>Skip to Navigation</a> </div> <div id="background_accent1"></div> <div id="background_accent2"></div> <!-- HEADER --> <?php // curse like cobranding $this->printCustomHeader(); wfProfileIn(__METHOD__ . '-header'); ?> <div id="wikia_header" class="color2"> <div class="monaco_shrinkwrap"> <?php $this->printMonacoBranding(); $this->printUserData(); ?> </div> </div> <?php if (wfRunHooks('AlternateNavLinks')) { ?> <div id="background_strip" class="reset"> <div class="monaco_shrinkwrap"> <div id="accent_graphic1"></div> <div id="accent_graphic2"></div> </div> </div> <?php } ?> <!-- /HEADER --> <?php wfProfileOut(__METHOD__ . '-header'); ?> <!-- PAGE --> <?php wfProfileIn(__METHOD__ . '-page'); ?> <div id="monaco_shrinkwrap_main" class="monaco_shrinkwrap with_left_sidebar<?php if ($this->hasRightSidebar()) { echo ' with_right_sidebar'; } ?> "> <div id="page_wrapper"> <?php wfRunHooks('MonacoBeforePage', array($this)); $this->printBeforePage(); if ($wgMonacoUseSitenoticeIsland && $this->data['sitenotice']) { ?> <div class="page"> <div id="siteNotice"><?php $this->html('sitenotice'); ?> </div> </div> <?php } ?> <div id="wikia_page" class="page"> <?php $this->printMasthead(); wfRunHooks('MonacoBeforePageBar', array($this)); $this->printPageBar(); ?> <!-- ARTICLE --> <?php wfProfileIn(__METHOD__ . '-article'); ?> <article id="article" role="main" aria-labelledby="firstHeading"> <a name="top" id="top"></a> <?php wfRunHooks('MonacoAfterArticle', array($this)); // recipes: not needed? ?> <?php if (!$wgMonacoUseSitenoticeIsland && $this->data['sitenotice']) { ?> <div id="siteNotice"><?php $this->html('sitenotice'); ?> </div><?php } ?> <?php $this->printFirstHeading(); ?> <div id="bodyContent" class="body_content"> <h2 id="siteSub"><?php $this->msg('tagline'); ?> </h2> <?php if ($this->data['subtitle']) { ?> <div id="contentSub"><?php $this->html('subtitle'); ?> </div><?php } ?> <?php if ($this->data['undelete']) { ?> <div id="contentSub2"><?php $this->html('undelete'); ?> </div><?php } ?> <?php if ($this->data['newtalk']) { ?> <div class="usermessage noprint"><?php $this->html('newtalk'); ?> </div><?php } ?> <?php if (!empty($skin->newuemsg)) { echo $skin->newuemsg; } ?> <!-- start content --> <?php // Display content $this->printContent(); $this->printCategories(); ?> <!-- end content --> <?php if ($this->data['dataAfterContent']) { $this->html('dataAfterContent'); } ?> <div class="visualClear"></div> </div> </article> <!-- /ARTICLE --> <?php wfProfileOut(__METHOD__ . '-article'); ?> <!-- ARTICLE FOOTER --> <?php wfProfileIn(__METHOD__ . '-articlefooter'); global $wgTitle, $wgOut; $custom_article_footer = ''; $namespaceType = ''; wfRunHooks('CustomArticleFooter', array(&$this, &$tpl, &$custom_article_footer)); if ($custom_article_footer !== '') { echo $custom_article_footer; } else { //default footer if ($wgTitle->exists() && $wgTitle->isContentPage() && !$wgTitle->isTalkPage()) { $namespaceType = 'content'; } elseif ($wgTitle->isTalkPage()) { $namespaceType = 'talk'; } elseif ($namespace == NS_SPECIAL) { $namespaceType = 'none'; } $action = $wgRequest->getVal('action', 'view'); if ($namespaceType != 'none' && in_array($action, array('view', 'purge', 'edit', 'history', 'delete', 'protect'))) { $nav_urls = $this->data['nav_urls']; global $wgLang; ?> <div id="articleFooter" class="reset article_footer"> <table cellspacing="0"> <tr> <td class="col1"> <ul class="actions" id="articleFooterActions"> <?php if ($namespaceType == 'talk') { $custom_article_footer = ''; wfRunHooks('AddNewTalkSection', array(&$this, &$tpl, &$custom_article_footer)); if ($custom_article_footer != '') { echo $custom_article_footer; } } else { echo "\t\t\t\t\t\t\t\t"; echo Html::rawElement('li', null, Html::rawElement('a', array("id" => "fe_edit_icon", "href" => $wgTitle->getEditURL()), $this->blankimg(array("id" => "fe_edit_img", "class" => "sprite edit"))) . ' ' . Html::rawElement('div', null, wfMsgHtml('monaco-footer-improve', Html::element('a', array("id" => "fe_edit_link", "href" => $wgTitle->getEditURL()), wfMsg('monaco-footer-improve-linktext'))))); echo "\n"; } // haleyjd 20140801: Rewrite to use ContextSource/WikiPage instead of wgArticle global which has been removed from MediaWiki 1.23 $myContext = $this->getSkin()->getContext(); if ($myContext->canUseWikiPage()) { $wikiPage = $myContext->getWikiPage(); $timestamp = $wikiPage->getTimestamp(); $lastUpdate = $wgLang->date($timestamp); $userId = $wikiPage->getUser(); if ($userId > 0) { $user = User::newFromName($wikiPage->getUserText()); $userPageTitle = $user->getUserPage(); $userPageLink = $userPageTitle->getLocalUrl(); $userPageExists = $userPageTitle->exists(); $userGender = $user->getOption("gender"); $feUserIcon = $this->blankimg(array("id" => "fe_user_img", "class" => $userGender == "female" ? "sprite user-female" : "sprite user")); if ($userPageExists) { $feUserIcon = Html::rawElement('a', array("id" => "fe_user_icon", "href" => $userPageLink), $feUserIcon); } ?> <li><?php echo $feUserIcon; ?> <div><?php echo wfMsgHtml('monaco-footer-lastedit', $skin->link($userPageTitle, htmlspecialchars($user->getName()), array("id" => "fe_user_link")), Html::element('time', array('datetime' => wfTimestamp(TS_ISO_8601, ${$timestamp})), $lastUpdate)); ?> </div></li> <?php } } if ($this->data['copyright']) { $feCopyIcon = $this->blankimg(array("id" => "fe_copyright_img", "class" => "sprite copyright")); ?> <!-- haleyjd 20140425: generic copyright text support --> <li><?php echo $feCopyIcon; ?> <div id="copyright"><?php $this->html('copyright'); ?> </div></li> <?php } ?> </ul> </td> <td class="col2"> <?php if (!empty($this->data['content_actions']['history']) || !empty($nav_urls['recentchangeslinked'])) { ?> <ul id="articleFooterActions3" class="actions clearfix"> <?php if (!empty($this->data['content_actions']['history'])) { $feHistoryIcon = $this->blankimg(array("id" => "fe_history_img", "class" => "sprite history")); $feHistoryIcon = Html::rawElement("a", array("id" => "fe_history_icon", "href" => $this->data['content_actions']['history']['href']), $feHistoryIcon); $feHistoryLink = Html::rawElement("a", array("id" => "fe_history_link", "href" => $this->data['content_actions']['history']['href']), $this->data['content_actions']['history']['text']); ?> <li id="fe_history"><?php echo $feHistoryIcon; ?> <div><?php echo $feHistoryLink; ?> </div></li> <?php } if (!empty($nav_urls['recentchangeslinked'])) { $feRecentIcon = $this->blankimg(array("id" => "fe_recent_img", "class" => "sprite recent")); $feRecentIcon = Html::rawElement("a", array("id" => "fe_recent_icon", "href" => $nav_urls['recentchangeslinked']['href']), $feRecentIcon); $feRecentLink = Html::rawElement("a", array("id" => "fe_recent_link", "href" => $nav_urls['recentchangeslinked']['href']), wfMsgHtml('recentchangeslinked')); ?> <li id="fe_recent"><?php echo $feRecentIcon; ?> <div><?php echo $feRecentLink; ?> </div></li> <?php } ?> </ul> <?php } if (!empty($nav_urls['permalink']) || !empty($nav_urls['whatlinkshere'])) { ?> <ul id="articleFooterActions4" class="actions clearfix"> <?php if (!empty($nav_urls['permalink'])) { $fePermaIcon = $this->blankimg(array("id" => "fe_permalink_img", "class" => "sprite move")); $fePermaIcon = Html::rawElement("a", array("id" => "fe_permalink_icon", "href" => $nav_urls['permalink']['href']), $fePermaIcon); $fePermaLink = Html::rawElement("a", array("id" => "fe_permalink_link", "href" => $nav_urls['permalink']['href']), $nav_urls['permalink']['text']); ?> <li id="fe_permalink"><?php echo $fePermaIcon; ?> <div><?php echo $fePermaLink; ?> </div></li> <?php } if (!empty($nav_urls['whatlinkshere'])) { $feWhatIcon = $this->blankimg(array("id" => "fe_whatlinkshere_img", "class" => "sprite pagelink")); $feWhatIcon = Html::rawElement("a", array("id" => "fe_whatlinkshere_icon", "href" => $nav_urls['whatlinkshere']['href']), $feWhatIcon); $feWhatLink = Html::rawElement("a", array("id" => "fe_whatlinkshere_link", "href" => $nav_urls['whatlinkshere']['href']), wfMsgHtml('whatlinkshere')); ?> <li id="fe_whatlinkshere"><?php echo $feWhatIcon; ?> <div><?php echo $feWhatLink; ?> </div></li> <?php } ?> </ul> <?php } $feRandIcon = $this->blankimg(array("id" => "fe_random_img", "class" => "sprite random")); $feRandIcon = Html::rawElement("a", array("id" => "fe_random_icon", "href" => Skin::makeSpecialUrl('Randompage')), $feRandIcon); $feRandLink = Html::rawElement("a", array("id" => "fe_random_link", "href" => Skin::makeSpecialUrl('Randompage')), wfMsgHtml('viewrandompage')); ?> <ul class="actions clearfix" id="articleFooterActions2"> <li id="fe_randompage"><?php echo $feRandIcon; ?> <div><?php echo $feRandLink; ?> </div></li> <?php // haleyjd 20140426: support for Extension:MobileFrontend if ($this->get('mobileview') !== null) { $feMobileIcon = $this->blankimg(array("id" => "fe_mobile_img", "class" => "sprite mobile")); ?> <li id="fe_mobile"><?php echo $feMobileIcon; ?> <div><?php $this->html('mobileview'); ?> </div></li> <?php } ?> </ul> </td> </tr> </table> </div> <?php } //end $namespaceType != 'none' } //end else from CustomArticleFooter hook ?> <!-- /ARTICLE FOOTER --> <?php wfProfileOut(__METHOD__ . '-articlefooter'); ?> </div> <!-- /PAGE --> <?php wfProfileOut(__METHOD__ . '-page'); ?> <noscript><link rel="stylesheet" type="text/css" href="<?php $this->text('stylepath'); ?> /monaco/style/css/noscript.css?<?php echo $wgStyleVersion; ?> " /></noscript> <?php if (!($wgRequest->getVal('action') != '' || $namespace == NS_SPECIAL)) { $this->html('JSloader'); $this->html('headscripts'); } ?> </div> <?php $this->printRightSidebar(); ?> <!-- WIDGETS --> <?php wfProfileIn(__METHOD__ . '-navigation'); ?> <div id="widget_sidebar" class="reset widget_sidebar left_sidebar sidebar"> <div id="wiki_logo" style="background-image: url(<?php $this->html('logopath'); ?> );"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href']); ?> " accesskey="z" rel="home"><?php echo $wgSitename; ?> </a></div> <!--[if lt IE 7]> <style type="text/css"> #wiki_logo { background-image: none !important; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo Xml::escapeJsString($this->data['logopath']); ?> ', sizingMethod='image'); } </style> <![endif]--> <!-- SEARCH/NAVIGATION --> <div class="widget sidebox navigation_box" id="navigation_widget" role="navigation"> <?php global $wgSitename; $msgSearchLabel = wfMsgHtml('Tooltip-search'); $searchLabel = wfEmptyMsg('Tooltip-search', $msgSearchLabel) ? wfMsgHtml('ilsubmit') . ' ' . $wgSitename . '...' : $msgSearchLabel; ?> <div id="search_box" class="color1" role="search"> <form action="<?php $this->text('searchaction'); ?> " id="searchform"> <label style="display: none;" for="search_field"><?php echo htmlspecialchars($searchLabel); ?> </label> <?php echo Html::input('search', '', 'text', array('id' => "searchInput", 'name' => "search", 'type' => "text", 'maxlength' => 200, 'alt' => $searchLabel, 'aria-label' => $searchLabel, 'placeholder' => $searchLabel, 'tabIndex' => 2, 'aria-required' => 'true', 'aria-flowto' => "search-button") + $skin->tooltipAndAccesskeyAttribs('search')); ?> <?php global $wgSearchDefaultFulltext; ?> <input type="hidden" name="<?php echo $wgSearchDefaultFulltext ? 'fulltext' : 'go'; ?> " value="1" /> <input type="image" alt="<?php echo htmlspecialchars(wfMsgHtml('search')); ?> " src="<?php $this->text('blankimg'); ?> " id="search-button" class="sprite search" tabIndex=2 /> </form> </div> <?php $monacoSidebar = new MonacoSidebar(); if (isset($this->data['content_actions']['edit'])) { $monacoSidebar->editUrl = $this->data['content_actions']['edit']['href']; } echo $monacoSidebar->getCode(); echo '<table cellspacing="0" id="link_box_table">'; //BEGIN: create dynamic box $showDynamicLinks = true; $dynamicLinksArray = array(); global $wgRequest; if ($wgRequest->getText('action') == 'edit' || $wgRequest->getText('action') == 'submit') { $showDynamicLinks = false; } if ($showDynamicLinks) { $dynamicLinksInternal = array(); global $wgMonacoDynamicCreateOverride; $createPage = null; $writeArticleUrl = wfMsg('dynamic-links-write-article-url'); if ($writeArticleUrl && $writeArticleUrl !== '-' && !wfEmptyMsg('dynamic-links-write-article-url', $writeArticleUrl)) { $createPage = Title::newFromText($writeArticleUrl); } if (!isset($createPage) && !empty($wgMonacoDynamicCreateOverride)) { $createPage = Title::newFromText($wgMonacoDynamicCreateOverride); } if (!isset($createPage)) { $specialCreatePage = SpecialPageFactory::getPage('CreatePage'); if ($specialCreatePage && $specialCreatePage->userCanExecute($wgUser)) { $createPage = SpecialPage::getTitleFor('CreatePage'); } } if (isset($createPage) && ($wgUser->isAllowed('edit') || $wgUser->isAnon())) { /* Redirect to login page instead of showing error, see Login friction project */ $dynamicLinksInternal["write-article"] = array('url' => $wgUser->isAnon() ? SpecialPage::getTitleFor('UserLogin')->getLocalURL(array("returnto" => $createPage->getPrefixedDBkey())) : $createPage->getLocalURL(), 'icon' => 'edit'); } global $wgEnableUploads, $wgUploadNavigationUrl; if (($wgEnableUploads || $wgUploadNavigationUrl) && ($wgUser->isAllowed('upload') || $wgUser->isAnon() || $wgUploadNavigationUrl)) { $uploadPage = SpecialPage::getTitleFor('Upload'); /* Redirect to login page instead of showing error, see Login friction project */ if ($wgUploadNavigationUrl) { $url = $wgUploadNavigationUrl; } else { $url = $wgUser->isAnon() ? SpecialPage::getTitleFor('UserLogin')->getLocalURL(array("returnto" => $uploadPage->getPrefixedDBkey())) : $uploadPage->getLocalURL(); } $dynamicLinksInternal["add-image"] = array('url' => $url, 'icon' => 'photo'); } $this->extendDynamicLinks($dynamicLinksInternal); wfRunHooks('MonacoDynamicLinks', array($this, &$dynamicLinksInternal)); $this->extendDynamicLinksAfterHook($dynamicLinksInternal); $dynamicLinksUser = array(); foreach (explode("\n", wfMsgForContent('dynamic-links')) as $line) { if (!$line || $line[0] == ' ') { continue; } $line = trim($line, '* '); $url = wfMsg("dynamic-links-{$line}-url"); if ($url && $url !== '-' && !wfEmptyMsg("dynamic-links-{$line}-url", $url)) { $url = Title::newFromText($url); if ($url) { $dynamicLinksUser[$line] = array("url" => $url, "icon" => "edit"); } } } foreach ($dynamicLinksUser as $key => $value) { $dynamicLinksArray[$key] = $value; } foreach ($dynamicLinksInternal as $key => $value) { $dynamicLinksArray[$key] = $value; } } if (count($dynamicLinksArray) > 0) { ?> <tbody id="link_box_dynamic"> <tr> <td colspan="2"> <ul> <?php foreach ($dynamicLinksArray as $key => $link) { $link['id'] = "dynamic-links-{$key}"; if (!isset($link['text'])) { $link['text'] = wfMsg("dynamic-links-{$key}"); } echo "\t\t\t\t\t\t"; echo Html::rawElement('li', array("id" => "{$link['id']}-row", "class" => "link_box_dynamic_item"), Html::rawElement('a', array("id" => "{$link['id']}-icon", "href" => $link['url'], "tabIndex" => -1), $this->blankimg(array("id" => "{$link['id']}-img", "class" => "sprite {$link['icon']}", "alt" => ""))) . ' ' . Html::element('a', array("id" => "{$link['id']}-link", "href" => $link["url"], "tabIndex" => 3), $link["text"])); echo "\n"; } ?> </ul> </td> </tr> </tbody> <?php } //END: create dynamic box //BEGIN: create static box $linksArrayL = $linksArrayR = array(); $linksArray = $this->data['data']['toolboxlinks']; //add user specific links if (!empty($nav_urls['contributions'])) { $linksArray[] = array('href' => $nav_urls['contributions']['href'], 'text' => wfMsg('contributions')); } if (!empty($nav_urls['blockip'])) { $linksArray[] = array('href' => $nav_urls['blockip']['href'], 'text' => wfMsg('blockip')); } if (!empty($nav_urls['emailuser'])) { $linksArray[] = array('href' => $nav_urls['emailuser']['href'], 'text' => wfMsg('emailuser')); } if (is_array($linksArray) && count($linksArray) > 0) { global $wgSpecialPagesRequiredLogin; for ($i = 0, $max = max(array_keys($linksArray)); $i <= $max; $i++) { $item = isset($linksArray[$i]) ? $linksArray[$i] : false; //Redirect to login page instead of showing error, see Login friction project if ($item !== false && $wgUser->isAnon() && isset($item['specialCanonicalName']) && in_array($item['specialCanonicalName'], $wgSpecialPagesRequiredLogin)) { $returnto = SpecialPage::getTitleFor($item['specialCanonicalName'])->getPrefixedDBkey(); $item['href'] = SpecialPage::getTitleFor('UserLogin')->getLocalURL(array("returnto" => $returnto)); } $i & 1 ? $linksArrayR[] = $item : ($linksArrayL[] = $item); } } if (count($linksArrayL) > 0 || count($linksArrayR) > 0) { ?> <tbody id="link_box" class="color2 linkbox_static"> <tr> <td> <ul> <?php if (is_array($linksArrayL) && count($linksArrayL) > 0) { foreach ($linksArrayL as $key => $val) { if ($val === false) { echo '<li> </li>'; } else { ?> <li><a<?php if (!isset($val['internal']) || !$val['internal']) { ?> rel="nofollow"<?php } ?> href="<?php echo htmlspecialchars($val['href']); ?> " tabIndex=3><?php echo htmlspecialchars($val['text']); ?> </a></li> <?php } } } ?> </ul> </td> <td> <ul> <?php if (is_array($linksArrayR) && count($linksArrayR) > 0) { foreach ($linksArrayR as $key => $val) { if ($val === false) { echo '<li> </li>'; } else { ?> <li><a<?php if (!isset($val['internal']) || !$val['internal']) { ?> rel="nofollow"<?php } ?> href="<?php echo htmlspecialchars($val['href']); ?> " tabIndex=3><?php echo htmlspecialchars($val['text']); ?> </a></li> <?php } } } ?> <li style="font-size: 1px; position: absolute; top: -10000px"><a href="<?php echo Title::newFromText('Special:Recentchanges')->getLocalURL(); ?> " accesskey="r">Recent changes</a><a href="<?php echo Title::newFromText('Special:Random')->getLocalURL(); ?> " accesskey="x">Random page</a></li> </ul> </td> </tr> <!-- haleyjd 20140420: FIXME: DoomWiki.org-specific; make generic! (hosted button id value edited for Orain, uncomment all but this line and change id for your own site) --> <!-- <tr> <!-- <td colspan="2" style="text-align:center;"> --> <!-- <form action="https://www.paypal.com/us/cgi-bin/webscr" method="post"> --> <!-- <input type="hidden" name="cmd" value="_s-xclick"> --> <!-- <input type="hidden" name="hosted_button_id" value="9PHM56HNJ428S"> --> <!-- <input type="image" src="<?php $this->text('stylepath'); ?> /monaco/style/images/contribute-button.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="width:139px;margin:0;"> --> <!-- </form> --> <!-- </td> --> <!-- </tr> --> </tbody> <?php } //END: create static box ?> </table> </div> <!-- /SEARCH/NAVIGATION --> <?php $this->printExtraSidebar(); wfRunHooks('MonacoSidebarEnd', array($this)); wfProfileOut(__METHOD__ . '-navigation'); wfProfileIn(__METHOD__ . '-widgets'); ?> </div> <!-- /WIDGETS --> <!--/div--> <?php wfProfileOut(__METHOD__ . '-widgets'); // curse like cobranding $this->printCustomFooter(); ?> <?php echo '</div>'; $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ wfRunHooks('SpecialFooter'); ?> <div id="positioned_elements" class="reset"></div> <?php $this->delayedPrintCSSdownload(); $this->html('reporttime'); wfProfileOut(__METHOD__ . '-body'); ?> </body> </html> <?php wfProfileOut(__METHOD__); }
public function getMenuLines() { /* # if a local copy exists, try to use that first $revision = Revision::newFromTitle(Title::newFromText('Monaco-sidebar', NS_MEDIAWIKI)); if(is_object($revision) && trim($revision->getText()) != '') { $lines = MonacoSidebar::getMessageAsArray('Monaco-sidebar'); } */ # if we STILL have no menu lines, fall back to just loading the default from the message system if (empty($lines)) { $lines = MonacoSidebar::getMessageAsArray('Monaco-sidebar'); } return $lines; }