r25210 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25209‎ | r25210 | r25211 >
Date:21:05, 27 August 2007
Author:brion
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesDe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesHe.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_cn.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_kz.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesKk_tr.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -330,7 +330,9 @@
331331 'customcssjsprotected',
332332 'ns-specialprotected',
333333 'protected-subtitle',
334 - 'protected-subtitle-edit',
 334+ 'protected-subtitle-same',
 335+ 'protected-subtitle-each',
 336+ 'protected-anyone',
335337 ),
336338 'login' => array(
337339 'logouttitle',
Index: trunk/phase3/includes/Article.php
@@ -740,11 +740,6 @@
741741 }
742742 }
743743
744 - if ( $this->mTitle->isProtected() ) {
745 - $editrestr = $this->mTitle->getRestrictions('edit');
746 - $this->addProtectionNotice( $editrestr );
747 - }
748 -
749744 $outputDone = false;
750745 wfRunHooks( 'ArticleViewHeader', array( &$this, &$outputDone, &$pcache ) );
751746 if ( $pcache ) {
@@ -891,39 +886,6 @@
892887 wfProfileOut( __METHOD__ );
893888 }
894889
895 - /*
896 - * Output a notice that a page is protected. Only give details for edit
897 - * restrictions. Cares only about the first permission in the arrays, which is
898 - * part of a larger shitty inconsistency about requiring several permissions...
899 - * @param Array $editrestr, edit restrictions
900 - */
901 - function addProtectionNotice( $editrestr ) {
902 - global $wgOut;
903 -
904 - if( empty($editrestr) )
905 - return;
906 -
907 - $permission = $editrestr[0];
908 - $permission = ($permission=='sysop') ? 'protect' : $permission;
909 -
910 - $editGroups = '';
911 - # Get groups that have each right
912 - if( $permission ) {
913 - $editGroups = $wgOut->getGroupsWithPermission( $permission );
914 - $editGroups = implode( ', ', $editGroups );
915 - }
916 - # Use general messages if no groups found for a type
917 - if( !$editGroups ) {
918 - $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr );
919 - } else {
920 - $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr );
921 - }
922 - if( $wgOut->getSubtitle() )
923 - $msg = " $msg";
924 -
925 - $wgOut->setSubtitle( $wgOut->getSubtitle() . $msg );
926 - }
927 -
928890 function addTrackbacks() {
929891 global $wgOut, $wgUser;
930892
Index: trunk/phase3/includes/OutputPage.php
@@ -878,7 +878,7 @@
879879 * @param string $permission key required
880880 */
881881 public function permissionRequired( $permission ) {
882 - global $wgUser;
 882+ global $wgGroupPermissions, $wgUser;
883883
884884 $this->setPageTitle( wfMsg( 'badaccess' ) );
885885 $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
@@ -886,7 +886,19 @@
887887 $this->setArticleRelated( false );
888888 $this->mBodytext = '';
889889
890 - $groups = $this->getGroupsWithPermission( $permission );
 890+ $groups = array();
 891+ foreach( $wgGroupPermissions as $key => $value ) {
 892+ if( isset( $value[$permission] ) && $value[$permission] == true ) {
 893+ $groupName = User::getGroupName( $key );
 894+ $groupPage = User::getGroupPage( $key );
 895+ if( $groupPage ) {
 896+ $skin = $wgUser->getSkin();
 897+ $groups[] = $skin->makeLinkObj( $groupPage, $groupName );
 898+ } else {
 899+ $groups[] = $groupName;
 900+ }
 901+ }
 902+ }
891903 $n = count( $groups );
892904 $groups = implode( ', ', $groups );
893905 switch( $n ) {
@@ -901,31 +913,7 @@
902914 $this->addHtml( $message );
903915 $this->returnToMain( false );
904916 }
905 -
906 - /**
907 - * Return an array of the groups in (UI name form) that have a permission
908 - *
909 - * @param string $permission key required
910 - */
911 - public function getGroupsWithPermission( $permission ) {
912 - global $wgUser, $wgGroupPermissions;
913917
914 - $groups = array();
915 - foreach( $wgGroupPermissions as $key => $value ) {
916 - if( isset( $value[$permission] ) && $value[$permission] == true ) {
917 - $groupName = User::getGroupName( $key );
918 - $groupPage = User::getGroupPage( $key );
919 - if( $groupPage ) {
920 - $skin = $wgUser->getSkin();
921 - $groups[] = $skin->makeLinkObj( $groupPage, $groupName );
922 - } else {
923 - $groups[] = $groupName;
924 - }
925 - }
926 - }
927 - return $groups;
928 - }
929 -
930918 /**
931919 * Use permissionRequired.
932920 * @deprecated
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -794,11 +794,9 @@
795795 'sqlhidden' => '(SQL query hidden)',
796796 '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:
797797 $2",
798 -'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.",
799 -'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
800 -'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.",
801 -'protected-subtitle' => "(This page is protected)",
802 -'protected-subtitle-edit' => "(This page is protected. Only certain users ($1) can edit it.)",
 798+'namespaceprotected' => "You do not have permission to edit pages in the '''$1''' namespace.",
 799+'customcssjsprotected' => "You do not have permission to edit this page, because it contains another user's personal settings.",
 800+'ns-specialprotected' => "Pages in the {{ns:special}} namespace cannot be edited.",
803801
804802 # Login and logout pages
805803 'logouttitle' => 'User logout',
Index: trunk/phase3/languages/messages/MessagesHe.php
@@ -533,8 +533,6 @@
534534 'namespaceprotected' => "אינכם מורשים לערוך דפים במרחב השם '''$1'''.",
535535 'customcssjsprotected' => 'אינכם מורשים לערוך דף זה, כיוון שהוא כולל את ההגדרות האישיות של משתמש אחר.',
536536 'ns-specialprotected' => 'לא ניתן לערוך דפים מיוחדים.',
537 -'protected-subtitle' => '(דף זה מוגן)',
538 -'protected-subtitle-edit' => '(דף זה מוגן כך שרק משתמשים מסוימים ($1) יכולים לערוך אותו)',
539537
540538 # Login and logout pages
541539 'logouttitle' => 'יציאה מהחשבון',
Index: trunk/phase3/languages/messages/MessagesKk_tr.php
@@ -681,10 +681,6 @@
682682 'namespaceprotected' => "'''$1''' esim ayasındağı betterdi öñdew üşin ruqsatıñız joq.",
683683 'customcssjsprotected' => 'Bul betti öñdewge ruqsatıñız joq, sebebi mında basqa qatıswşınıñ jeke baptawları bar.',
684684 'ns-specialprotected' => '{{ns:special}} esim ayasındağı better öñdelinbeýdi',
685 -'protected-subtitle' => '(Bul bet qorğalğan)',
686 -'protected-subtitle-same' => '(Bul bet qorğalğan. Keýbir paýdalanwşılar ($1) äli de bunı öñdeý ne jıljıta aladı.)',
687 -'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ı.)',
688 -'protected-anyone' => 'ärkim',
689685
690686 # Login and logout pages
691687 'logouttitle' => 'Qatıswşı şığwı',
Index: trunk/phase3/languages/messages/MessagesKk_cn.php
@@ -688,10 +688,6 @@
689689 'namespaceprotected' => "'''$1''' ەسٸم اياسىنداعى بەتتەردٸ ٶڭدەۋ ٷشٸن رۇقساتىڭىز جوق.",
690690 'customcssjsprotected' => 'بۇل بەتتٸ ٶڭدەۋگە رۇقساتىڭىز جوق, سەبەبٸ مىندا باسقا قاتىسۋشىنىڭ جەكە باپتاۋلارى بار.',
691691 'ns-specialprotected' => '{{ns:special}} ەسٸم اياسىنداعى بەتتەر ٶڭدەلٸنبەيدٸ',
692 -'protected-subtitle' => '(بۇل بەت قورعالعان)',
693 -'protected-subtitle-same' => '(بۇل بەت قورعالعان. كەيبٸر پايدالانۋشىلار ($1) ٵلٸ دە بۇنى ٶڭدەي نە جىلجىتا الادى.)',
694 -'protected-subtitle-each' => '(بۇل بەت قورعالعان. كەيبٸر پايدالانۋشىلار ($1) ٵلٸ دە بۇنى ٶڭدەي الادى جٵنە باسقالار ($2) بۇنى جىلجىتا الادى.)',
695 -'protected-anyone' => 'ٵركٸم',
696692
697693 # Login and logout pages
698694 'logouttitle' => 'قاتىسۋشى شىعۋى',
Index: trunk/phase3/languages/messages/MessagesDe.php
@@ -487,10 +487,6 @@
488488 'namespaceprotected' => "Du hast keine Berechtigung, die Seite in dem '''$1'''-Namensraum zu bearbeiten.",
489489 'customcssjsprotected' => 'Du bist nicht berechtigt diese Seite zu bearbeiten, da sie zu den persönlichen Einstellungen eines anderen Benutzers gehört.',
490490 'ns-specialprotected' => 'Seiten im {{ns:special}}-Namensraum können nicht bearbeitet werden.',
491 -'protected-subtitle' => '(Diese Seite ist geschützt)',
492 -'protected-subtitle-same' => '(Diese Seite ist geschützt. Benutzer der Gruppe(n) „$1“ können sie weiterhin bearbeiten oder verschieben.)',
493 -'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.)',
494 -'protected-anyone' => 'Jeder',
495491
496492 # Login and logout pages
497493 'logouttitle' => 'Benutzer-Abmeldung',
Index: trunk/phase3/languages/messages/MessagesKk_kz.php
@@ -680,10 +680,6 @@
681681 'namespaceprotected' => "'''$1''' есім аясындағы беттерді өңдеу үшін рұқсатыңыз жоқ.",
682682 'customcssjsprotected' => 'Бұл бетті өңдеуге рұқсатыңыз жоқ, себебі мында басқа қатысушының жеке баптаулары бар.',
683683 'ns-specialprotected' => '{{ns:special}} есім аясындағы беттер өңделінбейді',
684 -'protected-subtitle' => '(Бұл бет қорғалған)',
685 -'protected-subtitle-same' => '(Бұл бет қорғалған. Кейбір пайдаланушылар ($1) әлі де бұны өңдей не жылжыта алады.)',
686 -'protected-subtitle-each' => '(Бұл бет қорғалған. Кейбір пайдаланушылар ($1) әлі де бұны өңдей алады және басқалар ($2) бұны жылжыта алады.)',
687 -'protected-anyone' => 'әркім',
688684
689685 # Login and logout pages
690686 'logouttitle' => 'Қатысушы шығуы',
Index: trunk/phase3/RELEASE-NOTES
@@ -190,8 +190,6 @@
191191 * Add accesskey 's' and tooltip to 'upload file' button at Special:Upload
192192 * Introduced 'SkinAfterBottomScripts' hook; see docs/hooks.txt for
193193 more information
194 -* (bug 10347) Give notice when a page is viewed that is protected. Does not
195 - show for cascade protection however.
196194
197195 == Bugfixes since 1.10 ==
198196
@@ -414,8 +412,6 @@
415413 * Resizing transparent GIF images with GD now retains transparency by skipping
416414 resampling
417415 * (bug 11065) Fix regression in handling of wiki-formatted EXIF metadata
418 -* (bug 10347) Add subtitle message to indicate that the page being viewed is
419 - protected.
420416 * Double encoding broke Special:Newpages for some languages
421417 * Adding a newline before the statistics footer, to prevent parsing problems
422418 * Preventing the TOC from appearing in Special:Statistics

Follow-up revisions

RevisionCommit summaryAuthorDate
r25223Merged revisions 25126-25214 via svnmerge from...david07:39, 28 August 2007
r42658(bug 10347) Add subtitle message for protected pagesaaron15:05, 27 October 2008
r42664Revert r42658 "(bug 10347) Add subtitle message for protected pages"...brion18:03, 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

Status & tagging log