http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82832

Revision: 82832
Author:   aaron
Date:     2011-02-26 03:04:59 +0000 (Sat, 26 Feb 2011)
Log Message:
-----------
* (bug 27628) Foxed unlocalized default value in Special:Stabilization
* Made PageStabilityForm expiry and reason handling code not insane
* Passed 25 limit into showLogExtract() to reduce clutter
* Removed excess $scExpiryOptions var
* Code cleanups to showForm()
* Minor tab fixes

Modified Paths:
--------------
    trunk/extensions/FlaggedRevs/FlaggedArticle.php
    trunk/extensions/FlaggedRevs/FlaggedArticleView.php
    trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
    trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php
    trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php

Modified: trunk/extensions/FlaggedRevs/FlaggedArticle.php
===================================================================
--- trunk/extensions/FlaggedRevs/FlaggedArticle.php     2011-02-26 02:50:20 UTC 
(rev 82831)
+++ trunk/extensions/FlaggedRevs/FlaggedArticle.php     2011-02-26 03:04:59 UTC 
(rev 82832)
@@ -340,7 +340,7 @@
                        array(),
                        array(
                                'flaggedpages' => array( 'LEFT JOIN', 
'fp_page_id = page_id' ),
-                               'flaggedrevs' => array( 'LEFT JOIN',
+                               'flaggedrevs'  => array( 'LEFT JOIN',
                                        'fr_page_id = fp_page_id AND fr_rev_id 
= fp_stable' ),
                                'flaggedpage_config' => array( 'LEFT JOIN', 
'fpc_page_id = page_id' ) )
                );

Modified: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
===================================================================
--- trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2011-02-26 02:50:20 UTC 
(rev 82831)
+++ trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2011-02-26 03:04:59 UTC 
(rev 82832)
@@ -783,7 +783,7 @@
                        $this->isDiffFromStable = true; // alter default review 
form tags
                        return
                                FlaggedRevsXML::diffToggle() .
-                               "<div id='mw-fr-stablediff'>" .
+                               "<div id='mw-fr-stablediff'>\n" .
                                self::getFormattedDiff( $diffBody, 
$multiNotice, $leftNote, $rightNote ) .
                                "</div>\n";;
                }

Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
===================================================================
--- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php  2011-02-26 02:50:20 UTC 
(rev 82831)
+++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php  2011-02-26 03:04:59 UTC 
(rev 82832)
@@ -1818,8 +1818,10 @@
                        $output .= Xml::option( $label, $limit, $limit == 
$restriction );
                }
                $output .= Xml::closeElement( 'select' );
+
                # Get expiry dropdown <select>...
                $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' );
+               $showProtectOptions = ( $scExpiryOptions !== '-' && $isAllowed 
);
                # Add the current expiry as an option
                $expiryFormOptions = '';
                if ( $config['expiry'] != 'infinity' ) {
@@ -1846,14 +1848,13 @@
                        $expiryFormOptions .= Xml::option( $show, $value, 
$expirySelect == $value ) . "\n";
                }
                # Actually add expiry dropdown to form
