X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=7bad8b57accab4ff0a6df316e6ec14bbfe77eb65;hb=3bf46cc4eae7fe8833a27779e6aa77fff9623871;hp=4aa65d9403334be4724944cd13e5021915948ccc;hpb=be8170b5f32dd5d9567cbda2a54ceb8437fe74bf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 4aa65d9403..7bad8b57ac 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -352,7 +352,7 @@ class ProtectionForm { $output->addJsConfigVars( 'wgCascadeableLevels', $cascadingRestrictionLevels ); $out .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->mTitle->getLocalURL( 'action=protect' ), - 'id' => 'mw-Protect-Form', 'onsubmit' => 'ProtectionForm.enableUnchainedInputs(true)' ) ); + 'id' => 'mw-Protect-Form' ) ); } $out .= Xml::openElement( 'fieldset' ) . @@ -384,13 +384,18 @@ class ProtectionForm { ); $expiryFormOptions = ''; - if ( $this->mExistingExpiry[$action] && $this->mExistingExpiry[$action] != 'infinity' ) { - $timestamp = $lang->timeanddate( $this->mExistingExpiry[$action], true ); - $d = $lang->date( $this->mExistingExpiry[$action], true ); - $t = $lang->time( $this->mExistingExpiry[$action], true ); + if ( $this->mExistingExpiry[$action] ) { + if ( $this->mExistingExpiry[$action] == 'infinity' ) { + $existingExpiryMessage = wfMessage( 'protect-existing-expiry-infinity' ); + } else { + $timestamp = $lang->timeanddate( $this->mExistingExpiry[$action], true ); + $d = $lang->date( $this->mExistingExpiry[$action], true ); + $t = $lang->time( $this->mExistingExpiry[$action], true ); + $existingExpiryMessage = wfMessage( 'protect-existing-expiry', $timestamp, $d, $t ); + } $expiryFormOptions .= Xml::option( - wfMessage( 'protect-existing-expiry', $timestamp, $d, $t )->text(), + $existingExpiryMessage->text(), 'existing', $this->mExpirySelection[$action] == 'existing' ) . "\n"; @@ -426,16 +431,13 @@ class ProtectionForm { array( 'id' => "mwProtectExpirySelection-$action", 'name' => "wpProtectExpirySelection-$action", - 'onchange' => "ProtectionForm.updateExpiryList(this)", 'tabindex' => '2' ) + $this->disabledAttrib, $expiryFormOptions ) . " "; } # Add custom expiry field - $attribs = array( 'id' => "mwProtect-$action-expires", - 'onkeyup' => 'ProtectionForm.updateExpiry(this)', - 'onchange' => 'ProtectionForm.updateExpiry(this)' ) + $this->disabledAttrib; + $attribs = array( 'id' => "mwProtect-$action-expires" ) + $this->disabledAttrib; $out .= "
" . $mProtectother . @@ -556,7 +558,6 @@ class ProtectionForm { $user->getEditToken( array( 'protect', $this->mTitle->getPrefixedDBkey() ) ) ); $out .= Xml::closeElement( 'form' ); - $output->addScript( $this->buildCleanupScript() ); } return $out; @@ -581,8 +582,7 @@ class ProtectionForm { 'id' => $id, 'name' => $id, 'size' => count( $levels ), - 'onchange' => 'ProtectionForm.updateLevels(this)', - ) + $this->disabledAttrib; + ) + $this->disabledAttrib; $out = Xml::openElement( 'select', $attribs ); foreach ( $levels as $key ) { @@ -611,19 +611,6 @@ class ProtectionForm { } } - function buildCleanupScript() { - $options = array( - 'tableId' => 'mwProtectSet', - 'labelText' => wfMessage( 'protect-unchain-permissions' )->plain(), - 'numTypes' => count( $this->mApplicableTypes ), - 'existingMatch' => count( array_unique( $this->mExistingExpiry ) ) === 1, - ); - - $script = Xml::encodeJsCall( 'ProtectionForm.init', array( $options ) ); - - return Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( $script ) ); - } - /** * Show protection long extracts for this page *