API: Add wfDeprecated() to deprecated ApiResult methods
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index 338d939..de4f977 100644 (file)
@@ -65,8 +65,8 @@ class InfoAction extends FormlessAction {
         */
        public static function invalidateCache( Title $title ) {
                global $wgMemc;
-               // Clear page info.
-               $revision = WikiPage::factory( $title )->getRevision();
+
+               $revision = Revision::newFromTitle( $title, 0, Revision::READ_LATEST );
                if ( $revision !== null ) {
                        $key = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $revision->getId() );
                        $wgMemc->delete( $key );
@@ -373,18 +373,30 @@ class InfoAction extends FormlessAction {
 
                if ( $title->inNamespace( NS_CATEGORY ) ) {
                        $category = Category::newFromTitle( $title );
+
+                       // $allCount is the total number of cat members,
+                       // not the count of how many members are normal pages.
+                       $allCount = (int)$category->getPageCount();
+                       $subcatCount = (int)$category->getSubcatCount();
+                       $fileCount = (int)$category->getFileCount();
+                       $pagesCount = $allCount - $subcatCount - $fileCount;
+
                        $pageInfo['category-info'] = array(
+                               array(
+                                       $this->msg( 'pageinfo-category-total' ),
+                                       $lang->formatNum( $allCount )
+                               ),
                                array(
                                        $this->msg( 'pageinfo-category-pages' ),
-                                       $lang->formatNum( $category->getPageCount() )
+                                       $lang->formatNum( $pagesCount )
                                ),
                                array(
                                        $this->msg( 'pageinfo-category-subcats' ),
-                                       $lang->formatNum( $category->getSubcatCount() )
+                                       $lang->formatNum( $subcatCount )
                                ),
                                array(
                                        $this->msg( 'pageinfo-category-files' ),
-                                       $lang->formatNum( $category->getFileCount() )
+                                       $lang->formatNum( $fileCount )
                                )
                        );
                }
@@ -434,6 +446,9 @@ class InfoAction extends FormlessAction {
                                        $message = $message->escaped();
                                }
                        }
+                       $expiry = $title->getRestrictionExpiry( $restrictionType );
+                       $formattedexpiry = $this->msg( 'parentheses', $this->getLanguage()->formatExpiry( $expiry ) )->escaped();
+                       $message .= $this->msg( 'word-separator' )->escaped() . $formattedexpiry;
 
                        // Messages: restriction-edit, restriction-move, restriction-create,
                        // restriction-upload