Extension:ProtectedNotice

Description
Dumb users do not understand why some pages aren't editable for them, this extension let you adding a clear notice that will appear on head of each protected page.

Download and Installation Instructions
require_once("$IP/extensions/ProtectedNotice/ProtectedNotice.php");
 * The extension can be downloaded from here : or copied from end of this doc.
 * Extract the tarball in your extension directory or create a dir called ProtectedNotice and save the file there.
 * Add this line to your LocalSettings.php:

Usage

 * Create the page MediaWiki:protected-notice and put there your text for the notice.
 * Now you will see the text that you entered on previous step on each protected page.
 * if you will put the following "code" in this page - you will get a nice white on red notice.
 * {| cellspacing="5" cellpadding="0" style="margin:0em 0em 1em 0em; border:1px solid #1DA0E7; background:#FF0033;width:100%"
 * |  This is a Protected Page - You can't edit it! 
 * |}

License
This Piece of code is Under Gnu Public License.

The extension itself
<?php /** * ProtectedNotice extension - lets you define a fixed header * * Protected notice is maintained as MediaWiki-messages. * MediaWiki:protected-notice * * For more info see * http://mediawiki.org/wiki/Extension:ProtectedNotice * * @package MediaWiki * @subpackage Extensions * @author Yedidia Klein yedidia@atarplpl.co.il * @copyright Yedidia Klein * @license GNU General Public License 2.0 or later */

if( !defined( 'MEDIAWIKI' ) ) { echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); die( 1 ); }

$wgExtensionCredits['other'][] = array(       'name' => 'ProtectedNotice',        'author' => 'Yedidia Klein',        'url' => 'http://mediawiki.org/wiki/Extension:ProtectedNotice',        'description' => 'lets you define a fixed header for protected pages.', );

$wgHooks['OutputPageBeforeHTML'][] = 'wfProtectedNoticeHook';

function wfProtectedNoticeHook( &$out, &$text ) { global $wgTitle, $wgParser;

$opt = array(               'parseinline',        );

if ($wgTitle->isProtected) { $header = wfMsgExt("protected-notice", $opt); }

if (!wfEmptyMsg("protected-notice", $header)) $text = " $header \n$text";

return true; } ?>