From: Tyler Anthony Romeo Date: Fri, 2 Nov 2012 20:45:49 +0000 (-0400) Subject: (bug 41368) Added category information to InfoAction. X-Git-Tag: 1.31.0-rc.0~21129 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices//%22?a=commitdiff_plain;h=6c7509862659e311e545ab04937d24a8af4a5a97;p=lhc%2Fweb%2Fwiklou.git (bug 41368) Added category information to InfoAction. Added a Category information section to InfoAction that only shows for NS_CATEGORY pages. It lists the number of pages, subcategories, and files in the category. Change-Id: Ic8965ffc7e4f9abb1f46d773839bdf5c2f06b72e --- diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index f1799a4631..5159a5a42e 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -310,6 +310,24 @@ class InfoAction extends FormlessAction { ); } + if ( $title->inNamespace( NS_CATEGORY ) ) { + $category = Category::newFromTitle( $title ); + $pageInfo['category-info'] = array( + array( + $this->msg( 'pageinfo-category-pages' ), + $lang->formatNum( $category->getPageCount() ) + ), + array( + $this->msg( 'pageinfo-category-subcats' ), + $lang->formatNum( $category->getSubcatCount() ) + ), + array( + $this->msg( 'pageinfo-category-files' ), + $lang->formatNum( $category->getFileCount() ) + ) + ); + } + // Page protection $pageInfo['header-restrictions'] = array(); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e4da1dde8d..c774840bd0 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3786,6 +3786,10 @@ This is probably caused by a link to a blacklisted external site.', 'pageinfo-protect-cascading' => 'Protections are cascading from here', 'pageinfo-protect-cascading-yes' => 'Yes', 'pageinfo-protect-cascading-from' => 'Protections are cascading from', +'pageinfo-category-info' => 'Category information', +'pageinfo-category-pages' => 'Number of pages', +'pageinfo-category-subcats' => 'Number of subcategories', +'pageinfo-category-files' => 'Number of files', # Skin names 'skinname-standard' => 'Classic', # only translate this message to other languages if you have to change it diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index ef31e6a857..cb81824c9c 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -6698,6 +6698,10 @@ Used as link text, linked to '{{int:Prefixindex}}' page ([[Special:PrefixIndex]] *{{msg-mw|Pageinfo-protect-cascading}} *{{msg-mw|Pageinfo-protect-cascading-yes}}', 'pageinfo-protect-cascading-from' => 'Key for a list of pages where protections are cascading from', +'pageinfo-category-info' => 'Header for the category information section in InfoAction', +'pageinfo-category-pages' => 'Label for the number of files in a category', +'pageinfo-category-subcats' => 'Label for the number of subcategories in a category', +'pageinfo-category-files' => 'Label for the number of files in a category', # Skin names 'skinname-standard' => '{{optional}} diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 6544514459..5e20920304 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2720,6 +2720,10 @@ $wgMessageStructure = array( 'pageinfo-protect-cascading', 'pageinfo-protect-cascading-yes', 'pageinfo-protect-cascading-from', + 'pageinfo-category-info', + 'pageinfo-category-pages', + 'pageinfo-category-subcats', + 'pageinfo-category-files' ), 'skin' => array( 'skinname-standard',