From 82d9b72bbd09d948c79c69df834573e159d38e0c Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Fri, 10 Oct 2008 01:15:11 +0000 Subject: [PATCH] * integrating UniversalEditButton extension into core (enabled by default, set $wgUniversalEditButton = false; in LocalSettings to disable) --- RELEASE-NOTES | 1 + includes/DefaultSettings.php | 7 +++++++ includes/OutputPage.php | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 30715642bf..4402fb1700 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -61,6 +61,7 @@ The following extensions are migrated into MediaWiki 1.14: * NoMoveUserPages * Special:Nuke to mass delete all pages created by a user * Poem (patch by Nathaniel Herman) +* UniversalEditButton === New features in 1.14 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e9a9a895fe..912fb8109e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3462,3 +3462,10 @@ $wgPasswordAttemptThrottle = array( 'count' => 5, 'seconds' => 300 ); * Don't bump this, instead bump the number on [[MediaWiki:Sitenotice id]] */ $wgMajorSiteNoticeID = 1; + +/** +* Enable the UniversalEditButton for browsers that support it +* (currently only Firefox with an extension) +* See http://universaleditbutton.org for more background information +*/ +$wgUniversalEditButton = true; \ No newline at end of file diff --git a/includes/OutputPage.php b/includes/OutputPage.php index c2ce99202a..e07c74b744 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -794,7 +794,8 @@ class OutputPage { global $wgUser, $wgOutputEncoding, $wgRequest; global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType; global $wgJsMimeType, $wgUseAjax, $wgAjaxWatch; - global $wgEnableMWSuggest; + global $wgEnableMWSuggest, $wgUniversalEditButton; + global $wgArticle, $wgTitle; if( $this->mDoNothing ){ return; @@ -901,6 +902,18 @@ class OutputPage { $this->addScriptFile( 'rightclickedit.js' ); } + if( $wgUniversalEditButton ) { + if( isset( $wgArticle ) && isset( $wgTitle ) && $wgTitle->quickUserCan( 'edit' ) + && ( $wgTitle->exists() || $wgTitle->quickUserCan( 'create' ) ) ) { + $this->addLink( array( + 'rel' => 'alternate', + 'type' => 'application/x-wiki', + 'title' => wfMsg( 'edit' ), + 'href' => $wgTitle->getFullURL( 'action=edit' ) + ) ); + } + } + # Buffer output; final headers may depend on later processing ob_start(); -- 2.20.1