Extension:HideEditOnPreview
![]() | This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net . |
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
![]() Release status: unmaintained |
|
---|---|
Implementation | Page action |
Description | Hides the edit-link (tab) in preview mode |
Author(s) | Hendrik Brummermanntalk |
Latest version | 1.1 |
MediaWiki | 1.17 |
License | CC BY, GPL |
Download | see below |
This extension hides the edit-link on the edit page. Some user tend to click it to return from the preview page to the edit window instead of scrolling down. Unfortunatally this causes their edits to be lost. So this extensions hides that link.
Installation[edit]
- Copy HideEditOnPreview.php and place the file(s) in a directory called
HideEditOnPreview
in yourextensions/
folder. - Add the following code at the bottom of your
LocalSettings.php
:require_once "$IP/extensions/HideEditOnPreview/HideEditOnPreview.php";
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Source code[edit]
<?php
/**
* Hides the edit-link (tab) in preview mode because user click on it to return
* to the edit box. It will, however, reload the edit box destroying all unsaved
* changes.
*
* Installation: Copy HideEditOnPreview.php to your extension folder and add
* require_once($IP."/extensions/HideEditOnPreview.php");
* to your LocalSettings.php
*
* @author Hendrik Brummermann
* @version 1.1
*/
$wgHooks['SkinTemplateContentActions'][] = 'hideEditOnPreview';
function hideEditOnPreview($actions) {
global $wgRequest;
if ( $wgRequest->getVal('action') == 'submit' ) {
unset($actions['edit']);
}
return true;
}
$wgExtensionCredits['other'][] = array(
'name' => 'HideEditOnPreview',
'version' => '1.1',
'author' => 'Hendrik Brummermann',
'url' => 'http://mediawiki.org/wiki/Extension:HideEditOnPreview',
'description' => 'Hides the edit-link (tab) in preview mode'
);
?>