Missed out an instance when renaming "wikipediapage"
[lhc/web/wiklou.git] / includes / Skin.php
index 043ae38..46a2fa9 100644 (file)
@@ -37,7 +37,7 @@ unset($matches);
  */
 class Skin extends Linker {
        /**#@+
-        * @access private
+        * @private
         */
        var $lastdate, $lastline;
        var $rc_cache ; # Cache for Enhanced Recent Changes
@@ -280,7 +280,7 @@ class Skin extends Linker {
         *
         * @param string $action
         * @return bool
-        * @access private
+        * @private
         */
        function userCanPreview( $action ) {
                global $wgTitle, $wgRequest, $wgUser;
@@ -330,6 +330,7 @@ class Skin extends Linker {
 
        /**
         * Some styles that are set by user through the user settings interface.
+        * @todo undefined variables (bug #4940)
         */
        function doGetUserStyles() {
                global $wgUser, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
@@ -337,6 +338,7 @@ class Skin extends Linker {
                $s = '';
 
                if( $wgAllowUserCss && $wgUser->isLoggedIn() ) { # logged in
+                       # FIXME: $action undefined, bug #4940
                        if($wgTitle->isCssSubpage() && $this->userCanPreview( $action ) ) {
                                $s .= $wgRequest->getText('wpTextbox1');
                        } else {
@@ -502,16 +504,19 @@ END;
 
                if( count( $wgOut->mCategoryLinks ) == 0 ) return '';
 
+               # Separator
+               $sep = wfMsgHtml( 'catseparator' );
+
                // Use Unicode bidi embedding override characters,
                // to make sure links don't smash each other up in ugly ways.
                $dir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
                $embed = "<span dir='$dir'>";
                $pop = '</span>';
-               $t = $embed . implode ( "$pop | $embed" , $wgOut->mCategoryLinks ) . $pop;
+               $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop;
 
-               $msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories';
+               $msg = wfMsgExt('categories', array('parsemag', 'escape'), count( $wgOut->mCategoryLinks ));
                $s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ),
-                       wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
+                       $msg, 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
                        . ': ' . $t;
 
                # optional 'dmoz-like' category browser. Will be shown under the list
@@ -535,9 +540,9 @@ END;
        }
 
        /** Render the array as a serie of links.
-        * @param array $tree Categories tree returned by Title::getParentCategoryTree
-        * @param object &skin Skin passed by reference
-        * @return string separated by &gt;, terminate with "\n"
+        * @param $tree Array: categories tree returned by Title::getParentCategoryTree
+        * @param &skin Object: skin passed by reference
+        * @return String separated by &gt;, terminate with "\n"
         */
        function drawCategoryBrowser($tree, &$skin) {
                $return = '';
@@ -568,8 +573,8 @@ END;
        }
 
        /**
-        * This gets called immediately before the </body> tag.
-        * @return string HTML to be put after </body> ???
+        * This gets called immediately before the \</body\> tag.
+        * @return String HTML to be put after \</body\> ???
         */
        function afterContent() {
                $printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
@@ -657,7 +662,7 @@ END;
                        return wfMsg( $msg,
                                $this->makeKnownLink(
                                        $wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ),
-                                       wfMsg( 'restorelink' . ($n == 1 ? '1' : ''), $n ) ) );
+                                       wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) );
                }
                return '';
        }
@@ -686,7 +691,6 @@ END;
 
        function pageTitle() {
                global $wgOut;
-
                $s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
                return $s;
        }
@@ -889,7 +893,7 @@ END;
                if ( !$wgDisableCounters ) {
                        $count = $wgLang->formatNum( $wgArticle->getCount() );
                        if ( $count ) {
-                               $s = wfMsg( 'viewcount', $count );
+                               $s = wfMsgExt( 'viewcount', array( 'parseinline' ), $count );
                        }
                }
 
@@ -1115,7 +1119,7 @@ END;
         * This may include an 'oldid' specifier, if the current page view is such.
         *
         * @return string
-        * @access private
+        * @private
         */
        function editUrlOptions() {
                global $wgArticle;
@@ -1326,7 +1330,7 @@ END;
                                $text = wfMsg('userpage');
                                break;
                        case NS_PROJECT:
-                               $text = wfMsg('wikipediapage');
+                               $text = wfMsg('projectpage');
                                break;
                        case NS_IMAGE:
                                $text = wfMsg('imagepage');
@@ -1345,13 +1349,24 @@ END;
        }
 
        function commentLink() {
-               global $wgTitle;
+               global $wgTitle, $wgOut;
 
                if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
                        return '';
                }
-               return $this->makeKnownLinkObj( $wgTitle->getTalkPage(),
-                       wfMsg( 'postcomment' ), 'action=edit&section=new' );
+               
+               # __NEWSECTIONLINK___ changes behaviour here
+               # If it's present, the link points to this page, otherwise
+               # it points to the talk page
+               if( $wgTitle->isTalkPage() ) {
+                       $title =& $wgTitle;
+               } elseif( $wgOut->showNewSectionLink() ) {
+                       $title =& $wgTitle;
+               } else {
+                       $title =& $wgTitle->getTalkPage();
+               }
+               
+               return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit&section=new' );
        }
 
        /* these are used extensively in SkinTemplate, but also some other places */
@@ -1425,23 +1440,22 @@ END;
         * Build an array that represents the sidebar(s), the navigation bar among them
         *
         * @return array
-        * @access private
+        * @private
         */
        function buildSidebar() {
-               global $wgDBname, $parserMemc;
+               global $wgDBname, $parserMemc, $wgEnableSidebarCache;
                global $wgLanguageCode, $wgContLanguageCode;
 
                $fname = 'SkinTemplate::buildSidebar';
 
                wfProfileIn( $fname );
 
-               if ($wgLanguageCode == $wgContLanguageCode)
-                       $cacheSidebar = true;
-               else
-                       $cacheSidebar = false;
+               $key = "{$wgDBname}:sidebar";
+               $cacheSidebar = $wgEnableSidebarCache &&
+                       ($wgLanguageCode == $wgContLanguageCode);
                
                if ($cacheSidebar) {
-                       $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar");
+                       $cachedsidebar = $parserMemc->get( $key );
                        if ($cachedsidebar!="") {
                                wfProfileOut($fname);
                                return $cachedsidebar;
@@ -1477,7 +1491,7 @@ END;
                        }
                }
                if ($cacheSidebar)
-                       $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400);
+                       $cachednotice = $parserMemc->set( $key, $bar, 86400 );
                wfProfileOut( $fname );
                return $bar;
        }