Merge "(Bug 41352) Provide tests for edit conflicts."
[lhc/web/wiklou.git] / includes / actions / InfoAction.php
index 3adf890..29c3d7e 100644 (file)
@@ -203,6 +203,21 @@ class InfoAction extends FormlessAction {
                        $this->msg( 'pageinfo-display-title' ), $displayTitle
                );
 
+               // Is it a redirect? If so, where to?
+               if ( $title->isRedirect() ) {
+                       $pageInfo['header-basic'][] = array(
+                               $this->msg( 'pageinfo-redirectsto' ),
+                               Linker::link( $this->page->getRedirectTarget() ) .
+                               $this->msg( 'word-separator' )->text() .
+                               $this->msg( 'parentheses', Linker::link(
+                                       $this->page->getRedirectTarget(),
+                                       $this->msg( 'pageinfo-redirectsto-info' )->escaped(),
+                                       array(),
+                                       array( 'action' => 'info' )
+                               ) )->text()
+                       );
+               }
+
                // Default sort key
                $sortKey = $title->getCategorySortKey();
                if ( !empty( $pageProperties['defaultsort'] ) ) {
@@ -219,6 +234,12 @@ class InfoAction extends FormlessAction {
                // Page ID (number not localised, as it's a database ID)
                $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-article-id' ), $id );
 
+               // Language in which the page content is (supposed to be) written
+               $pageLang = $title->getPageLanguage()->getCode();
+               $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-language' ),
+                       Language::fetchLanguageName( $pageLang, $lang->getCode() )
+                       . ' ' . $this->msg( 'parentheses', $pageLang ) );
+
                // Search engine status
                $pOutput = new ParserOutput();
                if ( isset( $pageProperties['noindex'] ) ) {
@@ -258,6 +279,14 @@ class InfoAction extends FormlessAction {
                                ->numParams( count( $title->getRedirectsHere() ) )
                );
 
+               // Is it counted as a content page?
+               if ( $this->page->isCountable() ) {
+                       $pageInfo['header-basic'][] = array(
+                               $this->msg( 'pageinfo-contentpage' ),
+                               $this->msg( 'pageinfo-contentpage-yes' )
+                       );
+               }
+
                // Subpages of this page, if subpages are enabled for the current NS
                if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
                        $prefixIndex = SpecialPage::getTitleFor( 'Prefixindex', $title->getPrefixedText() . '/' );
@@ -274,6 +303,30 @@ class InfoAction extends FormlessAction {
                // Page protection
                $pageInfo['header-restrictions'] = array();
 
+               // Is this page effected by the cascading protection of something which includes it?
+               if ( $title->isCascadeProtected() ) {
+                       $cascadingFrom = '';
+                       $sources = $title->getCascadeProtectionSources(); // Array deferencing is in PHP 5.4 :(
+
+                       foreach ( $sources[0] as $sourceTitle ) {
+                               $cascadingFrom .= Html::rawElement( 'li', array(), Linker::linkKnown( $sourceTitle ) );
+                       }
+
+                       $cascadingFrom = Html::rawElement( 'ul', array(), $cascadingFrom );
+                       $pageInfo['header-restrictions'][] = array(
+                               $this->msg( 'pageinfo-protect-cascading-from' ),
+                               $cascadingFrom
+                       );
+               }
+
+               // Is out protection set to cascade to other pages?
+               if ( $title->areRestrictionsCascading() ) {
+                       $pageInfo['header-restrictions'][] = array(
+                               $this->msg( 'pageinfo-protect-cascading' ),
+                               $this->msg( 'pageinfo-protect-cascading-yes' )
+                       );
+               }
+
                // Page protection
                foreach ( $title->getRestrictionTypes() as $restrictionType ) {
                        $protectionLevel = implode( ', ', $title->getRestrictions( $restrictionType ) );
@@ -535,7 +588,7 @@ class InfoAction extends FormlessAction {
        }
 
        /**
-        * Returns the name that goes in the <h1> page title.
+        * Returns the name that goes in the "<h1>" page title.
         *
         * @return string
         */
@@ -606,7 +659,7 @@ class InfoAction extends FormlessAction {
        }
 
        /**
-        * Returns the description that goes below the <h1> tag.
+        * Returns the description that goes below the "<h1>" tag.
         *
         * @return string
         */