Make my last three commits interoperate (display protection expiry on Special:Protect...
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 22 Jan 2007 08:57:40 +0000 (08:57 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 22 Jan 2007 08:57:40 +0000 (08:57 +0000)
includes/Article.php
includes/SpecialProtectedpages.php
languages/messages/MessagesEn.php
languages/messages/MessagesHe.php

index 20eb4ef..e8c152c 100644 (file)
@@ -1733,7 +1733,7 @@ class Article {
                                }
 
                                if ( $encodedExpiry != 'infinity' ) {
-                                       $expiry_description = ' ' . wfMsgForContent( 'protect-expiring', $wgContLang->timeanddate( $expiry ) );
+                                       $expiry_description = ' (' . wfMsgForContent( 'protect-expiring', $wgContLang->timeanddate( $expiry ) ).')';
                                }
 
                                if( $protect ) {
index b66f94e..ceeadce 100644 (file)
@@ -43,8 +43,8 @@ class ProtectedPagesPage extends PageQueryPage {
                $dbr =& wfGetDB( DB_SLAVE );
                list( $page, $page_restrictions ) = $dbr->tableNamesN( 'page', 'page_restrictions' );
                return "SELECT DISTINCT page_id, 'Protectedpages' as type, page_namespace AS namespace, page_title as title, " .
-                       "page_title AS value, pr_level " .
-                       "FROM $page LEFT JOIN $page_restrictions ON page_id = pr_page WHERE pr_level IS NOT NULL ";
+                       "page_title AS value, pr_level, pr_expiry " .
+                       "FROM $page LEFT JOIN $page_restrictions ON page_id = pr_page WHERE pr_level IS NOT NULL AND pr_user IS NULL ";
     }
 
        /**
@@ -59,9 +59,23 @@ class ProtectedPagesPage extends PageQueryPage {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                $link = $skin->makeLinkObj( $title );
 
+               $description_items = array ();
+
                $protType = wfMsg( 'restriction-level-' . $result->pr_level );
 
-               return wfSpecialList( $link, $protType );
+               $description_items[] = $protType;
+
+               $expiry_description = '';
+
+               if ( $result->pr_expiry != 'infinity' && strlen($result->pr_expiry) ) {
+                       $expiry = Block::decodeExpiry( $result->pr_expiry );
+       
+                       $expiry_description = wfMsgForContent( 'protect-expiring', $wgLang->timeanddate( $expiry ) );
+
+                       $description_items[] = $expiry_description;
+               }
+
+               return wfSpecialList( $link, implode( $description_items, ', ' ) );
        }
 }
 
index 7d97bfb..45793c9 100644 (file)
@@ -1761,7 +1761,7 @@ page protection levels. Here are the current settings for the page <strong>$1</s
 'protect-level-autoconfirmed' => 'Block unregistered users',
 'protect-level-sysop' => 'Sysops only',
 'protect-summary-cascade' => 'cascading',
-'protect-expiring' => '(expires $1)',
+'protect-expiring' => 'expires $1',
 'protect-cascade' => 'Cascading protection - protect any pages included in this page.',
 
 # restrictions (nouns)
index 02fba54..e499d9d 100644 (file)
@@ -1350,7 +1350,7 @@ $NEWPAGE
 'protect-level-autoconfirmed' => 'משתמשים רשומים בלבד',
 'protect-level-sysop'         => 'מפעילי מערכת בלבד',
 'protect-summary-cascade'     => 'מדורג',
-'protect-expiring'            => '(פוקע $1)',
+'protect-expiring'            => 'פוקע $1',
 'protect-cascade'             => 'הגנה מדורגת – הגן על כל הדפים המוכללים בדף זה.',
 
 # Restrictions (nouns)