r67641 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67640‎ | r67641 | r67642 >
Date:17:03, 8 June 2010
Author:ashley
Status:ok
Tags:
Comment:
Vector:
*trim trailing spaces
*consistent capitalization for getLocalURL (it's defined as "public function getLocalURL" in Title.php, line 818)
*minor spacing tweaks
Modified paths:
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -8,8 +8,9 @@
99 * @ingroup Skins
1010 */
1111
12 -if( !defined( 'MEDIAWIKI' ) )
 12+if( !defined( 'MEDIAWIKI' ) ) {
1313 die( -1 );
 14+}
1415
1516 /**
1617 * SkinTemplate class for Vector skin
@@ -27,7 +28,7 @@
2829 */
2930 public function initPage( OutputPage $out ) {
3031 global $wgLocalStylePath;
31 -
 32+
3233 parent::initPage( $out );
3334
3435 // Append CSS which includes IE only behavior fixes for hover support -
@@ -41,14 +42,13 @@
4243 }
4344
4445 /**
45 - * Load skin and user css files in the correct order
 46+ * Load skin and user CSS files in the correct order
4647 * fixes bug 22916
4748 * @param $out OutputPage object
4849 */
49 -
5050 function setupSkinUserCss( OutputPage $out ){
5151 global $wgVectorExtraStyles;
52 -
 52+
5353 parent::setupSkinUserCss( $out );
5454
5555 // Append skin-specific styles
@@ -88,7 +88,6 @@
8989
9090 // Checks if page is some kind of content
9191 if( $this->iscontent ) {
92 -
9392 // Gets page objects for the related namespaces
9493 $subjectPage = $this->mTitle->getSubjectPage();
9594 $talkPage = $this->mTitle->getTalkPage();
@@ -151,7 +150,7 @@
152151 ? wfMsg( 'vector-view-edit' )
153152 : wfMsg( 'vector-view-create' ),
154153 'href' =>
155 - $this->mTitle->getLocalUrl( $this->editUrlOptions() )
 154+ $this->mTitle->getLocalURL( $this->editUrlOptions() )
156155 );
157156 // Checks if this is a current rev of talk page and we should show a new
158157 // section link
@@ -163,7 +162,7 @@
164163 $links['views']['addsection'] = array(
165164 'class' => 'collapsible ' . ( $section == 'new' ? 'selected' : false ),
166165 'text' => wfMsg( 'vector-action-addsection' ),
167 - 'href' => $this->mTitle->getLocalUrl(
 166+ 'href' => $this->mTitle->getLocalURL(
168167 'action=edit&section=new'
169168 )
170169 );
@@ -176,7 +175,7 @@
177176 'class' => ( $action == 'edit' ) ? 'selected' : false,
178177 'text' => wfMsg( 'vector-view-viewsource' ),
179178 'href' =>
180 - $this->mTitle->getLocalUrl( $this->editUrlOptions() )
 179+ $this->mTitle->getLocalURL( $this->editUrlOptions() )
181180 );
182181 }
183182 wfProfileOut( __METHOD__ . '-edit' );
@@ -187,17 +186,17 @@
188187 if ( $this->mTitle->exists() ) {
189188 // Adds history view link
190189 $links['views']['history'] = array(
191 - 'class' => 'collapsible ' . ( ($action == 'history') ? 'selected' : false ),
 190+ 'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ),
192191 'text' => wfMsg( 'vector-view-history' ),
193 - 'href' => $this->mTitle->getLocalUrl( 'action=history' ),
 192+ 'href' => $this->mTitle->getLocalURL( 'action=history' ),
194193 'rel' => 'archives',
195194 );
196195
197196 if( $wgUser->isAllowed( 'delete' ) ) {
198197 $links['actions']['delete'] = array(
199 - 'class' => ($action == 'delete') ? 'selected' : false,
 198+ 'class' => ( $action == 'delete' ) ? 'selected' : false,
200199 'text' => wfMsg( 'vector-action-delete' ),
201 - 'href' => $this->mTitle->getLocalUrl( 'action=delete' )
 200+ 'href' => $this->mTitle->getLocalURL( 'action=delete' )
202201 );
203202 }
204203 if ( $this->mTitle->quickUserCan( 'move' ) ) {
@@ -208,7 +207,7 @@
209208 'class' => $this->mTitle->isSpecial( 'Movepage' ) ?
210209 'selected' : false,
211210 'text' => wfMsg( 'vector-action-move' ),
212 - 'href' => $moveTitle->getLocalUrl()
 211+ 'href' => $moveTitle->getLocalURL()
213212 );
214213 }
215214
@@ -216,22 +215,22 @@
217216 $this->mTitle->getNamespace() !== NS_MEDIAWIKI &&
218217 $wgUser->isAllowed( 'protect' )
219218 ) {
220 - if ( !$this->mTitle->isProtected() ){
 219+ if ( !$this->mTitle->isProtected() ) {
221220 $links['actions']['protect'] = array(
222 - 'class' => ($action == 'protect') ?
 221+ 'class' => ( $action == 'protect' ) ?
223222 'selected' : false,
224223 'text' => wfMsg( 'vector-action-protect' ),
225224 'href' =>
226 - $this->mTitle->getLocalUrl( 'action=protect' )
 225+ $this->mTitle->getLocalURL( 'action=protect' )
227226 );
228227
229228 } else {
230229 $links['actions']['unprotect'] = array(
231 - 'class' => ($action == 'unprotect') ?
 230+ 'class' => ( $action == 'unprotect' ) ?
232231 'selected' : false,
233232 'text' => wfMsg( 'vector-action-unprotect' ),
234233 'href' =>
235 - $this->mTitle->getLocalUrl( 'action=unprotect' )
 234+ $this->mTitle->getLocalURL( 'action=unprotect' )
236235 );
237236 }
238237 }
@@ -250,7 +249,7 @@
251250 array( 'parsemag' ),
252251 $wgLang->formatNum( $n )
253252 ),
254 - 'href' => $undelTitle->getLocalUrl(
 253+ 'href' => $undelTitle->getLocalURL(
255254 'target=' . urlencode( $this->thispage )
256255 )
257256 );
@@ -263,20 +262,20 @@
264263 ) {
265264 if ( !$this->mTitle->getRestrictions( 'create' ) ) {
266265 $links['actions']['protect'] = array(
267 - 'class' => ($action == 'protect') ?
 266+ 'class' => ( $action == 'protect' ) ?
268267 'selected' : false,
269268 'text' => wfMsg( 'vector-action-protect' ),
270269 'href' =>
271 - $this->mTitle->getLocalUrl( 'action=protect' )
 270+ $this->mTitle->getLocalURL( 'action=protect' )
272271 );
273272
274273 } else {
275274 $links['actions']['unprotect'] = array(
276 - 'class' => ($action == 'unprotect') ?
 275+ 'class' => ( $action == 'unprotect' ) ?
277276 'selected' : false,
278277 'text' => wfMsg( 'vector-action-unprotect' ),
279278 'href' =>
280 - $this->mTitle->getLocalUrl( 'action=unprotect' )
 279+ $this->mTitle->getLocalURL( 'action=unprotect' )
281280 );
282281 }
283282 }
@@ -304,7 +303,7 @@
305304 $links[$place][$mode] = array(
306305 'class' => $class . ( ( $action == 'watch' || $action == 'unwatch' ) ? ' selected' : false ),
307306 'text' => wfMsg( $mode ), // uses 'watch' or 'unwatch' message
308 - 'href' => $this->mTitle->getLocalUrl( 'action=' . $mode )
 307+ 'href' => $this->mTitle->getLocalURL( 'action=' . $mode )
309308 );
310309 }
311310 // This is instead of SkinTemplateTabs - which uses a flat array
@@ -707,7 +706,7 @@
708707 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
709708 <?php if ( $wgVectorShowVariantName ): ?>
710709 <h4>
711 - <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
 710+ <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
712711 <?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
713712 <?php echo htmlspecialchars( $link['text'] ) ?>
714713 <?php endif; ?>
@@ -717,7 +716,7 @@
718717 <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
719718 <div class="menu">
720719 <ul<?php $this->html('userlangattributes') ?>>
721 - <?php foreach ($this->data['variant_urls'] as $key => $link ): ?>
 720+ <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
722721 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
723722 <?php endforeach; ?>
724723 </ul>
@@ -730,7 +729,7 @@
731730 <div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
732731 <h5><?php $this->msg('views') ?></h5>
733732 <ul<?php $this->html('userlangattributes') ?>>
734 - <?php foreach ($this->data['view_urls'] as $key => $link ): ?>
 733+ <?php foreach ( $this->data['view_urls'] as $key => $link ): ?>
735734 <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>
736735 <?php endforeach; ?>
737736 </ul>

Status & tagging log