Extension:NoViewSource.php
<?php
- Extension:NoViewSource
- - Licenced under LGPL (http://www.gnu.org/copyleft/lesser.html)
- - Author: User:NadCategory:Extensions created with Template:Extension
if (!defined('MEDIAWIKI')) die('Not an entry point.');
define('NOVIEWSOURCE_VERSION','1.0.0, 2007-12-13');
$wgExtensionFunctions[] = 'wfSetupNoViewSource'; $wgHooks['LanguageGetMagic'][] = 'wfNoViewSourceLanguageGetMagic'; $wgHooks['SkinTemplateTabs'][] = 'wfNoViewSourceUpdateActions'; $wgExtensionCredits['other'][] = array( 'name' => 'NoViewSource', 'author' => 'User:Nad', 'description' => 'Replaces the "view source" action with "edit" which links to login page.', 'url' => 'http://www.organicdesign.co.nz/Extension:NoViewSource.php', 'version' => NOVIEWSOURCE_VERSION );
- EditPage.php/edit() changed after 1.8
- OutputPage.php/readOnlyPage() renders source
- SkinTemplate.php/buildContentActionUrls()
function wfNoViewSourceUpdateActions(&$skin,&$actions) { global $wgTitle,$wgXmlOutputTitle; $url = Title::makeTitle(NS_SPECIAL,$wgXmlOutputTitle); $url = $url->getLocalUrl().'/'.$wgTitle->getPrefixedText(); if (isset($actions['viewsource'])) { $actions['viewsource']['text'] = wfMsg('edit'), $actions['viewsource']['href'] = $this->mTitle->getLocalUrl( $this->editUrlOptions() ) return true; }