+ /* Not all languages have V_x <-> N_x relation */
+ $msg = wfMsg( 'restriction-' . $action );
+ if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) {
+ $msg = $action;
+ }
+ $out .= "<tr><td>".
+ Xml::openElement( 'fieldset' ) .
+ Xml::element( 'legend', null, $msg ) .
+ Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) .
+ "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td></tr><tr><td>";
+
+ $reasonDropDown = Xml::listDropDown( 'wpProtectReasonSelection',
+ wfMsgForContent( 'protect-dropdown' ),
+ wfMsgForContent( 'protect-otherreason-op' ),
+ $this->mReasonSelection,
+ 'mwProtect-reason', 4 );
+ $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' );
+
+ $showProtectOptions = ($scExpiryOptions !== '-' && !$this->disabled);
+
+ $mProtectexpiry = Xml::label( wfMsg( 'protectexpiry' ), "mwProtectExpirySelection-$action" );
+ $mProtectother = Xml::label( wfMsg( 'protect-othertime' ), "mwProtect-$action-expires" );
+
+ $expiryFormOptions = '';
+ if ( $this->mExistingExpiry[$action] && $this->mExistingExpiry[$action] != 'infinity' ) {
+ $timestamp = $wgLang->timeanddate( $this->mExistingExpiry[$action] );
+ $d = $wgLang->date( $this->mExistingExpiry[$action] );
+ $t = $wgLang->time( $this->mExistingExpiry[$action] );
+ $expiryFormOptions .=
+ Xml::option(
+ wfMsg( 'protect-existing-expiry', $timestamp, $d, $t ),
+ 'existing',
+ $this->mExpirySelection[$action] == 'existing'
+ ) . "\n";
+ }
+
+ $expiryFormOptions .= Xml::option( wfMsg( 'protect-othertime-op' ), "othertime" ) . "\n";
+ 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, $this->mExpirySelection[$action] === $value ) . "\n";
+ }
+ # Add expiry dropdown
+ if( $showProtectOptions && !$this->disabled ) {
+ $out .= "
+ <table><tr>
+ <td class='mw-label'>
+ {$mProtectexpiry}
+ </td>
+ <td class='mw-input'>" .
+ Xml::tags( 'select',
+ array(
+ 'id' => "mwProtectExpirySelection-$action",
+ 'name' => "wpProtectExpirySelection-$action",
+ 'onchange' => "ProtectionForm.updateExpiryList(this)",
+ 'tabindex' => '2' ) + $this->disabledAttrib,
+ $expiryFormOptions ) .
+ "</td>
+ </tr></table>";
+ }
+ # Add custom expiry field
+ $attribs = array( 'id' => "mwProtect-$action-expires", 'onkeyup' => 'ProtectionForm.updateExpiry(this)' ) + $this->disabledAttrib;
+ $out .= "<table><tr>
+ <td class='mw-label'>" .
+ $mProtectother .
+ '</td>
+ <td class="mw-input">' .
+ Xml::input( "mwProtect-expiry-$action", 50, $this->mExpiry[$action], $attribs ) .
+ '</td>
+ </tr></table>';
+ $out .= "</td></tr>" .
+ Xml::closeElement( 'table' ) .
+ Xml::closeElement( 'fieldset' ) .
+ "</td></tr>";