<?php
if ( ! defined( 'MEDIAWIKI' ) )
die( 1 );
-/**
- */
/**
* @todo document
$this->addScriptFile( 'mwsuggest.js' );
}
}
+
+ if( $wgUser->getBoolOption( 'editsectiononrightclick' ) ) {
+ $this->addScriptFile( 'rightclickedit.js' );
+ }
# Buffer output; final headers may depend on later processing
*
* @param array $errors Error message keys
*/
- public function showPermissionsErrorPage( $errors )
+ public function showPermissionsErrorPage( $errors, $action = null )
{
global $wgTitle;
$this->enableClientCache( false );
$this->mRedirect = '';
$this->mBodytext = '';
- $this->addWikiText( $this->formatPermissionsErrorMessage( $errors ) );
+ $this->addWikiText( $this->formatPermissionsErrorMessage( $errors, $action ) );
}
/** @deprecated */
* @param array $errors An array of arrays returned by Title::getUserPermissionsErrors
* @return string The wikitext error-messages, formatted into a list.
*/
- public function formatPermissionsErrorMessage( $errors ) {
- $text = wfMsgNoTrans( 'permissionserrorstext', count( $errors ) ) . "\n\n";
+ public function formatPermissionsErrorMessage( $errors, $action = null ) {
+ if ($action == null) {
+ $text = wfMsgNoTrans( 'permissionserrorstext', count($errors)). "\n\n";
+ } else {
+ $action_desc = wfMsg( "right-$action" );
+ $action_desc[0] = strtolower($action_desc[0]);
+ $text = wfMsgNoTrans( 'permissionserrorstext-withaction', count($errors), $action_desc ) . "\n\n";
+ }
if (count( $errors ) > 1) {
$text .= '<ul class="permissions-errors">' . "\n";
* @param bool $protected Is this a permissions error?
* @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors().
*/
- public function readOnlyPage( $source = null, $protected = false, $reasons = array() ) {
+ public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
global $wgUser, $wgTitle;
$skin = $wgUser->getSkin();
} else {
$this->setPageTitle( wfMsg( 'badaccess' ) );
}
- $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons ) );
+ $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons, $action ) );
} else {
// Wiki is read only
$this->setPageTitle( wfMsg( 'readonly' ) );