* integrating UniversalEditButton extension into core (enabled by default, set $wgUni...
authorRyan Schmidt <skizzerz@users.mediawiki.org>
Fri, 10 Oct 2008 01:15:11 +0000 (01:15 +0000)
committerRyan Schmidt <skizzerz@users.mediawiki.org>
Fri, 10 Oct 2008 01:15:11 +0000 (01:15 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/OutputPage.php

index 3071564..4402fb1 100644 (file)
@@ -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 ===
 
index e9a9a89..912fb81 100644 (file)
@@ -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
index c2ce992..e07c74b 100644 (file)
@@ -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();