From: Brion Vibber Date: Mon, 27 Aug 2007 21:05:19 +0000 (+0000) Subject: Revert bug 10347 stuff -- too-big, too-prominent, too-technical subtitle slapped... X-Git-Tag: 1.31.0-rc.0~51631 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=946720a9e49e0bd09c2ff658a61a765f01b141ae;p=lhc%2Fweb%2Fwiklou.git Revert bug 10347 stuff -- too-big, too-prominent, too-technical subtitle slapped on every protected page. This needs more work before going into trunk, which you'll remember is *what is live at any given time* except when we've got a problem going on. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cb9ecad209..9cfc8384e9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -190,8 +190,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add accesskey 's' and tooltip to 'upload file' button at Special:Upload * Introduced 'SkinAfterBottomScripts' hook; see docs/hooks.txt for more information -* (bug 10347) Give notice when a page is viewed that is protected. Does not - show for cascade protection however. == Bugfixes since 1.10 == @@ -414,8 +412,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Resizing transparent GIF images with GD now retains transparency by skipping resampling * (bug 11065) Fix regression in handling of wiki-formatted EXIF metadata -* (bug 10347) Add subtitle message to indicate that the page being viewed is - protected. * Double encoding broke Special:Newpages for some languages * Adding a newline before the statistics footer, to prevent parsing problems * Preventing the TOC from appearing in Special:Statistics diff --git a/includes/Article.php b/includes/Article.php index 6c02ec6781..5bb5915eb3 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -740,11 +740,6 @@ class Article { } } - if ( $this->mTitle->isProtected() ) { - $editrestr = $this->mTitle->getRestrictions('edit'); - $this->addProtectionNotice( $editrestr ); - } - $outputDone = false; wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$pcache ) ); if ( $pcache ) { @@ -891,39 +886,6 @@ class Article { wfProfileOut( __METHOD__ ); } - /* - * Output a notice that a page is protected. Only give details for edit - * restrictions. Cares only about the first permission in the arrays, which is - * part of a larger shitty inconsistency about requiring several permissions... - * @param Array $editrestr, edit restrictions - */ - function addProtectionNotice( $editrestr ) { - global $wgOut; - - if( empty($editrestr) ) - return; - - $permission = $editrestr[0]; - $permission = ($permission=='sysop') ? 'protect' : $permission; - - $editGroups = ''; - # Get groups that have each right - if( $permission ) { - $editGroups = $wgOut->getGroupsWithPermission( $permission ); - $editGroups = implode( ', ', $editGroups ); - } - # Use general messages if no groups found for a type - if( !$editGroups ) { - $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr ); - } else { - $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr ); - } - if( $wgOut->getSubtitle() ) - $msg = " $msg"; - - $wgOut->setSubtitle( $wgOut->getSubtitle() . $msg ); - } - function addTrackbacks() { global $wgOut, $wgUser; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index bbeb7a3170..66fbb8d5d4 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -878,7 +878,7 @@ class OutputPage { * @param string $permission key required */ public function permissionRequired( $permission ) { - global $wgUser; + global $wgGroupPermissions, $wgUser; $this->setPageTitle( wfMsg( 'badaccess' ) ); $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) ); @@ -886,30 +886,6 @@ class OutputPage { $this->setArticleRelated( false ); $this->mBodytext = ''; - $groups = $this->getGroupsWithPermission( $permission ); - $n = count( $groups ); - $groups = implode( ', ', $groups ); - switch( $n ) { - case 0: - case 1: - case 2: - $message = wfMsgHtml( "badaccess-group$n", $groups ); - break; - default: - $message = wfMsgHtml( 'badaccess-groups', $groups ); - } - $this->addHtml( $message ); - $this->returnToMain( false ); - } - - /** - * Return an array of the groups in (UI name form) that have a permission - * - * @param string $permission key required - */ - public function getGroupsWithPermission( $permission ) { - global $wgUser, $wgGroupPermissions; - $groups = array(); foreach( $wgGroupPermissions as $key => $value ) { if( isset( $value[$permission] ) && $value[$permission] == true ) { @@ -923,7 +899,19 @@ class OutputPage { } } } - return $groups; + $n = count( $groups ); + $groups = implode( ', ', $groups ); + switch( $n ) { + case 0: + case 1: + case 2: + $message = wfMsgHtml( "badaccess-group$n", $groups ); + break; + default: + $message = wfMsgHtml( 'badaccess-groups', $groups ); + } + $this->addHtml( $message ); + $this->returnToMain( false ); } /** diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 9cf5754513..c92363d4a4 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -487,10 +487,6 @@ $2', 'namespaceprotected' => "Du hast keine Berechtigung, die Seite in dem '''$1'''-Namensraum zu bearbeiten.", 'customcssjsprotected' => 'Du bist nicht berechtigt diese Seite zu bearbeiten, da sie zu den persönlichen Einstellungen eines anderen Benutzers gehört.', 'ns-specialprotected' => 'Seiten im {{ns:special}}-Namensraum können nicht bearbeitet werden.', -'protected-subtitle' => '(Diese Seite ist geschützt)', -'protected-subtitle-same' => '(Diese Seite ist geschützt. Benutzer der Gruppe(n) „$1“ können sie weiterhin bearbeiten oder verschieben.)', -'protected-subtitle-each' => '(Diese Seite ist geschützt. Benutzer der Gruppe(n) „$1“ können sie weiterhin bearbeiten und Benutzer der Gruppe(n) „$2“ verschieben.)', -'protected-anyone' => 'Jeder', # Login and logout pages 'logouttitle' => 'Benutzer-Abmeldung', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index a947f66173..1b0e60b6b0 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -794,11 +794,9 @@ Query: $2', 'sqlhidden' => '(SQL query hidden)', 'cascadeprotected' => "This page has been protected from editing, because it is included in the following {{PLURAL:$1|page|pages}}, which are protected with the \"cascading\" option turned on: $2", -'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.", -'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.", -'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.", -'protected-subtitle' => "(This page is protected)", -'protected-subtitle-edit' => "(This page is protected. Only certain users ($1) can edit it.)", +'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.", +'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.", +'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.", # Login and logout pages 'logouttitle' => 'User logout', diff --git a/languages/messages/MessagesHe.php b/languages/messages/MessagesHe.php index 3dee2508ff..4299462153 100644 --- a/languages/messages/MessagesHe.php +++ b/languages/messages/MessagesHe.php @@ -533,8 +533,6 @@ $2', 'namespaceprotected' => "אינכם מורשים לערוך דפים במרחב השם '''$1'''.", 'customcssjsprotected' => 'אינכם מורשים לערוך דף זה, כיוון שהוא כולל את ההגדרות האישיות של משתמש אחר.', 'ns-specialprotected' => 'לא ניתן לערוך דפים מיוחדים.', -'protected-subtitle' => '(דף זה מוגן)', -'protected-subtitle-edit' => '(דף זה מוגן כך שרק משתמשים מסוימים ($1) יכולים לערוך אותו)', # Login and logout pages 'logouttitle' => 'יציאה מהחשבון', diff --git a/languages/messages/MessagesKk_cn.php b/languages/messages/MessagesKk_cn.php index d33daf28cc..f38ba3e643 100644 --- a/languages/messages/MessagesKk_cn.php +++ b/languages/messages/MessagesKk_cn.php @@ -688,10 +688,6 @@ $2', 'namespaceprotected' => "'''$1''' ەسٸم اياسىنداعى بەتتەردٸ ٶڭدەۋ ٷشٸن رۇقساتىڭىز جوق.", 'customcssjsprotected' => 'بۇل بەتتٸ ٶڭدەۋگە رۇقساتىڭىز جوق, سەبەبٸ مىندا باسقا قاتىسۋشىنىڭ جەكە باپتاۋلارى بار.', 'ns-specialprotected' => '{{ns:special}} ەسٸم اياسىنداعى بەتتەر ٶڭدەلٸنبەيدٸ', -'protected-subtitle' => '(بۇل بەت قورعالعان)', -'protected-subtitle-same' => '(بۇل بەت قورعالعان. كەيبٸر پايدالانۋشىلار ($1) ٵلٸ دە بۇنى ٶڭدەي نە جىلجىتا الادى.)', -'protected-subtitle-each' => '(بۇل بەت قورعالعان. كەيبٸر پايدالانۋشىلار ($1) ٵلٸ دە بۇنى ٶڭدەي الادى جٵنە باسقالار ($2) بۇنى جىلجىتا الادى.)', -'protected-anyone' => 'ٵركٸم', # Login and logout pages 'logouttitle' => 'قاتىسۋشى شىعۋى', diff --git a/languages/messages/MessagesKk_kz.php b/languages/messages/MessagesKk_kz.php index 4c75e907b4..fb3c4ab97a 100644 --- a/languages/messages/MessagesKk_kz.php +++ b/languages/messages/MessagesKk_kz.php @@ -680,10 +680,6 @@ $2', 'namespaceprotected' => "'''$1''' есім аясындағы беттерді өңдеу үшін рұқсатыңыз жоқ.", 'customcssjsprotected' => 'Бұл бетті өңдеуге рұқсатыңыз жоқ, себебі мында басқа қатысушының жеке баптаулары бар.', 'ns-specialprotected' => '{{ns:special}} есім аясындағы беттер өңделінбейді', -'protected-subtitle' => '(Бұл бет қорғалған)', -'protected-subtitle-same' => '(Бұл бет қорғалған. Кейбір пайдаланушылар ($1) әлі де бұны өңдей не жылжыта алады.)', -'protected-subtitle-each' => '(Бұл бет қорғалған. Кейбір пайдаланушылар ($1) әлі де бұны өңдей алады және басқалар ($2) бұны жылжыта алады.)', -'protected-anyone' => 'әркім', # Login and logout pages 'logouttitle' => 'Қатысушы шығуы', diff --git a/languages/messages/MessagesKk_tr.php b/languages/messages/MessagesKk_tr.php index a842c171e0..fad2341ea3 100644 --- a/languages/messages/MessagesKk_tr.php +++ b/languages/messages/MessagesKk_tr.php @@ -681,10 +681,6 @@ $2', 'namespaceprotected' => "'''$1''' esim ayasındağı betterdi öñdew üşin ruqsatıñız joq.", 'customcssjsprotected' => 'Bul betti öñdewge ruqsatıñız joq, sebebi mında basqa qatıswşınıñ jeke baptawları bar.', 'ns-specialprotected' => '{{ns:special}} esim ayasındağı better öñdelinbeýdi', -'protected-subtitle' => '(Bul bet qorğalğan)', -'protected-subtitle-same' => '(Bul bet qorğalğan. Keýbir paýdalanwşılar ($1) äli de bunı öñdeý ne jıljıta aladı.)', -'protected-subtitle-each' => '(Bul bet qorğalğan. Keýbir paýdalanwşılar ($1) äli de bunı öñdeý aladı jäne basqalar ($2) bunı jıljıta aladı.)', -'protected-anyone' => 'ärkim', # Login and logout pages 'logouttitle' => 'Qatıswşı şığwı', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 4ba8df3ded..7ecd463da5 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -330,7 +330,9 @@ $wgMessageStructure = array( 'customcssjsprotected', 'ns-specialprotected', 'protected-subtitle', - 'protected-subtitle-edit', + 'protected-subtitle-same', + 'protected-subtitle-each', + 'protected-anyone', ), 'login' => array( 'logouttitle',