X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=4cad7b745ae4d668ecb3ddc716d4ab252df49c32;hb=192f1018e45095580c39b0894a03a9428994b139;hp=69b64dd62bd5915295af258782d63127d0014d68;hpb=c5c5a901148edc3acccc70b73917637dfa7ae250;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 69b64dd62b..4cad7b745a 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -384,7 +384,12 @@ class ProtectionForm { "mwProtect-$action-expires" ); - $expiryFormOptions = ''; + $expiryFormOptions = new XmlSelect( "wpProtectExpirySelection-$action", "mwProtectExpirySelection-$action", $this->mExpirySelection[$action] ); + $expiryFormOptions->setAttribute( 'tabindex', '2' ); + if ( $this->disabled ) { + $expiryFormOptions->setAttribute( 'disabled', 'disabled' ); + } + if ( $this->mExistingExpiry[$action] ) { if ( $this->mExistingExpiry[$action] == 'infinity' ) { $existingExpiryMessage = $context->msg( 'protect-existing-expiry-infinity' ); @@ -394,29 +399,17 @@ class ProtectionForm { $t = $lang->userTime( $this->mExistingExpiry[$action], $user ); $existingExpiryMessage = $context->msg( 'protect-existing-expiry', $timestamp, $d, $t ); } - $expiryFormOptions .= - Xml::option( - $existingExpiryMessage->text(), - 'existing', - $this->mExpirySelection[$action] == 'existing' - ) . "\n"; + $expiryFormOptions->addOption( $existingExpiryMessage->text(), 'existing' ); } - $expiryFormOptions .= Xml::option( - $context->msg( 'protect-othertime-op' )->text(), - "othertime" - ) . "\n"; + $expiryFormOptions->addOption( $context->msg( 'protect-othertime-op' )->text(), 'othertime' ); foreach ( explode( ',', $scExpiryOptions ) as $option ) { if ( strpos( $option, ":" ) === false ) { $show = $value = $option; } else { list( $show, $value ) = explode( ":", $option ); } - $expiryFormOptions .= Xml::option( - $show, - htmlspecialchars( $value ), - $this->mExpirySelection[$action] === $value - ) . "\n"; + $expiryFormOptions->addOption( $show, htmlspecialchars( $value ) ); } # Add expiry dropdown if ( $showProtectOptions && !$this->disabled ) { @@ -426,12 +419,7 @@ class ProtectionForm { {$mProtectexpiry}