r42658 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42657‎ | r42658 | r42659 >
Date:15:05, 27 October 2008
Author:aaron
Status:old (Comments)
Tags:
Comment:
(bug 10347) Add subtitle message for protected pages
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinTemplate.php
@@ -203,12 +203,7 @@
204204 $tpl->set( 'isarticle', $out->isArticle() );
205205
206206 $tpl->setRef( "thispage", $this->thispage );
207 - $subpagestr = $this->subPageSubtitle();
208 - $tpl->set(
209 - 'subtitle', !empty($subpagestr)?
210 - '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
211 - $out->getSubtitle()
212 - );
 207+
213208 $undelete = $this->getUndeleteLink();
214209 $tpl->set(
215210 "undelete", !empty($undelete)?
@@ -416,7 +411,8 @@
417412 if ( $nt ) {
418413 $language_urls[] = array(
419414 'href' => $nt->getFullURL(),
420 - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l),
 415+ 'text' => $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ?
 416+ $wgContLang->getLanguageName( $nt->getInterwiki()) : $l,
421417 'class' => $class
422418 );
423419 }
@@ -435,6 +431,12 @@
436432 $content_actions = $this->buildContentActionUrls();
437433 $tpl->setRef('content_actions', $content_actions);
438434
 435+ $subpagestr = $this->subPageSubtitle();
 436+ $tpl->set(
 437+ 'subtitle', !empty($subpagestr) ?
 438+ '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle() : $out->getSubtitle()
 439+ );
 440+
439441 // XXX: attach this from javascript, same with section editing
440442 if($this->iseditable && $wgUser->getOption("editondblclick") )
441443 {
@@ -652,7 +654,7 @@
653655 wfProfileIn( __METHOD__ );
654656
655657 global $wgUser, $wgRequest;
656 - $action = $wgRequest->getText( 'action' );
 658+ $action = $wgRequest->getText( 'action', 'view' );
657659 $section = $wgRequest->getText( 'section' );
658660 $content_actions = array();
659661
@@ -696,12 +698,26 @@
697699 'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
698700 );
699701 }
 702+ # Give notice if this page is locked for others
 703+ if( ($action == 'view' || $action == 'purge') && $this->mTitle->isProtected( 'edit' ) ) {
 704+ $wgOut->appendSubtitle( "<span class='plainlinks'>" .
 705+ wfMsgExt('protected-sub-allowed',array('parse'),$this->mTitle->getFullUrl('action=protect')) .
 706+ "</span>"
 707+ );
 708+ }
700709 } elseif ( $this->mTitle->exists() || $this->mTitle->isAlwaysKnown() ) {
701710 $content_actions['viewsource'] = array(
702711 'class' => ($action == 'edit') ? 'selected' : false,
703712 'text' => wfMsg('viewsource'),
704713 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
705714 );
 715+ # Give notice if this page is locked
 716+ if( ($action == 'view' || $action == 'purge') && $this->mTitle->isProtected( 'edit' ) ) {
 717+ $wgOut->appendSubtitle( "<span class='plainlinks'>" .
 718+ wfMsgExt('protected-sub-disallowed',array('parseinline'),$this->mTitle->getFullUrl('action=protect')) .
 719+ "</span>"
 720+ );
 721+ }
706722 }
707723 wfProfileOut( __METHOD__."-edit" );
708724
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2126,7 +2126,6 @@
21272127 You can narrow down the view by selecting a log type, the user name (case-sensitive), or the affected page (also case-sensitive).',
21282128 'logempty' => 'No matching items in log.',
21292129 'log-title-wildcard' => 'Search titles starting with this text',
2130 -'logshowhide-patrol' => '$1 patrol log',
21312130
21322131 # Special:AllPages
21332132 'allpages' => 'All pages',
@@ -2998,11 +2997,12 @@
29992998 'markedaspatrollederror-noautopatrol' => 'You are not allowed to mark your own changes as patrolled.',
30002999
30013000 # Patrol log
3002 -'patrol-log-page' => 'Patrol log',
3003 -'patrol-log-header' => 'This is a log of patrolled revisions.',
3004 -'patrol-log-line' => 'marked $1 of $2 patrolled $3',
3005 -'patrol-log-auto' => '(automatic)',
3006 -'patrol-log-diff' => 'r$1', # only translate this message to other languages if you have to change it
 3001+'patrol-log-page' => 'Patrol log',
 3002+'patrol-log-header' => 'This is a log of patrolled revisions.',
 3003+'patrol-log-line' => 'marked $1 of $2 patrolled $3',
 3004+'patrol-log-auto' => '(automatic)',
 3005+'patrol-log-diff' => 'r$1', # only translate this message to other languages if you have to change it
 3006+'logshowhide-patrol' => '$1 patrol log',
30073007
30083008 # Image deletion
30093009 'deletedrevision' => 'Deleted old revision $1',
@@ -3728,4 +3728,8 @@
37293729
37303730 #Put all regex fragments above this line. Leave this line exactly as it is</pre>',
37313731
 3732+# Unknown messages
 3733+'protected-sub-allowed' => "Some users '''cannot edit this page''' because it has been [$1 restricted] to prevent editing",
 3734+'protected-sub-disallowed' => "You '''cannot edit this page''' because it has been [$1 restricted] to prevent editing",
 3735+
37323736 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r42659Follow up on r42658. Register messages and rebuild MessagesEn.phpsiebrand15:46, 27 October 2008
r42664Revert r42658 "(bug 10347) Add subtitle message for protected pages"...brion18:03, 27 October 2008
r42672Revert r42659 per revert of r42658 by aaron in r42664 by brion.siebrand19:43, 27 October 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r25151(bug 10347) Added subtle message to subtitle indicating that the page current...amidaniel04:54, 26 August 2007
r25210Revert bug 10347 stuff -- too-big, too-prominent, too-technical subtitle slap...brion21:05, 27 August 2007
r25223Merged revisions 25126-25214 via svnmerge from...david07:39, 28 August 2007

Comments

#Comment by NSK Nikolaos S. Karastathis (talk | contribs)   17:43, 27 October 2008

will this work with skins deriving from Skin.php ?

#Comment by NSK Nikolaos S. Karastathis (talk | contribs)   17:45, 27 October 2008

I don't see why readers or anons need to be aware of a protected page, though.

#Comment by Brion VIBBER (talk | contribs)   18:01, 27 October 2008

This is annoying and disruptive for a reader. The edit/view tab label already takes care of this issue.

#Comment by Brion VIBBER (talk | contribs)   18:04, 27 October 2008

Reverted in r42664.

Status & tagging log