Marked canChangePassword protected, w/s fixes
[lhc/web/wiklou.git] / skins / Vector.php
index 8b00521..e0d87a8 100644 (file)
@@ -29,7 +29,7 @@ class SkinVector extends SkinTemplate {
                global $wgLocalStylePath, $wgRequest;
 
                parent::initPage( $out );
-               
+
                // Append CSS which includes IE only behavior fixes for hover support -
                // this is better than including this in a CSS fille since it doesn't
                // wait for the CSS file to load before fetching the HTC file.
@@ -39,7 +39,7 @@ class SkinVector extends SkinTemplate {
                                htmlspecialchars( $wgLocalStylePath ) .
                                "/{$this->stylename}/csshover{$min}.htc\")}</style><![endif]-->"
                );
-               
+
                $out->addModuleScripts( 'skins.vector' );
        }
 
@@ -80,7 +80,7 @@ class VectorTemplate extends BaseTemplate {
                // Build additional attributes for navigation urls
                //$nav = $this->skin->buildNavigationUrls();
                $nav = $this->data['content_navigation'];
-               
+
                if ( $wgVectorUseIconWatch ) {
                        $mode = $this->skin->getTitle()->userIsWatching() ? 'unwatch' : 'watch';
                        if ( isset( $nav['actions'][$mode] ) ) {
@@ -97,7 +97,7 @@ class VectorTemplate extends BaseTemplate {
                                if ( $section == 'views' && !( isset( $link['primary'] ) && $link['primary'] ) ) {
                                        $link['class'] = rtrim( 'collapsible ' . $link['class'], ' ' );
                                }
-                               
+
                                $xmlID = isset( $link['id'] ) ? $link['id'] : 'ca-' . $xmlID;
                                $nav[$section][$key]['attributes'] =
                                        ' id="' . Sanitizer::escapeId( $xmlID ) . '"';
@@ -108,7 +108,7 @@ class VectorTemplate extends BaseTemplate {
                                }
                                if ( isset( $link['tooltiponly'] ) && $link['tooltiponly'] ) {
                                        $nav[$section][$key]['key'] =
-                                               Linker::tooltip( $xmlID );
+                                               Linker::titleAttrib( $xmlID );
                                } else {
                                        $nav[$section][$key]['key'] =
                                                Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( $xmlID ) );
@@ -135,7 +135,7 @@ class VectorTemplate extends BaseTemplate {
                <div id="mw-page-base" class="noprint"></div>
                <div id="mw-head-base" class="noprint"></div>
                <!-- content -->
-               <div id="content"<?php $this->html( 'specialpageattributes' ) ?>>
+               <div id="content">
                        <a id="top"></a>
                        <div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div>
                        <?php if ( $this->data['sitenotice'] ): ?>
@@ -184,9 +184,6 @@ class VectorTemplate extends BaseTemplate {
                                </div>
                                <!-- /printfooter -->
                                <?php endif; ?>
-                               <!-- debughtml -->
-                               <?php $this->html( 'debughtml' ); ?>
-                               <!-- /debughtml -->
                                <?php if ( $this->data['catlinks'] ): ?>
                                <!-- catlinks -->
                                <?php $this->html( 'catlinks' ); ?>
@@ -198,6 +195,9 @@ class VectorTemplate extends BaseTemplate {
                                <!-- /dataAfterContent -->
                                <?php endif; ?>
                                <div class="visualClear"></div>
+                               <!-- debughtml -->
+                               <?php $this->html( 'debughtml' ); ?>
+                               <!-- /debughtml -->
                        </div>
                        <!-- /bodyContent -->
                </div>
@@ -216,7 +216,7 @@ class VectorTemplate extends BaseTemplate {
                <!-- panel -->
                        <div id="mw-panel" class="noprint">
                                <!-- logo -->
-                                       <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ?>></a></div>
+                                       <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>></a></div>
                                <!-- /logo -->
                                <?php $this->renderPortals( $this->data['sidebar'] ); ?>
                        </div>
@@ -258,6 +258,8 @@ class VectorTemplate extends BaseTemplate {
 
        /**
         * Render a series of portals
+        *
+        * @param $portals array
         */
        private function renderPortals( $portals ) {
                // Force the rendering of the following portals
@@ -272,6 +274,9 @@ class VectorTemplate extends BaseTemplate {
                }
                // Render portals
                foreach ( $portals as $name => $content ) {
+                       if ( $content === false )
+                               continue;
+
                        echo "\n<!-- {$name} -->\n";
                        switch( $name ) {
                                case 'SEARCH':
@@ -297,8 +302,8 @@ class VectorTemplate extends BaseTemplate {
                        $msg = $name;
                }
                ?>
-<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::tooltip( 'p-' . $name ) ?>>
-       <h5<?php $this->html( 'userlangattributes' ) ?>><?php $out = wfMsg( $msg ); if ( wfEmptyMsg( $msg ) ) echo htmlspecialchars( $msg ); else echo htmlspecialchars( $out ); ?></h5>
+<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::titleAttrib( 'p-' . $name ) ?>>
+       <h5<?php $this->html( 'userlangattributes' ) ?>><?php $msgObj = wfMessage( $msg ); echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); ?></h5>
        <div class="body">
 <?php
                if ( is_array( $content ) ): ?>
@@ -327,16 +332,18 @@ class VectorTemplate extends BaseTemplate {
        /**
         * Render one or more navigations elements by name, automatically reveresed
         * when UI is in RTL mode
+        *
+        * @param $elements array
         */
        private function renderNavigation( $elements ) {
-               global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser;
+               global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang;
 
                // If only one element was given, wrap it in an array, allowing more
                // flexible arguments
                if ( !is_array( $elements ) ) {
                        $elements = array( $elements );
                // If there's a series of elements, reverse them when in RTL mode
-               } elseif ( wfUILang()->isRTL() ) {
+               } elseif ( $wgLang->isRTL() ) {
                        $elements = array_reverse( $elements );
                }
                // Render elements