* (bug 8392) Display protection status of transcluded pages in the edit page
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 31 Dec 2006 01:35:26 +0000 (01:35 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 31 Dec 2006 01:35:26 +0000 (01:35 +0000)
  template list. Patch by Fyren, with i18n naming tweak.

RELEASE-NOTES
includes/Linker.php
languages/messages/MessagesEn.php

index 8c149b8..b5322f0 100644 (file)
@@ -435,6 +435,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   implementation is unstable
 * Add hook for extensions to add user information to the panel in preferences,
   next to the user name and ID.
+* (bug 8392) Display protection status of transcluded pages in the edit page
+  template list. Patch by Fyren, with i18n naming tweak.
 
 
 == Languages updated ==
index 22b294e..42ad07b 100644 (file)
@@ -1131,15 +1131,25 @@ class Linker {
 
                        # Construct the HTML
                        $outText = '<div class="mw-templatesUsedExplanation">';
-                       if ($preview)
+                       if ( $preview ) {
                                $outText .= wfMsgExt( 'templatesusedpreview', array( 'parse' ) );
-                       elseif ($section)
+                       } elseif ( $section ) {
                                $outText .= wfMsgExt( 'templatesusedsection', array( 'parse' ) );
-                       else
+                       } else {
                                $outText .= wfMsgExt( 'templatesused', array( 'parse' ) );
+                       }
                        $outText .= '</div><ul>';
+
                        foreach ( $templates as $titleObj ) {
-                               $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';
+                               $r = $titleObj->getRestrictions( 'edit' );
+                               if ( in_array( 'sysop', $r ) ) { 
+                                       $protected = wfMsgExt( 'template-protected', array( 'parseinline' ) );
+                               } elseif ( in_array( 'autoconfirmed', $r ) ) {
+                                       $protected = wfMsgExt( 'template-semiprotected', array( 'parseinline' ) );
+                               } else {
+                                       $protected = '';
+                               }
+                               $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . ' ' . $protected . '</li>';
                        }
                        $outText .= '</ul>';
                }
index 517b37c..b89021a 100644 (file)
@@ -1010,6 +1010,8 @@ the text into a text file and save it for later.</strong>',
 'templatesused'        => 'Templates used on this page:',
 'templatesusedpreview' => 'Templates used in this preview:',
 'templatesusedsection' => 'Templates used in this section:',
+'template-protected' => '(protected)',
+'template-semiprotected' => '(semi-protected)',
 'edittools' => '<!-- Text here will be shown below edit and upload forms. -->',
 'nocreatetitle' => 'Page creation limited',
 'nocreatetext' => 'This site has restricted the ability to create new pages.