Add more protection info on edit (bug 6179)
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 5 Sep 2008 22:46:46 +0000 (22:46 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 5 Sep 2008 22:46:46 +0000 (22:46 +0000)
includes/EditPage.php
includes/LogEventsList.php

index 5936f66..e733ef1 100644 (file)
@@ -1203,6 +1203,7 @@ class EditPage {
                        }
                        $wgOut->addHTML( "<div id='mw-edit-$noticeMsg'>\n" );
                        $wgOut->addWikiMsg( $noticeMsg );
+                       LogEventsList::showLogExtract( $wgOut, 'protect', $this->mTitle->getPrefixedText(), '', 1 );
                        $wgOut->addHTML( "</div>\n" );
                }
                if( $this->mTitle->isCascadeProtected() ) {
index f868b00..28b0ea4 100644 (file)
@@ -367,11 +367,12 @@ class LogEventsList {
         * @param string $page
         * @param string $user
         */
-        public static function showLogExtract( $out, $type='', $page='', $user='' ) {
+       public static function showLogExtract( $out, $type='', $page='', $user='', $limit = NULL ) {
                global $wgUser;
                # Insert list of top 50 or so items
                $loglist = new LogEventsList( $wgUser->getSkin(), $out, 0 );
                $pager = new LogPager( $loglist, $type, $user, $page, '' );
+               if( $limit ) $pager->mLimit = $limit;
                $logBody = $pager->getBody();
                if( $logBody ) {
                        $out->addHTML(
@@ -382,7 +383,7 @@ class LogEventsList {
                } else {
                        $out->addWikiMsg( 'logempty' );
                }
-        }
+       }
 
         /**
         * SQL clause to skip forbidden log types for this user