Turning on $wgUploadMaintenance will disable deletion and undeletion of images; useful when performing maintenance on file servers to ensure that nobody's messing with your data while you work.
Note that $wgEnableUploads really should be disabled too or it'll be a bit silly. ;)
Could use localization and other polishing.
* Note that this requires JS2 and the script loader.
*/
$wgUseAJAXCategories = false;
+
+// to disable image delete/restore temporarily
+$wgUploadMaintenance = false;
* Delete the file, or an earlier version of it
*/
public function delete() {
+ global $wgUploadMaintenance;
+ if( $wgUploadMaintenance && $this->mTitle && $this->mTitle->getNamespace() == NS_FILE ) {
+ global $wgOut;
+ $wgOut->addWikiText('Deletion and restoration of images temporarily disabled during maintenance.' );
+ return;
+ }
+
$this->loadFile();
if( !$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected() ) {
// Standard article deletion
}
}
if( $this->mRestore && $this->mAction == "submit" ) {
+ global $wgUploadMaintenance;
+ if( $wgUploadMaintenance && $this->mTargetObj && $this->mTargetObj->getNamespace() == NS_FILE ) {
+ $wgOut->addWikiText('Deletion and restoration of images temporarily disabled during maintenance.' );
+ return;
+ }
return $this->undelete();
}
if( $this->mInvert && $this->mAction == "submit" ) {