Provide message/warning/error box abstraction
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchangeslinked.php
index fee336e..358a309 100644 (file)
@@ -47,7 +47,7 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
        }
 
        /**
-        * @inheritdoc
+        * @inheritDoc
         */
        protected function doMainQuery( $tables, $select, $conds, $query_options,
                $join_conds, FormOptions $opts
@@ -62,8 +62,9 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                $outputPage = $this->getOutput();
                $title = Title::newFromText( $target );
                if ( !$title || $title->isExternal() ) {
-                       $outputPage->addHTML( '<div class="errorbox">' . $this->msg( 'allpagesbadtitle' )
-                                       ->parse() . '</div>' );
+                       $outputPage->addHTML(
+                               Html::errorBox( $this->msg( 'allpagesbadtitle' )->parse() )
+                       );
 
                        return false;
                }
@@ -84,8 +85,10 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                $ns = $title->getNamespace();
                $dbkey = $title->getDBkey();
 
-               $tables[] = 'recentchanges';
-               $select = array_merge( RecentChange::selectFields(), $select );
+               $rcQuery = RecentChange::getQueryInfo();
+               $tables = array_merge( $tables, $rcQuery['tables'] );
+               $select = array_merge( $rcQuery['fields'], $select );
+               $join_conds = array_merge( $join_conds, $rcQuery['joins'] );
 
                // left join with watchlist table to highlight watched rows
                $uid = $this->getUser()->getId();
@@ -98,11 +101,11 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                                'wl_namespace=rc_namespace'
                        ] ];
                }
-               if ( $this->getUser()->isAllowed( 'rollback' ) ) {
-                       $tables[] = 'page';
-                       $join_conds['page'] = [ 'LEFT JOIN', 'rc_cur_id=page_id' ];
-                       $select[] = 'page_latest';
-               }
+
+               // JOIN on page, used for 'last revision' filter highlight
+               $tables[] = 'page';
+               $join_conds['page'] = [ 'LEFT JOIN', 'rc_cur_id=page_id' ];
+               $select[] = 'page_latest';
 
                $tagFilter = $opts['tagfilter'] ? explode( '|', $opts['tagfilter'] ) : [];
                ChangeTags::modifyDisplayQuery(