Extension:HideEditOnPreview

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
HideEditOnPreview

Release status: stable

Implementation Page action
Description Hides the edit-link (tab) in preview mode
Author(s) Hendrik BrummermannTalk
Last version 1.1
License CC-BY, GPL
Download see below

Check usage (experimental)

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.


[edit] Installation

Installation: Copy the code under "source code" and save it as HideEditOnPreview.php and add that file to your extension folder the following to LocalSettings.php:

require_once($IP."/extensions/HideEditOnPreview.php");

[edit] Source code

<?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'
);
 
?>
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox