Fix case of some Title methods
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index a673a65..59e1ccf 100644 (file)
@@ -113,7 +113,7 @@ class SkinTemplate extends Skin {
         * roughly equivalent to PHPTAL 0.7.
         *
         * @param $classname String
-        * @param $repository string: subdirectory where we keep template files
+        * @param string $repository subdirectory where we keep template files
         * @param $cache_dir string
         * @return QuickTemplate
         * @private
@@ -219,7 +219,7 @@ class SkinTemplate extends Skin {
                if ( $subpagestr !== '' ) {
                        $subpagestr = '<span class="subpages">' . $subpagestr . '</span>';
                }
-               $tpl->set( 'subtitle',  $subpagestr . $out->getSubtitle() );
+               $tpl->set( 'subtitle', $subpagestr . $out->getSubtitle() );
 
                $undelete = $this->getUndeleteLink();
                if ( $undelete === '' ) {
@@ -262,7 +262,7 @@ class SkinTemplate extends Skin {
                $tpl->set( 'helppage', $this->msg( 'helppage' )->text() );
                */
                $tpl->set( 'searchaction', $this->escapeSearchLink() );
-               $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBKey() );
+               $tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBkey() );
                $tpl->set( 'search', trim( $request->getVal( 'search' ) ) );
                $tpl->setRef( 'stylepath', $wgStylePath );
                $tpl->setRef( 'articlepath', $wgArticlePath );
@@ -273,7 +273,7 @@ class SkinTemplate extends Skin {
 
                $userLang = $this->getLanguage();
                $userLangCode = $userLang->getHtmlCode();
-               $userLangDir  = $userLang->getDir();
+               $userLangDir = $userLang->getDir();
 
                $tpl->set( 'lang', $userLangCode );
                $tpl->set( 'dir', $userLangDir );
@@ -403,7 +403,7 @@ class SkinTemplate extends Skin {
                        $pageLang = $title->getPageViewLanguage();
                        $realBodyAttribs['lang'] = $pageLang->getHtmlCode();
                        $realBodyAttribs['dir'] = $pageLang->getDir();
-                       $realBodyAttribs['class'] = 'mw-content-'.$pageLang->getDir();
+                       $realBodyAttribs['class'] = 'mw-content-' . $pageLang->getDir();
                }
 
                $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext );
@@ -505,7 +505,7 @@ class SkinTemplate extends Skin {
         * Format language name for use in sidebar interlanguage links list.
         * By default it is capitalized.
         *
-        * @param $name string Language name, e.g. "English" or "español"
+        * @param string $name Language name, e.g. "English" or "español"
         * @return string
         * @private
         */
@@ -526,7 +526,7 @@ class SkinTemplate extends Skin {
        }
 
        /**
-        * Output a boolean indiciating if buildPersonalUrls should output separate
+        * Output a boolean indicating if buildPersonalUrls should output separate
         * login and create account links or output a combined link
         * By default we simply return a global config setting that affects most skins
         * This is setup as a method so that like with $wgLogo and getLogo() a skin
@@ -779,7 +779,7 @@ class SkinTemplate extends Skin {
         * variants: Used to list the language variants for the page
         *
         * Each section's value is a key/value array of links for that section.
-        * The links themseves have these common keys:
+        * The links themselves have these common keys:
         * - class: The css classes to apply to the tab
         * - text: The text to display on the tab
         * - href: The href for the tab to point to
@@ -1051,7 +1051,7 @@ class SkinTemplate extends Skin {
                }
 
                // Equiv to SkinTemplateContentActions
-               wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this,  &$content_navigation ) );
+               wfRunHooks( 'SkinTemplateNavigation::Universal', array( &$this, &$content_navigation ) );
 
                // Setup xml ids and tooltip info
                foreach ( $content_navigation as $section => &$links ) {
@@ -1073,8 +1073,8 @@ class SkinTemplate extends Skin {
                # We don't want to give the watch tab an accesskey if the
                # page is being edited, because that conflicts with the
                # accesskey on the watch checkbox.  We also don't want to
-               # give the edit tab an accesskey, because that's fairly su-
-               # perfluous and conflicts with an accesskey (Ctrl-E) often
+               # give the edit tab an accesskey, because that's fairly
+               # superfluous and conflicts with an accesskey (Ctrl-E) often
                # used for editing in Safari.
                if ( in_array( $action, array( 'edit', 'submit' ) ) ) {
                        if ( isset( $content_navigation['views']['edit'] ) ) {
@@ -1174,6 +1174,7 @@ class SkinTemplate extends Skin {
                $nav_urls['log'] = false;
                $nav_urls['blockip'] = false;
                $nav_urls['emailuser'] = false;
+               $nav_urls['userrights'] = false;
 
                // A print stylesheet is attached to all pages, but nobody ever
                // figures that out. :)  Add a link...
@@ -1241,6 +1242,13 @@ class SkinTemplate extends Skin {
                                        'href' => self::makeSpecialUrlSubpage( 'Emailuser', $rootUser )
                                );
                        }
+
+                       $sur = new UserrightsPage;
+                       if ( $sur->userCanExecute( $this->getUser() ) ) {
+                               $nav_urls['userrights'] = array(
+                                       'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
+                               );
+                       }
                }
 
                wfProfileOut( __METHOD__ );
@@ -1389,7 +1397,7 @@ abstract class BaseTemplate extends QuickTemplate {
        /**
         * Get a Message object with its context set
         *
-        * @param $name string message name
+        * @param string $name message name
         * @return Message
         */
        public function getMsg( $name ) {
@@ -1411,7 +1419,7 @@ abstract class BaseTemplate extends QuickTemplate {
        /**
         * Create an array of common toolbox items from the data in the quicktemplate
         * stored by SkinTemplate.
-        * The resulting array is built acording to a format intended to be passed
+        * The resulting array is built according to a format intended to be passed
         * through makeListItem to generate the html.
         * @return array
         */
@@ -1439,7 +1447,7 @@ abstract class BaseTemplate extends QuickTemplate {
                                $toolbox['feeds']['links'][$key]['class'] = 'feedlink';
                        }
                }
-               foreach ( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ) {
+               foreach ( array( 'contributions', 'log', 'blockip', 'emailuser', 'userrights', 'upload', 'specialpages' ) as $special ) {
                        if ( isset( $this->data['nav_urls'][$special] ) && $this->data['nav_urls'][$special] ) {
                                $toolbox[$special] = $this->data['nav_urls'][$special];
                                $toolbox[$special]['id'] = "t-$special";
@@ -1475,7 +1483,7 @@ abstract class BaseTemplate extends QuickTemplate {
        /**
         * Create an array of personal tools items from the data in the quicktemplate
         * stored by SkinTemplate.
-        * The resulting array is built acording to a format intended to be passed
+        * The resulting array is built according to a format intended to be passed
         * through makeListItem to generate the html.
         * This is in reality the same list as already stored in personal_urls
         * however it is reformatted so that you can just pass the individual items
@@ -1638,9 +1646,9 @@ abstract class BaseTemplate extends QuickTemplate {
         * 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...
         *
-        * @param $key string usually a key from the list you are generating this
+        * @param string $key usually a key from the list you are generating this
         * link from.
-        * @param $item array contains some of a specific set of keys.
+        * @param array $item contains some of a specific set of keys.
         *
         * The text of the link will be generated either from the contents of the
         * "text" key in the $item array, if a "msg" key is present a message by
@@ -1657,7 +1665,7 @@ abstract class BaseTemplate extends QuickTemplate {
         *
         * If you don't want an accesskey, set $item['tooltiponly'] = true;
         *
-        * @param $options array can be used to affect the output of a link.
+        * @param array $options can be used to affect the output of a link.
         * Possible options are:
         *   - 'text-wrapper' key to specify a list of elements to wrap the text of
         *   a link in. This should be an array of arrays containing a 'tag' and