Follow-up on r56284: LogEventsList::showLogExtract gets associative array for additio...
[lhc/web/wiklou.git] / includes / EditPage.php
index 001e04b..bf7bb63 100644 (file)
@@ -730,7 +730,12 @@ class EditPage {
                }
                # Give a notice if the user is editing a deleted/moved page...
                if ( !$this->mTitle->exists() ) {
-                       $this->showLogs( $wgOut );
+                       LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), $this->mTitle->getPrefixedText(), 
+                               '', array( 'lim' => 10, 
+                                          'conds' => array( "log_action != 'revision'" ), 
+                                          'showIfEmpty' => false, 
+                                          'msgKey' => array( 'recreate-moveddeleted-warn') ) 
+                       );
                }
        }
 
@@ -1277,10 +1282,8 @@ class EditPage {
                                $noticeMsg = 'protectedpagewarning';
                                $classes[] = 'mw-textarea-protected';
                        }
-                       $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" );
-                       $wgOut->addWikiMsg( $noticeMsg );
-                       LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 1 );
-                       $wgOut->addHTML( "</div>\n" );
+                       LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 
+                               array( 'lim' => 1, 'msgKey' => array( $noticeMsg ) ) );
                }
                if ( $this->mTitle->isCascadeProtected() ) {
                        # Is this page under cascading protection from some source pages?
@@ -2481,42 +2484,6 @@ END
                $wgOut->addWikiMsg( 'nocreatetext' );
        }
 
-       /**
-        * If there are rows in the deletion/move log for this page, show them,
-        * along with a nice little note for the user
-        *
-        * @param OutputPage $out
-        */
-       protected function showLogs( $out ) {
-               global $wgUser;
-               $loglist = new LogEventsList( $wgUser->getSkin(), $out );
-               $pager = new LogPager( $loglist, array('move', 'delete'), false,
-                       $this->mTitle->getPrefixedText(), '', array( "log_action != 'revision'" ) );
-
-               $count = $pager->getNumRows();
-               if ( $count > 0 ) {
-                       $pager->mLimit = 10;
-                       $out->addHTML( '<div class="mw-warning-with-logexcerpt">' );
-                       $out->addWikiMsg( 'recreate-moveddeleted-warn' );
-                       $out->addHTML(
-                               $loglist->beginLogEventsList() .
-                               $pager->getBody() .
-                               $loglist->endLogEventsList()
-                       );
-                       if($count > 10){
-                               $out->addHTML( $wgUser->getSkin()->link(
-                                       SpecialPage::getTitleFor( 'Log' ),
-                                       wfMsgHtml( 'log-fulllog' ),
-                                       array(),
-                                       array( 'page' => $this->mTitle->getPrefixedText() ) ) );
-                       }
-                       $out->addHTML( '</div>' );
-                       return true;
-               }
-               
-               return false;
-       }
-
        /**
         * Attempt submission
         * @return bool false if output is done, true if the rest of the form should be displayed