Merge "Less wild whitespace"
[lhc/web/wiklou.git] / includes / Skin.php
index 968f215..4889863 100644 (file)
@@ -73,7 +73,7 @@ abstract class Skin extends ContextSource {
                return $wgValidSkinNames;
        }
 
-       /**
+       /**
         * Fetch the skinname messages for available skins.
         * @return array of strings
         */
@@ -290,8 +290,8 @@ abstract class Skin extends ContextSource {
                        return $this->mRelevantUser;
                }
                $title = $this->getRelevantTitle();
-               if( $title->getNamespace() == NS_USER || $title->getNamespace() == NS_USER_TALK ) {
-                       $rootUser = strtok( $title->getText(), '/' );
+               if( $title->hasSubjectNamespace( NS_USER ) ) {
+                       $rootUser = $title->getRootText();
                        if ( User::isIP( $rootUser ) ) {
                                $this->mRelevantUser = User::newFromName( $rootUser, false );
                        } else {
@@ -1132,7 +1132,23 @@ abstract class Skin extends ContextSource {
        }
 
        /**
-        * Build an array that represents the sidebar(s), the navigation bar among them
+        * Build an array that represents the sidebar(s), the navigation bar among them.
+        *
+        * BaseTemplate::getSidebar can be used to simplify the format and id generation in new skins.
+        *
+        * The format of the returned array is array( heading => content, ... ), where:
+        * - heading is the heading of a navigation portlet. It is either:
+        *   - magic string to be handled by the skins ('SEARCH' / 'LANGUAGES' / 'TOOLBOX' / ...)
+        *   - a message name (e.g. 'navigation'), the message should be HTML-escaped by the skin
+        *   - plain text, which should be HTML-escaped by the skin
+        * - content is the contents of the portlet. It is either:
+        *   - HTML text (<ul><li>...</li>...</ul>)
+        *   - array of link data in a format accepted by BaseTemplate::makeListItem()
+        *   - (for a magic string as a key, any value)
+        *
+        * Note that extensions can control the sidebar contents using the SkinBuildSidebar hook
+        * and can technically insert anything in here; skin creators are expected to handle
+        * values described above.
         *
         * @return array
         */
@@ -1536,6 +1552,7 @@ abstract class Skin extends ContextSource {
         *
         * @param $fname String Name of called method
         * @param $args Array Arguments to the method
+        * @throws MWException
         * @return mixed
         */
        function __call( $fname, $args ) {