-               $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' );
-               $showProtectOptions = ( $scExpiryOptions !== '-' && $isAllowed 
);
                $output .= "<table>"; // expiry table start
                if ( $showProtectOptions && $isAllowed ) {
                        $output .= "
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( wfMsg( 
'stabilization-expiry' ), 'mwStabilizeExpirySelection' ) .
+                                               Xml::label( wfMsg( 
'stabilization-expiry' ),
+                                                       
'mwStabilizeExpirySelection' ) .
                                        "</td>
                                        <td class='mw-input'>" .
                                                Xml::tags( 'select',
@@ -1919,9 +1920,9 @@
                }
                $form->setAutoreview( $permission ); // protection level 
(autoreview restriction)
                $form->setWatchThis( null ); // protection form already has a 
watch check
-               $form->setReason( $wgRequest->getText( 'mwProtect-reason' ) ); 
// manual
+               $form->setReasonExtra( $wgRequest->getText( 'mwProtect-reason' 
) ); // manual
                $form->setReasonSelection( $wgRequest->getVal( 
'wpProtectReasonSelection' ) ); // dropdown
-               $form->setExpiry( $wgRequest->getVal( 'mwStabilizeExpiryOther' 
) ); // manual
+               $form->setExpiryCustom( $wgRequest->getVal( 
'mwStabilizeExpiryOther' ) ); // manual
                $form->setExpirySelection( $wgRequest->getVal( 
'mwStabilizeExpirySelection' ) ); // dropdown
                $form->ready(); // params all set
                if ( $wgRequest->wasPosted() && $form->isAllowed() ) {

Modified: trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php
===================================================================
--- trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php    2011-02-26 
02:50:20 UTC (rev 82831)
+++ trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php    2011-02-26 
03:04:59 UTC (rev 82832)
@@ -17,15 +17,14 @@
        protected $page = false; # Target page obj
        protected $watchThis = null; # Watch checkbox
        protected $reviewThis = null; # Auto-review option...
-       protected $reason = ''; # Custom/extra reason
+       protected $reasonExtra = ''; # Custom/extra reason
        protected $reasonSelection = ''; # Reason dropdown key
-       protected $expiry = ''; # Custom expiry
+       protected $expiryCustom = ''; # Custom expiry
        protected $expirySelection = ''; # Expiry dropdown key
        protected $override = -1; # Default version
        protected $autoreview = ''; # Autoreview restrictions...
 
        protected $oldConfig = array(); # Old page config
-       protected $oldExpiry = ''; # Old page config expiry (GMT)
        protected $inputLock = 0; # Disallow bad submissions
 
        protected $user = null;
@@ -52,12 +51,12 @@
                $this->trySet( $this->watchThis, $value );
        }
 
-       public function getReason() {
-               return $this->reason;
+       public function getReasonExtra() {
+               return $this->reasonExtra;
        }
 
-       public function setReason( $value ) {
-               $this->trySet( $this->reason, $value );
+       public function setReasonExtra( $value ) {
+               $this->trySet( $this->reasonExtra, $value );
        }
 
        public function getReasonSelection() {
@@ -68,12 +67,12 @@
                $this->trySet( $this->reasonSelection, $value );
        }
 
-       public function getExpiry() {
-               return $this->expiry;
+       public function getExpiryCustom() {
+               return $this->expiryCustom;
        }
 
-       public function setExpiry( $value ) {
-               $this->trySet( $this->expiry, $value );
+       public function setExpiryCustom( $value ) {
+               $this->trySet( $this->expiryCustom, $value );
        }
 
        public function getExpirySelection() {
@@ -86,12 +85,58 @@
 
        public function getAutoreview() {
                return $this->autoreview;
-       }       
+       }
 
        public function setAutoreview( $value ) {
                $this->trySet( $this->autoreview, $value );
        }
 
+       /*
+       * Get the final expiry, all inputs considered
+       * Note: does not check if the expiration is less than wfTimestampNow()
+       * @return 14-char timestamp or "infinity", or false if the input was 
invalid
+       */
+       public function getExpiry() {
+               if ( $this->expirySelection == 'existing' ) {
+                       return $this->oldConfig['expiry'];
+               } elseif ( $this->expirySelection == 'othertime' ) {
+                       $value = $this->expiryCustom;
+               } else {
+                       $value = $this->expirySelection;
+               }
+               if ( $value == 'infinite' || $value == 'indefinite' || $value 
== 'infinity' ) {
+                       $time = Block::infinity();
+               } else {
+                       $unix = strtotime( $value );
+                       # On error returns -1 for PHP <5.1 and false for PHP 
>=5.1
+                       if ( !$unix || $unix === -1 ) {
+                               return false;
+                       }
+                       // FIXME: non-qualified absolute times are not in users
+                       // specified timezone and there isn't notice about it 
in the ui
+                       $time = wfTimestamp( TS_MW, $unix );
+               }
+               return $time;
+       }
+
+       /*
+       * Get the final reason, all inputs considered
+       * @return string
+       */
+       public function getReason() {
+               # Custom reason replaces dropdown
+               if ( $this->reasonSelection != 'other' ) {
+                       $comment = $this->reasonSelection; // start with 
dropdown reason
+                       if ( $this->reasonExtra != '' ) {
+                               # Append custom reason
+                               $comment .= wfMsgForContent( 'colon-separator' 
) . $this->reasonExtra;
+                       }
+               } else {
+                       $comment = $this->reasonExtra; // just use custom reason
+               }
+               return $comment;
+       }
+
        /**
        * Set a member field to a value if the fields are unlocked
        */
@@ -136,6 +181,11 @@
                if ( $status !== true ) {
                        return $status; // bad target
                }
+               if ( $this->oldConfig === 
FlaggedRevs::getDefaultVisibilitySettings() ) {
+                       $this->expirySelection = 'infinite'; // no settings are 
set
+               } else {
+                       $this->expirySelection = 'existing'; // settings are set
+               }
                return $this->reallyPreloadSettings(); // load the params...
        }
 
@@ -155,6 +205,10 @@
                if ( $status !== true ) {
                        return $status; // bad target
                }
+               if ( $this->expiryCustom != '' ) {
+                       // Custom expiry takes precedence
+                       $this->expirySelection = 'othertime';
+               }
                $status = $this->reallyCheckSettings(); // check other params...
                return $status;
        }
@@ -182,25 +236,11 @@
        }
 
        protected function loadOldConfig() {
-               # Get the current page config and GMT expiry
+               # Get the current page config
                $this->oldConfig = FlaggedRevs::getPageStabilitySettings( 
$this->page, FR_MASTER );
-               $this->oldExpiry = $this->oldConfig['expiry'] === 'infinity'
-                       ? 'infinite'
-                       : wfTimestamp( TS_RFC2822, $this->oldConfig['expiry'] );
        }
 
        /*
-       * Gets the current config expiry in GMT (or 'infinite')
-       * @return string
-       */
-       public function getOldExpiryGMT() {
-               if ( !$this->inputLock ) {
-                       throw new MWException( __CLASS__ . " input fields not 
set yet.\n");
-               }
-               return $this->oldExpiry;
-       }
-
-       /*
        * Can the user change the settings for this page?
        * Note: if the current autoreview restriction is too high for this user
        *               then this will return false. Useful for form selectors.
@@ -235,19 +275,13 @@
                # Are we are going back to site defaults?
                $reset = $this->newConfigIsReset();
                # Parse and cleanup the expiry time given...
-               if ( $reset || $this->expiry == 'infinite' || $this->expiry == 
'indefinite' ) {
-                       $this->expiry = Block::infinity(); // normalize to 
'infinity'
-               } else {
-                       # Convert GNU-style date, on error returns -1 for PHP 
<5.1 and false for PHP >=5.1
-                       $this->expiry = strtotime( $this->expiry );
-                       if ( $this->expiry < 0 || $this->expiry === false ) {
-                               return 'stabilize_expiry_invalid';
-                       }
-                       # Convert date to MW timestamp format
-                       $this->expiry = wfTimestamp( TS_MW, $this->expiry );
-                       if ( $this->expiry < wfTimestampNow() ) {
-                               return 'stabilize_expiry_old';
-                       }
+               $expiry = $this->getExpiry();
+               if ( $reset || $expiry == 'infinite' || $expiry == 'indefinite' 
) {
+                       $expiry = Block::infinity(); // normalize to 'infinity'
+               } elseif ( $expiry === false ) {
+                       return 'stabilize_expiry_invalid';
+               } elseif ( $expiry < wfTimestampNow() ) {
+                       return 'stabilize_expiry_old';
                }
                # Update the DB row with the new config...
                $changed = $this->updateConfigRow( $reset );
@@ -299,10 +333,11 @@
                } else {
                        FlaggedRevs::clearTrackingRows( $article->getId() );
                }
+               $reason = $this->getReason();
                # Insert stability log entry...
                $log = new LogPage( 'stable' );
                if ( $reset ) {
-                       $log->addEntry( 'reset', $this->page, $this->reason );
+                       $log->addEntry( 'reset', $this->page, $reason );
                        $type = "stable-logentry-reset";
                        $settings = ''; // no level, expiry info
                } else {
@@ -310,7 +345,7 @@
                        $action = ( $this->oldConfig === 
FlaggedRevs::getDefaultVisibilitySettings() )
                                ? 'config' // set a custom configuration
                                : 'modify'; // modified an existing custom 
configuration
-                       $log->addEntry( $action, $this->page, $this->reason,
+                       $log->addEntry( $action, $this->page, $reason,
                                FlaggedRevsLogs::collapseParams( $params ) );
                        $type = "stable-logentry-config";
                        // Settings message in text form (e.g. [x=a,y=b,z])
@@ -319,8 +354,8 @@
                # Build null-edit comment...<action: reason [settings] (expiry)>
                $comment = $wgContLang->ucfirst(
                        wfMsgForContent( $type, $this->page->getPrefixedText() 
) ); // action
-               if ( $this->reason != '' ) {
-                       $comment .= wfMsgForContent( 'colon-separator' ) . 
$this->reason; // add reason
+               if ( $reason != '' ) {
+                       $comment .= wfMsgForContent( 'colon-separator' ) . 
$reason; // add reason
                }
                if ( $settings != '' ) {
                        $comment .= " {$settings}"; // add settings
@@ -365,30 +400,6 @@
                }
        }
 
-       protected function loadExpiry() {
-               # Custom expiry replaces dropdown
-               if ( $this->expiry == '' ) {
-                       $this->expiry = $this->expirySelection;
-                       if ( $this->expiry == 'existing' ) {
-                               $this->expiry = $this->oldExpiry;
-                       }
-               }
-       }
-
-       protected function loadReason() {
-               # Custom reason replaces dropdown
-               if ( $this->reasonSelection != 'other' ) {
-                       $comment = $this->reasonSelection; // start with 
dropdown reason
-                       if ( $this->reason != '' ) {
-                               # Append custom reason
-                               $comment .= wfMsgForContent( 'colon-separator' 
) . $this->reason;
-                       }
-               } else {
-                       $comment = $this->reason; // just use custom reason
-               }
-               $this->reason = $comment;
-       }
-
        // Same JS used for expiry for either $wgFlaggedRevsProtection case
        public static function addProtectionJS() {
                global $wgOut;
@@ -426,15 +437,11 @@
        protected function reallyPreloadSettings() {
                $this->override = $this->oldConfig['override'];
                $this->autoreview = $this->oldConfig['autoreview'];
-               $this->expiry = $this->oldExpiry;
-               $this->expirySelection = 'existing';
                $this->watchThis = $this->page->userIsWatching();
                return true;
        }
 
        protected function reallyCheckSettings() {
-               $this->loadReason();
-               $this->loadExpiry();
                $this->override = $this->override ? 1 : 0; // default version 
settings is 0 or 1
                // Check autoreview restriction setting
                if ( $this->autoreview != '' // restriction other than 'none'
@@ -452,7 +459,7 @@
                return array(
                        'override'   => $this->override,
                        'autoreview' => $this->autoreview,
-                       'expiry'     => $this->expiry, // TS_MW/infinity
+                       'expiry'     => $this->getExpiry(), // TS_MW/infinity
                        'precedence' => 1 // here for log hook b/c
                );
        }
@@ -478,7 +485,7 @@
                        $changed = ( $dbw->affectedRows() != 0 ); // did this 
do anything?
                # Otherwise, add/replace row if we are not just setting it to 
the site default
                } elseif ( !$reset ) {
-                       $dbExpiry = Block::encodeExpiry( $this->expiry, $dbw );
+                       $dbExpiry = Block::encodeExpiry( $this->getExpiry(), 
$dbw );
                        # Get current config...
                        $oldRow = $dbw->selectRow( 'flaggedpage_config',
                                array( 'fpc_select', 'fpc_override', 
'fpc_level', 'fpc_expiry' ),
@@ -528,8 +535,6 @@
 class PageStabilityProtectForm extends PageStabilityForm {
        protected function reallyPreloadSettings() {
                $this->autoreview = $this->oldConfig['autoreview']; // protect 
level
-               $this->expiry = $this->oldExpiry;
-               $this->expirySelection = 'existing';
                $this->watchThis = $this->page->userIsWatching();
                return true;
        }
@@ -539,7 +544,7 @@
                global $wgFlaggedRevsProtectQuota;
                if ( isset( $wgFlaggedRevsProtectQuota ) // quota exists
                        && $this->autoreview != '' // and we are protecting
-                       && FlaggedRevs::getProtectionLevel( $this->oldConfig ) 
== 'none' ) // and page is unprotected
+                       && FlaggedRevs::getProtectionLevel( $this->oldConfig ) 
== 'none' ) // page unprotected
                {
                        $dbw = wfGetDB( DB_MASTER );
                        $count = $dbw->selectField( 'flaggedpage_config', 
'COUNT(*)', '', __METHOD__ );
@@ -547,8 +552,6 @@
                                return 'stabilize_protect_quota';
                        }
                }
-               $this->loadReason();
-               $this->loadExpiry();
                # Autoreview only when protecting currently unprotected pages
                $this->reviewThis = ( FlaggedRevs::getProtectionLevel( 
$this->oldConfig ) == 'none' );
                # Autoreview restriction => use stable
@@ -576,7 +579,7 @@
                return array(
                        'override'   => $this->override, // in case of site 
changes
                        'autoreview' => $this->autoreview,
-                       'expiry'     => $this->expiry // TS_MW/infinity
+                       'expiry'     => $this->getExpiry() // TS_MW/infinity
                );
        }
 
@@ -592,7 +595,7 @@
                        $changed = ( $dbw->affectedRows() != 0 ); // did this 
do anything?
                # Otherwise, add/replace row if we are not just setting it to 
the site default
                } elseif ( !$reset ) {
-                       $dbExpiry = Block::encodeExpiry( $this->expiry, $dbw );
+                       $dbExpiry = Block::encodeExpiry( $this->getExpiry(), 
$dbw );
                        # Get current config...
                        $oldRow = $dbw->selectRow( 'flaggedpage_config',
                                array( 'fpc_override', 'fpc_level', 
'fpc_expiry' ),

Modified: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
===================================================================
--- trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php    
2011-02-26 02:50:20 UTC (rev 82831)
+++ trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php    
2011-02-26 03:04:59 UTC (rev 82832)
@@ -52,10 +52,10 @@
                # Get auto-review option...
                $form->setReviewThis( $wgRequest->getBool( 'wpReviewthis', true 
) );
                # Reason
-               $form->setReason( $wgRequest->getText( 'wpReason' ) );
+               $form->setReasonExtra( $wgRequest->getText( 'wpReason' ) );
                $form->setReasonSelection( $wgRequest->getVal( 
'wpReasonSelection' ) );
                # Expiry
-               $form->setExpiry( $wgRequest->getText( 'mwStabilize-expiry' ) );
+               $form->setExpiryCustom( $wgRequest->getText( 
'mwStabilize-expiry' ) );
                $form->setExpirySelection( $wgRequest->getVal( 
'wpExpirySelection' ) );
                # Default version
                $form->setOverride( (int)$wgRequest->getBool( 
'wpStableconfig-override' ) );
@@ -106,44 +106,50 @@
                        $s .= wfMsgExt( 'stabilization-text', 'parse', 
$title->getPrefixedText() );
                }
                # Borrow some protection messages for dropdowns
-               $reasonDropDown = Xml::listDropDown( 'wpReasonSelection',
+               $reasonDropDown = Xml::listDropDown(
+                       'wpReasonSelection',
                        wfMsgForContent( 'protect-dropdown' ),
                        wfMsgForContent( 'protect-otherreason-op' ),
                        $form->getReasonSelection(),
-                       'mwStabilize-reason', 4
+                       'mwStabilize-reason',
+                       4
                );
                $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' );
                $showProtectOptions = ( $scExpiryOptions !== '-' && 
$form->isAllowed() );
-               # Add the current expiry as an option
-               $expiryFormOptions = '';
-               if ( $oldConfig['expiry'] && $oldConfig['expiry'] != 'infinity' 
) {
+               $dropdownOptions = array(); // array of <label,value>
+               # Add the current expiry as a dropdown option
+               if ( $oldConfig['expiry'] && $oldConfig['expiry'] != 
Block::infinity() ) {
                        $timestamp = $wgLang->timeanddate( $oldConfig['expiry'] 
);
                        $d = $wgLang->date( $oldConfig['expiry'] );
                        $t = $wgLang->time( $oldConfig['expiry'] );
-                       $expiryFormOptions .=
-                               Xml::option(
-                                       wfMsg( 'protect-existing-expiry', 
$timestamp, $d, $t ),
-                                       'existing',
-                                       $oldConfig['expiry'] == 'existing'
-                               ) . "\n";
+                       $dropdownOptions[] = array(
+                               wfMsg( 'protect-existing-expiry', $timestamp, 
$d, $t ), 'existing' );
                }
-               $expiryFormOptions .= Xml::option( wfMsg( 
'protect-othertime-op' ), "othertime" ) . "\n";
-               # Add custom levels (from MediaWiki message)
-               foreach ( explode( ',', $scExpiryOptions ) as $option ) {
+               # Add "other time" expiry dropdown option
+               $dropdownOptions[] = array( wfMsg( 'protect-othertime-op' ), 
'othertime' );
+               # Add custom expiry dropdown options (from MediaWiki message)
+               foreach( explode( ',', $scExpiryOptions ) as $option ) {
                        if ( strpos( $option, ":" ) === false ) {
                                $show = $value = $option;
                        } else {
                                list( $show, $value ) = explode( ":", $option );
                        }
-                       $show = htmlspecialchars( $show );
-                       $value = htmlspecialchars( $value );
-                       $expiryFormOptions .= Xml::option( $show, $value, 
$oldConfig['expiry'] === $value );
-                       $expiryFormOptions .= "\n";
+                       $dropdownOptions[] = array( $show, $value );
                }
+               
+               # Actually build the options HTML...
+               $expiryFormOptions = '';
+               foreach ( $dropdownOptions as $option ) {
+                       $show = htmlspecialchars( $option[0] );
+                       $value = htmlspecialchars( $option[1] );
+                       $expiryFormOptions .= Xml::option( $show, $value,
+                               $form->getExpirySelection() === $value ) . "\n";
+               }
+
+               # Build up the form...
+               $s .= Xml::openElement( 'form', array( 'name' => 
'stabilization',
+                       'action' => $this->getTitle()->getLocalUrl(), 'method' 
=> 'post' ) );
                # Add stable version override and selection options
-               $special = SpecialPage::getTitleFor( 'Stabilization' );
-               $s .= Xml::openElement( 'form', array( 'name' => 
'stabilization',
-                               'action' => $special->getLocalUrl(), 'method' 
=> 'post' ) );
                $s .=
                        Xml::fieldset( wfMsg( 'stabilization-def' ), false ) . 
"\n" .
                        Xml::radioLabel( wfMsg( 'stabilization-def1' ), 
'wpStableconfig-override', 1,
@@ -159,12 +165,13 @@
 
                        Xml::fieldset( wfMsg( 'stabilization-leg' ), false ) .
                        Xml::openElement( 'table' );
-               # Add expiry dropdown
+               # Add expiry dropdown to form...
                if ( $showProtectOptions && $form->isAllowed() ) {
                        $s .= "
                                <tr>
                                        <td class='mw-label'>" .
-                                               Xml::label( wfMsg( 
'stabilization-expiry' ), 'mwStabilizeExpirySelection' ) .
+                                               Xml::label( wfMsg( 
'stabilization-expiry' ),
+                                                       
'mwStabilizeExpirySelection' ) .
                                        "</td>
                                        <td class='mw-input'>" .
                                                Xml::tags( 'select',
@@ -177,18 +184,16 @@
                                        "</td>
                                </tr>";
                }
-               # Add custom expiry field
+               # Add custom expiry field to form...
                $attribs = array( 'id' => "mwStabilizeExpiryOther",
                        'onkeyup' => 'onFRChangeExpiryField()' ) + 
$this->disabledAttr();
-               $formExpiry = $form->getExpiry() ?
-                       $form->getExpiry() : $form->getOldExpiryGMT();
                $s .= "
                        <tr>
                                <td class='mw-label'>" .
                                        Xml::label( wfMsg( 
'stabilization-othertime' ), 'mwStabilizeExpiryOther' ) .
                                '</td>
                                <td class="mw-input">' .
-                                       Xml::input( "mwStabilize-expiry", 50, 
$formExpiry, $attribs ) .
+                                       Xml::input( "mwStabilize-expiry", 50, 
$form->getExpiryCustom(), $attribs ) .
                                '</td>
                        </tr>';
                # Add comment input and submit button
@@ -213,7 +218,8 @@
                                                Xml::label( wfMsg( 
'stabilization-otherreason' ), 'wpReason' ) .
                                        '</td>
                                        <td class="mw-input">' .
-                                               Xml::input( 'wpReason', 70, 
$form->getReason(), array( 'id' => 'wpReason' ) ) .
+                                               Xml::input( 'wpReason', 70, 
$form->getReasonExtra(),
+                                                       array( 'id' => 
'wpReason' ) ) .
                                        '</td>
                                </tr>
                                <tr>
@@ -246,7 +252,8 @@
 
                $wgOut->addHTML( Xml::element( 'h2', null,
                        htmlspecialchars( LogPage::logName( 'stable' ) ) ) );
-               LogEventsList::showLogExtract( $wgOut, 'stable', 
$title->getPrefixedText() );
+               LogEventsList::showLogExtract( $wgOut, 'stable',
+                       $title->getPrefixedText(), '', array( 'lim' => 25 ) );
 
                # Add some javascript for expiry dropdowns
                PageStabilityForm::addProtectionJS();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to