From: Aaron Schulz Date: Mon, 27 Oct 2008 15:05:16 +0000 (+0000) Subject: (bug 10347) Add subtitle message for protected pages X-Git-Tag: 1.31.0-rc.0~44563 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=af9be2ec765e07e5de4c1a4fb348431b44fa86c9;p=lhc%2Fweb%2Fwiklou.git (bug 10347) Add subtitle message for protected pages --- diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 33307e3133..28c63cd080 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -203,12 +203,7 @@ class SkinTemplate extends Skin { $tpl->set( 'isarticle', $out->isArticle() ); $tpl->setRef( "thispage", $this->thispage ); - $subpagestr = $this->subPageSubtitle(); - $tpl->set( - 'subtitle', !empty($subpagestr)? - ''.$subpagestr.''.$out->getSubtitle(): - $out->getSubtitle() - ); + $undelete = $this->getUndeleteLink(); $tpl->set( "undelete", !empty($undelete)? @@ -416,7 +411,8 @@ class SkinTemplate extends Skin { if ( $nt ) { $language_urls[] = array( 'href' => $nt->getFullURL(), - 'text' => ($wgContLang->getLanguageName( $nt->getInterwiki()) != ''?$wgContLang->getLanguageName( $nt->getInterwiki()) : $l), + 'text' => $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ? + $wgContLang->getLanguageName( $nt->getInterwiki()) : $l, 'class' => $class ); } @@ -435,6 +431,12 @@ class SkinTemplate extends Skin { $content_actions = $this->buildContentActionUrls(); $tpl->setRef('content_actions', $content_actions); + $subpagestr = $this->subPageSubtitle(); + $tpl->set( + 'subtitle', !empty($subpagestr) ? + ''.$subpagestr.''.$out->getSubtitle() : $out->getSubtitle() + ); + // XXX: attach this from javascript, same with section editing if($this->iseditable && $wgUser->getOption("editondblclick") ) { @@ -652,7 +654,7 @@ class SkinTemplate extends Skin { wfProfileIn( __METHOD__ ); global $wgUser, $wgRequest; - $action = $wgRequest->getText( 'action' ); + $action = $wgRequest->getText( 'action', 'view' ); $section = $wgRequest->getText( 'section' ); $content_actions = array(); @@ -696,12 +698,26 @@ class SkinTemplate extends Skin { 'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' ) ); } + # Give notice if this page is locked for others + if( ($action == 'view' || $action == 'purge') && $this->mTitle->isProtected( 'edit' ) ) { + $wgOut->appendSubtitle( "" . + wfMsgExt('protected-sub-allowed',array('parse'),$this->mTitle->getFullUrl('action=protect')) . + "" + ); + } } elseif ( $this->mTitle->exists() || $this->mTitle->isAlwaysKnown() ) { $content_actions['viewsource'] = array( 'class' => ($action == 'edit') ? 'selected' : false, 'text' => wfMsg('viewsource'), 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() ) ); + # Give notice if this page is locked + if( ($action == 'view' || $action == 'purge') && $this->mTitle->isProtected( 'edit' ) ) { + $wgOut->appendSubtitle( "" . + wfMsgExt('protected-sub-disallowed',array('parseinline'),$this->mTitle->getFullUrl('action=protect')) . + "" + ); + } } wfProfileOut( __METHOD__."-edit" ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 3ea7f1dd77..f18d84ea5a 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2126,7 +2126,6 @@ Each row contains links to the first and second redirect, as well as the target You can narrow down the view by selecting a log type, the user name (case-sensitive), or the affected page (also case-sensitive).', 'logempty' => 'No matching items in log.', 'log-title-wildcard' => 'Search titles starting with this text', -'logshowhide-patrol' => '$1 patrol log', # Special:AllPages 'allpages' => 'All pages', @@ -2998,11 +2997,12 @@ This is probably caused by a link to a blacklisted external site.', 'markedaspatrollederror-noautopatrol' => 'You are not allowed to mark your own changes as patrolled.', # Patrol log -'patrol-log-page' => 'Patrol log', -'patrol-log-header' => 'This is a log of patrolled revisions.', -'patrol-log-line' => 'marked $1 of $2 patrolled $3', -'patrol-log-auto' => '(automatic)', -'patrol-log-diff' => 'r$1', # only translate this message to other languages if you have to change it +'patrol-log-page' => 'Patrol log', +'patrol-log-header' => 'This is a log of patrolled revisions.', +'patrol-log-line' => 'marked $1 of $2 patrolled $3', +'patrol-log-auto' => '(automatic)', +'patrol-log-diff' => 'r$1', # only translate this message to other languages if you have to change it +'logshowhide-patrol' => '$1 patrol log', # Image deletion 'deletedrevision' => 'Deleted old revision $1', @@ -3728,4 +3728,8 @@ Enter the filename without the "{{ns:image}}:" prefix.', #Put all regex fragments above this line. Leave this line exactly as it is', +# Unknown messages +'protected-sub-allowed' => "Some users '''cannot edit this page''' because it has been [$1 restricted] to prevent editing", +'protected-sub-disallowed' => "You '''cannot edit this page''' because it has been [$1 restricted] to prevent editing", + );