X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialLockdb.php;h=2d087ca4f49cb7bcf6fc984c6523251921e8d1de;hb=f4d222850da05826f0c7502a9ff300d525f927dc;hp=0d495a00cfcfb1d31b53b639bb517c80b1dea19a;hpb=a7f35b785943ecf471095e79bc907aa5bbe228ca;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialLockdb.php b/includes/specials/SpecialLockdb.php index 0d495a00cf..2d087ca4f4 100644 --- a/includes/specials/SpecialLockdb.php +++ b/includes/specials/SpecialLockdb.php @@ -34,7 +34,7 @@ class SpecialLockdb extends FormSpecialPage { } public function doesWrites() { - return true; + return false; } public function requiresWrite() { @@ -47,27 +47,30 @@ class SpecialLockdb extends FormSpecialPage { if ( !is_writable( dirname( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) ) { throw new ErrorPageError( 'lockdb', 'lockfilenotwritable' ); } + if ( file_exists( $this->getConfig()->get( 'ReadOnlyFile' ) ) ) { + throw new ErrorPageError( 'lockdb', 'databaselocked' ); + } } protected function getFormFields() { - return array( - 'Reason' => array( + return [ + 'Reason' => [ 'type' => 'textarea', 'rows' => 4, 'vertical-label' => true, 'label-message' => 'enterlockreason', - ), - 'Confirm' => array( + ], + 'Confirm' => [ 'type' => 'toggle', 'label-message' => 'lockconfirm', - ), - ); + ], + ]; } protected function alterForm( HTMLForm $form ) { - $form->setWrapperLegend( false ); - $form->setHeaderText( $this->msg( 'lockdbtext' )->parseAsBlock() ); - $form->setSubmitTextMsg( 'lockbtn' ); + $form->setWrapperLegend( false ) + ->setHeaderText( $this->msg( 'lockdbtext' )->parseAsBlock() ) + ->setSubmitTextMsg( 'lockbtn' ); } public function onSubmit( array $data ) { @@ -105,6 +108,10 @@ class SpecialLockdb extends FormSpecialPage { $out->addWikiMsg( 'lockdbsuccesstext' ); } + protected function getDisplayFormat() { + return 'ooui'; + } + protected function getGroupName() { return 'wiki'; }