From 698095516a66e9fba32d2013762eacccaa3163b2 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 22 Jan 2007 08:57:40 +0000 Subject: [PATCH] Make my last three commits interoperate (display protection expiry on Special:Protectedpages). Message slightly changed (brackets removed) so I've updated the translation so kindly provided by Rotem :-) --- includes/Article.php | 2 +- includes/SpecialProtectedpages.php | 20 +++++++++++++++++--- languages/messages/MessagesEn.php | 2 +- languages/messages/MessagesHe.php | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 20eb4ef84f..e8c152c6b2 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 ) { diff --git a/includes/SpecialProtectedpages.php b/includes/SpecialProtectedpages.php index b66f94e250..ceeadce8cd 100644 --- a/includes/SpecialProtectedpages.php +++ b/includes/SpecialProtectedpages.php @@ -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, ', ' ) ); } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 7d97bfb26f..45793c9dc5 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1761,7 +1761,7 @@ page protection levels. Here are the current settings for the page $1 '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) diff --git a/languages/messages/MessagesHe.php b/languages/messages/MessagesHe.php index 02fba5441c..e499d9dfc2 100644 --- a/languages/messages/MessagesHe.php +++ b/languages/messages/MessagesHe.php @@ -1350,7 +1350,7 @@ $NEWPAGE 'protect-level-autoconfirmed' => 'משתמשים רשומים בלבד', 'protect-level-sysop' => 'מפעילי מערכת בלבד', 'protect-summary-cascade' => 'מדורג', -'protect-expiring' => '(פוקע $1)', +'protect-expiring' => 'פוקע $1', 'protect-cascade' => 'הגנה מדורגת – הגן על כל הדפים המוכללים בדף זה.', # Restrictions (nouns) -- 2.20.1