Avoid an infinite redirect in $wgSecureLogin handling
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 4f0e1fe..32f0ed3 100644 (file)
@@ -104,7 +104,11 @@ class SkinTemplate extends Skin {
         * @param $out OutputPage
         */
        function setupSkinUserCss( OutputPage $out ) {
-               $out->addModuleStyles( array( 'mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint' ) );
+               $out->addModuleStyles( array(
+                       'mediawiki.legacy.shared',
+                       'mediawiki.legacy.commonPrint',
+                       'mediawiki.ui.button'
+               ) );
        }
 
        /**
@@ -398,6 +402,8 @@ class SkinTemplate extends Skin {
                // that interface elements are in a different language.
                $tpl->set( 'userlangattributes', '' );
                $tpl->set( 'specialpageattributes', '' ); # obsolete
+               // Used by VectorBeta to insert HTML before content but after the heading for the page title. Defaults to empty string.
+               $tpl->set( 'prebodyhtml', '' );
 
                if ( $userLangCode !== $wgContLang->getHtmlCode() || $userLangDir !== $wgContLang->getDir() ) {
                        $escUserlang = htmlspecialchars( $userLangCode );
@@ -1596,7 +1602,7 @@ abstract class BaseTemplate extends QuickTemplate {
                        if ( isset( $plink['active'] ) ) {
                                $ptool['active'] = $plink['active'];
                        }
-                       foreach ( array( 'href', 'class', 'text' ) as $k ) {
+                       foreach ( array( 'href', 'class', 'text', 'dir' ) as $k ) {
                                if ( isset( $plink[$k] ) ) {
                                        $ptool['links'][0][$k] = $plink[$k];
                                }
@@ -1734,6 +1740,19 @@ abstract class BaseTemplate extends QuickTemplate {
                return $boxes;
        }
 
+       /**
+        * @param string $name
+        */
+       protected function renderAfterPortlet( $name ) {
+               $content = '';
+               wfRunHooks( 'BaseTemplateAfterPortlet', array( $this, $name, &$content ) );
+
+               if ( $content !== '' ) {
+                       echo "<div class='after-portlet after-portlet-$name'>$content</div>";
+               }
+
+       }
+
        /**
         * Makes a link, usually used by makeListItem to generate a link for an item
         * in a list used in navigation lists, portlets, portals, sidebars, etc...
@@ -1840,7 +1859,7 @@ abstract class BaseTemplate extends QuickTemplate {
         *
         * @param $key string, usually a key from the list you are generating this link from.
         * @param $item array, of list item data containing some of a specific set of keys.
-        * The "id" and "class" keys will be used as attributes for the list item,
+        * The "id", "class" and "itemtitle" keys will be used as attributes for the list item,
         * if "active" contains a value of true a "active" class will also be appended to class.
         *
         * @param $options array
@@ -1857,7 +1876,8 @@ abstract class BaseTemplate extends QuickTemplate {
         * list item directly so they will not be passed to makeLink
         * (however the link will still support a tooltip and accesskey from it)
         * If you need an id or class on a single link you should include a "links"
-        * array with just one link item inside of it.
+        * array with just one link item inside of it. If you want to add a title
+        * to the list item itself, you can set "itemtitle" to the value.
         * $options is also passed on to makeLink calls
         *
         * @return string
@@ -1871,7 +1891,7 @@ abstract class BaseTemplate extends QuickTemplate {
                } else {
                        $link = $item;
                        // These keys are used by makeListItem and shouldn't be passed on to the link
-                       foreach ( array( 'id', 'class', 'active', 'tag' ) as $k ) {
+                       foreach ( array( 'id', 'class', 'active', 'tag', 'itemtitle' ) as $k ) {
                                unset( $link[$k] );
                        }
                        if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
@@ -1896,6 +1916,9 @@ abstract class BaseTemplate extends QuickTemplate {
                        $attrs['class'] .= ' active';
                        $attrs['class'] = trim( $attrs['class'] );
                }
+               if ( isset( $item['itemtitle'] ) ) {
+                       $attrs['title'] = $item['itemtitle'];
+               }
                return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
        }