Vector:
authorJack Phoenix <ashley@users.mediawiki.org>
Tue, 8 Jun 2010 17:03:25 +0000 (17:03 +0000)
committerJack Phoenix <ashley@users.mediawiki.org>
Tue, 8 Jun 2010 17:03:25 +0000 (17:03 +0000)
*trim trailing spaces
*consistent capitalization for getLocalURL (it's defined as "public function getLocalURL" in Title.php, line 818)
*minor spacing tweaks

skins/Vector.php

index 74a1ae3..c7d69df 100644 (file)
@@ -8,8 +8,9 @@
  * @ingroup Skins
  */
 
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
        die( -1 );
+}
 
 /**
  * SkinTemplate class for Vector skin
@@ -27,7 +28,7 @@ class SkinVector extends SkinTemplate {
         */
        public function initPage( OutputPage $out ) {
                global $wgLocalStylePath;
-               
+
                parent::initPage( $out );
 
                // Append CSS which includes IE only behavior fixes for hover support -
@@ -41,14 +42,13 @@ class SkinVector extends SkinTemplate {
        }
 
        /**
-        * Load skin and user css files in the correct order
+        * Load skin and user CSS files in the correct order
         * fixes bug 22916
         * @param $out OutputPage object
         */
-
        function setupSkinUserCss( OutputPage $out ){
                global $wgVectorExtraStyles;
-               
+
                parent::setupSkinUserCss( $out );
 
                // Append skin-specific styles
@@ -88,7 +88,6 @@ class SkinVector extends SkinTemplate {
 
                // Checks if page is some kind of content
                if( $this->iscontent ) {
-
                        // Gets page objects for the related namespaces
                        $subjectPage = $this->mTitle->getSubjectPage();
                        $talkPage = $this->mTitle->getTalkPage();
@@ -151,7 +150,7 @@ class SkinVector extends SkinTemplate {
                                                ? wfMsg( 'vector-view-edit' )
                                                : wfMsg( 'vector-view-create' ),
                                        'href' =>
-                                               $this->mTitle->getLocalUrl( $this->editUrlOptions() )
+                                               $this->mTitle->getLocalURL( $this->editUrlOptions() )
                                );
                                // Checks if this is a current rev of talk page and we should show a new
                                // section link
@@ -163,7 +162,7 @@ class SkinVector extends SkinTemplate {
                                                $links['views']['addsection'] = array(
                                                        'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ),
                                                        'text' => wfMsg( 'vector-action-addsection' ),
-                                                       'href' => $this->mTitle->getLocalUrl(
+                                                       'href' => $this->mTitle->getLocalURL(
                                                                'action=edit&section=new'
                                                        )
                                                );
@@ -176,7 +175,7 @@ class SkinVector extends SkinTemplate {
                                        'class' => ( $action == 'edit' ) ? 'selected' : false,
                                        'text' => wfMsg( 'vector-view-viewsource' ),
                                        'href' =>
-                                               $this->mTitle->getLocalUrl( $this->editUrlOptions() )
+                                               $this->mTitle->getLocalURL( $this->editUrlOptions() )
                                );
                        }
                        wfProfileOut( __METHOD__ . '-edit' );
@@ -187,17 +186,17 @@ class SkinVector extends SkinTemplate {
                        if ( $this->mTitle->exists() ) {
                                // Adds history view link
                                $links['views']['history'] = array(
-                                       'class' => 'collapsible ' . ( ($action == 'history') ? 'selected' : false ),
+                                       'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ),
                                        'text' => wfMsg( 'vector-view-history' ),
-                                       'href' => $this->mTitle->getLocalUrl( 'action=history' ),
+                                       'href' => $this->mTitle->getLocalURL( 'action=history' ),
                                        'rel' => 'archives',
                                );
 
                                if( $wgUser->isAllowed( 'delete' ) ) {
                                        $links['actions']['delete'] = array(
-                                               'class' => ($action == 'delete') ? 'selected' : false,
+                                               'class' => ( $action == 'delete' ) ? 'selected' : false,
                                                'text' => wfMsg( 'vector-action-delete' ),
-                                               'href' => $this->mTitle->getLocalUrl( 'action=delete' )
+                                               'href' => $this->mTitle->getLocalURL( 'action=delete' )
                                        );
                                }
                                if ( $this->mTitle->quickUserCan( 'move' ) ) {
@@ -208,7 +207,7 @@ class SkinVector extends SkinTemplate {
                                                'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
                                                                                'selected' : false,
                                                'text' => wfMsg( 'vector-action-move' ),
-                                               'href' => $moveTitle->getLocalUrl()
+                                               'href' => $moveTitle->getLocalURL()
                                        );
                                }
 
@@ -216,22 +215,22 @@ class SkinVector extends SkinTemplate {
                                        $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
                                        $wgUser->isAllowed( 'protect' )
                                ) {
-                                       if ( !$this->mTitle->isProtected() ){
+                                       if ( !$this->mTitle->isProtected() ) {
                                                $links['actions']['protect'] = array(
-                                                       'class' => ($action == 'protect') ?
+                                                       'class' => ( $action == 'protect' ) ?
                                                                                        'selected' : false,
                                                        'text' => wfMsg( 'vector-action-protect' ),
                                                        'href' =>
-                                                               $this->mTitle->getLocalUrl( 'action=protect' )
+                                                               $this->mTitle->getLocalURL( 'action=protect' )
                                                );
 
                                        } else {
                                                $links['actions']['unprotect'] = array(
-                                                       'class' => ($action == 'unprotect') ?
+                                                       'class' => ( $action == 'unprotect' ) ?
                                                                                        'selected' : false,
                                                        'text' => wfMsg( 'vector-action-unprotect' ),
                                                        'href' =>
-                                                               $this->mTitle->getLocalUrl( 'action=unprotect' )
+                                                               $this->mTitle->getLocalURL( 'action=unprotect' )
                                                );
                                        }
                                }
@@ -250,7 +249,7 @@ class SkinVector extends SkinTemplate {
                                                                array( 'parsemag' ),
                                                                $wgLang->formatNum( $n )
                                                        ),
-                                                       'href' => $undelTitle->getLocalUrl(
+                                                       'href' => $undelTitle->getLocalURL(
                                                                'target=' . urlencode( $this->thispage )
                                                        )
                                                );
@@ -263,20 +262,20 @@ class SkinVector extends SkinTemplate {
                                ) {
                                        if ( !$this->mTitle->getRestrictions( 'create' ) ) {
                                                $links['actions']['protect'] = array(
-                                                       'class' => ($action == 'protect') ?
+                                                       'class' => ( $action == 'protect' ) ?
                                                                                        'selected' : false,
                                                        'text' => wfMsg( 'vector-action-protect' ),
                                                        'href' =>
-                                                               $this->mTitle->getLocalUrl( 'action=protect' )
+                                                               $this->mTitle->getLocalURL( 'action=protect' )
                                                );
 
                                        } else {
                                                $links['actions']['unprotect'] = array(
-                                                       'class' => ($action == 'unprotect') ?
+                                                       'class' => ( $action == 'unprotect' ) ?
                                                                                        'selected' : false,
                                                        'text' => wfMsg( 'vector-action-unprotect' ),
                                                        'href' =>
-                                                               $this->mTitle->getLocalUrl( 'action=unprotect' )
+                                                               $this->mTitle->getLocalURL( 'action=unprotect' )
                                                );
                                        }
                                }
@@ -304,7 +303,7 @@ class SkinVector extends SkinTemplate {
                                $links[$place][$mode] = array(
                                        'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ),
                                        'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
-                                       'href' => $this->mTitle->getLocalUrl( 'action=' . $mode )
+                                       'href' => $this->mTitle->getLocalURL( 'action=' . $mode )
                                );
                        }
                        // This is instead of SkinTemplateTabs - which uses a flat array
@@ -707,7 +706,7 @@ class VectorTemplate extends QuickTemplate {
 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <?php if ( $wgVectorShowVariantName ): ?>
                <h4>
-               <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
+               <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
                        <?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
                                <?php echo htmlspecialchars( $link['text'] ) ?>
                        <?php endif; ?>
@@ -717,7 +716,7 @@ class VectorTemplate extends QuickTemplate {
        <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
        <div class="menu">
                <ul<?php $this->html('userlangattributes') ?>>
-                       <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
+                       <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
                                <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
                        <?php endforeach; ?>
                </ul>
@@ -730,7 +729,7 @@ class VectorTemplate extends QuickTemplate {
 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg('views') ?></h5>
        <ul<?php $this->html('userlangattributes') ?>>
-               <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
+               <?php foreach ( $this->data['view_urls'] as $key => $link ): ?>
                        <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo (array_key_exists('img',$link) ?  '<img src="'.$link['img'].'" alt="'.$link['text'].'" />' : '<span>'.htmlspecialchars( $link['text'] ).'</span>') ?></a></li>
                <?php endforeach; ?>
        </ul>