Localisation updates for core messages from Betawiki (2008-06-23 22:55 CEST)
[lhc/web/wiklou.git] / includes / Skin.php
index dbb6001..3f8c6b9 100644 (file)
@@ -1,16 +1,18 @@
 <?php
+/**
+ * @defgroup Skins Skins
+ */
+
 if ( ! defined( 'MEDIAWIKI' ) )
        die( 1 );
 
-# See skin.txt
-
 /**
  * The main skin class that provide methods and properties for all other skins.
  * This base class is also the "Standard" skin.
  *
  * See docs/skin.txt for more information.
  *
- * @addtogroup Skins
+ * @ingroup Skins
  */
 class Skin extends Linker {
        /**#@+
@@ -878,10 +880,10 @@ END;
        function subPageSubtitle() {
                $subpages = '';
                if(!wfRunHooks('SkinSubPageSubtitle', array(&$subpages)))
-                       return $retval;
+                       return $subpages;
 
-               global $wgOut, $wgTitle, $wgNamespacesWithSubpages;
-               if($wgOut->isArticle() && !empty($wgNamespacesWithSubpages[$wgTitle->getNamespace()])) {
+               global $wgOut, $wgTitle;
+               if($wgOut->isArticle() && MWNamespace::hasSubpages( $wgTitle->getNamespace() )) {
                        $ptext=$wgTitle->getPrefixedText();
                        if(preg_match('/\//',$ptext)) {
                                $links = explode('/',$ptext);
@@ -1648,24 +1650,18 @@ END;
         * Build an array that represents the sidebar(s), the navigation bar among them
         *
         * @return array
-        * @private
         */
        function buildSidebar() {
                global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
-               global $wgLang, $wgContLang;
-
-               $fname = 'SkinTemplate::buildSidebar';
-
-               wfProfileIn( $fname );
+               global $wgLang;
+               wfProfileIn( __METHOD__ );
 
-               $key = wfMemcKey( 'sidebar' );
-               $cacheSidebar = $wgEnableSidebarCache &&
-                       ($wgLang->getCode() == $wgContLang->getCode());
+               $key = wfMemcKey( 'sidebar', $wgLang->getCode() );
 
-               if ($cacheSidebar) {
+               if ( $wgEnableSidebarCache ) {
                        $cachedsidebar = $parserMemc->get( $key );
-                       if ($cachedsidebar!="") {
-                               wfProfileOut($fname);
+                       if ( $cachedsidebar ) {
+                               wfProfileOut( __METHOD__ );
                                return $cachedsidebar;
                        }
                }
@@ -1681,7 +1677,7 @@ END;
                                $heading = $line;
                        } else {
                                if (strpos($line, '|') !== false) { // sanity check
-                                       $line = explode( '|' , trim($line, '* '), 2 );
+                                       $line = array_map('trim', explode( '|' , trim($line, '* '), 2 ) );
                                        $link = wfMsgForContent( $line[0] );
                                        if ($link == '-')
                                                continue;
@@ -1711,9 +1707,8 @@ END;
                                } else { continue; }
                        }
                }
-               if ($cacheSidebar)
-                       $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
-               wfProfileOut( $fname );
+               if ( $wgEnableSidebarCache ) $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
+               wfProfileOut( __METHOD__ );
                return $bar;
        }
 }