r79341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79340‎ | r79341 | r79342 >
Date:15:48, 31 December 2010
Author:catrope
Status:ok
Tags:
Comment:
Follow-up r79340: merge r78117, r78170, r78172 and r78506 from trunk into skins/Vector.php . Unlike r79129 this does not merge the BaseTemplate-related revisions that preceded r78117 as they caused breakage per r79129 CR. Because makeSearchInput() and makeSearchButton() were part of the BaseTemplate changes, I had to reapply r78506 by hand
Modified paths:
  • /branches/REL1_17/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/skins/Vector.php
@@ -73,6 +73,8 @@
7474 $action = $wgRequest->getVal( 'action', 'view' );
7575 $section = $wgRequest->getVal( 'section' );
7676
 77+ $userCanRead = $this->mTitle->userCanRead();
 78+
7779 // Checks if page is some kind of content
7880 if( $this->iscontent ) {
7981 // Gets page objects for the related namespaces
@@ -93,16 +95,16 @@
9496
9597 // Adds namespace links
9698 $links['namespaces'][$subjectId] = $this->tabAction(
97 - $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', true
 99+ $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', $userCanRead
98100 );
99101 $links['namespaces'][$subjectId]['context'] = 'subject';
100102 $links['namespaces'][$talkId] = $this->tabAction(
101 - $talkPage, 'talk', $isTalk, '', true
 103+ $talkPage, 'talk', $isTalk, '', $userCanRead
102104 );
103105 $links['namespaces'][$talkId]['context'] = 'talk';
104106
105107 // Adds view view link
106 - if ( $this->mTitle->exists() ) {
 108+ if ( $this->mTitle->exists() && $userCanRead ) {
107109 $links['views']['view'] = $this->tabAction(
108110 $isTalk ? $talkPage : $subjectPage,
109111 'vector-view-view', ( $action == 'view' ), '', true
@@ -113,8 +115,8 @@
114116
115117 // Checks if user can...
116118 if (
117 - // edit the current page
118 - $this->mTitle->quickUserCan( 'edit' ) &&
 119+ // read and edit the current page
 120+ $userCanRead && $this->mTitle->quickUserCan( 'edit' ) &&
119121 (
120122 // if it exists
121123 $this->mTitle->exists() ||
@@ -155,7 +157,7 @@
156158 }
157159 }
158160 // Checks if the page has some kind of viewable content
159 - } elseif ( $this->mTitle->hasSourceText() ) {
 161+ } elseif ( $this->mTitle->hasSourceText() && $userCanRead ) {
160162 // Adds view source view link
161163 $links['views']['viewsource'] = array(
162164 'class' => ( $action == 'edit' ) ? 'selected' : false,
@@ -169,7 +171,7 @@
170172 wfProfileIn( __METHOD__ . '-live' );
171173
172174 // Checks if the page exists
173 - if ( $this->mTitle->exists() ) {
 175+ if ( $this->mTitle->exists() && $userCanRead ) {
174176 // Adds history view link
175177 $links['views']['history'] = array(
176178 'class' => 'collapsible ' . ( ( $action == 'history' ) ? 'selected' : false ),
@@ -766,8 +768,13 @@
767769 <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
768770 <?php if ( $wgVectorUseSimpleSearch && $wgUser->getOption( 'vector-simplesearch' ) ): ?>
769771 <div id="simpleSearch">
 772+ <?php if ( $this->data['rtl'] ): ?>
 773+ <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-rtl.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button>
 774+ <?php endif; ?>
770775 <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
771 - <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-' . ( $this->data['rtl'] ? 'rtl' : 'ltr' ) . '.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button>
 776+ <?php if ( !$this->data['rtl'] ): ?>
 777+ <button id="searchButton" type='submit' name='button' <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?>><img src="<?php echo $this->skin->getSkinStylePath('images/search-ltr.png'); ?>" alt="<?php $this->msg( 'searchbutton' ) ?>" /></button>
 778+ <?php endif; ?>
772779 </div>
773780 <?php else: ?>
774781 <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
Property changes on: branches/REL1_17/phase3/skins/Vector.php
___________________________________________________________________
Added: svn:mergeinfo
775782 Merged /branches/sqlite/skins/Vector.php:r58211-58321
776783 Merged /trunk/phase3/skins/Vector.php:r78117,78170,78172,78506
777784 Merged /branches/new-installer/phase3/skins/Vector.php:r43664-66004
778785 Merged /branches/REL1_15/phase3/skins/Vector.php:r51646

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78117Do not reveal page existence in colour of links in tabs when a user cannot re...werdna04:54, 9 December 2010
r78170Fix regression in r78117 per CR, was causing read, edit and history tabs to d...catrope10:55, 10 December 2010
r78172Followup r78117: information was still leaked through the caption of the Edit...catrope11:33, 10 December 2010
r78506Fixed RTL errors for SimpleSearchtparscal19:02, 16 December 2010
r79129MFT r78011 r78014 r78015 r78016 r78099 r78117 r78161 r78170 r78172 r78199 r78......platonides19:58, 28 December 2010
r79340Revert changes to skins/Vector.php in r79129, they lead to fatal errors due t...catrope15:26, 31 December 2010

Status & tagging log