コード例 #1
0
 /**
  * skinTemplateOutputPageBeforeExec hook
  * 
  * Cooks the skin template Seizam-Style!
  * 
  * @param SkinSkinzam $skin
  * @param SkinzamTemplate $tpl
  */
 public static function skinTemplateOutputPageBeforeExec(&$skin, &$tpl)
 {
     $background['url'] = false;
     $navigation['content'] = false;
     $title = $skin->getRelevantTitle();
     $ns = $title->getNamespace();
     if (WpPage::isInWikiplaceNamespaces($ns)) {
         $explosion = WpWikiplace::explodeWikipageKey($title->getText(), $ns);
         $wikiplaceKey = $explosion[0];
         // Wikiplace Background?g|png|gif)$/i';
         $background['url'] = self::getBackgroundUrlForWikiPlace($wikiplaceKey);
         // Wikiplace Navigation Menu
         $navigationKey = $wikiplaceKey . '/' . WPNAVIGATIONKEY;
         /** @todo i18n */
         $navigationTitle = Title::newFromText($navigationKey, NS_WIKIPLACE);
         $navigationPage = WikiPage::factory($navigationTitle);
         $navigationText = $navigationPage->getText();
         if ($navigationText) {
             $navigationArticle = Article::newFromTitle($navigationTitle, $skin->getContext());
             $navigation['content'] = $navigationArticle->getOutputFromWikitext($navigationText)->getText();
         }
     } else {
         $background['url'] = self::getBackgroundUrlForOther($title);
     }
     $tpl->set('wp_background', $background);
     $tpl->set('wp_navigation', $navigation);
     return true;
 }
コード例 #2
0
ファイル: Skinzam.hooks.php プロジェクト: eFFemeer/seizamcore
 /**
  *
  * @global type $wgUseCombinedLoginLink
  * @param SkinSkinzam $skin
  * @param SkinzamTemplate $tpl
  * @return type 
  */
 private static function getAbsoluteFooterUrls($skin, $tpl)
 {
     $absoluteFooterUrls = array();
     if ($skin->loggedin) {
         $absoluteFooterUrls['myseizam'] = array('text' => wfMessage('sz-myseizam'), 'href' => Skin::makeSpecialUrl('MySeizam'), 'class' => false, 'active' => $skin->thispage == 'Special:MySeizam');
         $absoluteFooterUrls['logout'] = array('text' => wfMessage('logout'), 'href' => Skin::makeSpecialUrl('UserLogout', array('returnto' => $skin->getRelevantTitle())), 'active' => $skin->thispage == 'Special:AllPages');
         $szPrettyUserName = $skin->username;
         $tpl->set('sz_pretty_username', $szPrettyUserName);
     } else {
         $absoluteFooterUrls['login'] = $tpl->data['personal_urls']['login'];
         global $wgUseCombinedLoginLink;
         if (!$wgUseCombinedLoginLink) {
             $absoluteFooterUrls['createaccount'] = $tpl->data['personal_urls']['createaccount'];
         }
     }
     return $absoluteFooterUrls;
 }