(bug 41368) Added category information to InfoAction.
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index f1799a4..5159a5a 100644 (file)
@@ -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();