Remove externaledit/externaldiff preference
authorChad Horohoe <chadh@wikimedia.org>
Thu, 11 Apr 2013 13:20:36 +0000 (09:20 -0400)
committerChad Horohoe <chadh@wikimedia.org>
Thu, 11 Apr 2013 13:20:36 +0000 (09:20 -0400)
Change-Id: Ic3791d188688f556753ab5556a4d9733bbf2e85e

RELEASE-NOTES-1.22
includes/AutoLoader.php
includes/DefaultSettings.php
includes/ExternalEdit.php [deleted file]
includes/ImagePage.php
includes/Preferences.php
includes/actions/EditAction.php
includes/diff/DifferenceEngine.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index c24cd7d..5bfc519 100644 (file)
@@ -49,6 +49,8 @@ changes to languages because of Bugzilla reports.
   use AuthPlugin for external authentication/authorization needs.
 * The Quickbar feature of the legacy skin model and the last remnants of it
   throughout the code base have been removed.
+* Externaledit/externaldiff preference was removed. Very few users used this
+  feature, and improper configuration can actually prevent a user from editing
 
 == Compatibility ==
 
index 33a244b..7d6b832 100644 (file)
@@ -90,7 +90,6 @@ $wgAutoloadLocalClasses = array(
        'EnhancedChangesList' => 'includes/ChangesList.php',
        'ErrorPageError' => 'includes/Exception.php',
        'ExplodeIterator' => 'includes/StringUtils.php',
-       'ExternalEdit' => 'includes/ExternalEdit.php',
        'ExternalStore' => 'includes/externalstore/ExternalStore.php',
        'ExternalStoreDB' => 'includes/externalstore/ExternalStoreDB.php',
        'ExternalStoreHttp' => 'includes/externalstore/ExternalStoreHttp.php',
index 7b6e9a7..37a1533 100644 (file)
@@ -3647,8 +3647,6 @@ $wgDefaultUserOptions = array(
        'enotifusertalkpages' => 1,
        'enotifwatchlistpages' => 0,
        'extendwatchlist' => 0,
-       'externaldiff' => 0,
-       'externaleditor' => 0,
        'fancysig' => 0,
        'forceeditsummary' => 0,
        'gender' => 'unknown',
@@ -4930,12 +4928,6 @@ $wgPreviewOnOpenNamespaces = array(
        NS_CATEGORY => true
 );
 
-/**
- * Activate external editor interface for files and pages
- * See http://www.mediawiki.org/wiki/Manual:External_editors
- */
-$wgUseExternalEditor = true;
-
 /** Go button goes straight to the edit screen if the article doesn't exist. */
 $wgGoToEdit = false;
 
diff --git a/includes/ExternalEdit.php b/includes/ExternalEdit.php
deleted file mode 100644 (file)
index 11e9423..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-/**
- * External editors support
- *
- * License: Public domain
- *
- * @file
- * @author Erik Moeller <moeller@scireview.de>
- */
-
-/**
- * Support for external editors to modify both text and files
- * in external applications. It works as follows: MediaWiki
- * sends a meta-file with the MIME type 'application/x-external-editor'
- * to the client. The user has to associate that MIME type with
- * a helper application (a reference implementation in Perl
- * can be found in extensions/ee), which will launch the editor,
- * and save the modified data back to the server.
- *
- */
-class ExternalEdit extends ContextSource {
-
-       /**
-        * Array of URLs to link to
-        * @var Array
-        */
-       private $urls;
-
-       /**
-        * Constructor
-        * @param $context IContextSource context to use
-        * @param $urls array
-        */
-       public function __construct( IContextSource $context, array $urls = array() ) {
-               $this->setContext( $context );
-               $this->urls = $urls;
-       }
-
-       /**
-        * Check whether external edit or diff should be used.
-        *
-        * @param $context IContextSource context to use
-        * @param string $type can be either 'edit' or 'diff'
-        * @return Bool
-        */
-       public static function useExternalEngine( IContextSource $context, $type ) {
-               global $wgUseExternalEditor;
-
-               if ( !$wgUseExternalEditor ) {
-                       return false;
-               }
-
-               $pref = $type == 'diff' ? 'externaldiff' : 'externaleditor';
-               $request = $context->getRequest();
-
-               return !$request->getVal( 'internaledit' ) &&
-                       ( $context->getUser()->getOption( $pref ) || $request->getVal( 'externaledit' ) );
-       }
-
-       /**
-        * Output the information for the external editor
-        */
-       public function execute() {
-               global $wgContLang, $wgScript, $wgScriptPath, $wgCanonicalServer;
-
-               $this->getOutput()->disable();
-
-               $response = $this->getRequest()->response();
-               $response->header( 'Content-type: application/x-external-editor; charset=utf-8' );
-               $response->header( 'Cache-control: no-cache' );
-
-               $special = $wgContLang->getNsText( NS_SPECIAL );
-
-               # $type can be "Edit text", "Edit file" or "Diff text" at the moment
-               # See the protocol specifications at [[m:Help:External editors/Tech]] for
-               # details.
-               if ( count( $this->urls ) ) {
-                       $urls = $this->urls;
-                       $type = "Diff text";
-               } elseif ( $this->getRequest()->getVal( 'mode' ) == 'file' ) {
-                       $type = "Edit file";
-                       $image = wfLocalFile( $this->getTitle() );
-                       if ( $image ) {
-                               $urls = array(
-                                       'File' => array(
-                                               'Extension' => $image->getExtension(),
-                                               'URL' => $image->getCanonicalURL()
-                                       )
-                               );
-                       } else {
-                               $urls = array();
-                       }
-               } else {
-                       $type = "Edit text";
-                       # *.wiki file extension is used by some editors for syntax
-                       # highlighting, so we follow that convention
-                       $urls = array( 'File' => array(
-                               'Extension' => 'wiki',
-                               'URL' => $this->getTitle()->getCanonicalURL(
-                                       array( 'action' => 'edit', 'internaledit' => 'true' ) )
-                       ) );
-               }
-
-               $files = '';
-               foreach( $urls as $key => $vars ) {
-                       $files .= "\n[$key]\n";
-                       foreach( $vars as $varname => $varval ) {
-                               $files .= "$varname=$varval\n";
-                       }
-               }
-
-               $url = $this->getTitle()->getFullURL(
-                       $this->getRequest()->appendQueryValue( 'internaledit', 1, true ) );
-
-               $control = <<<CONTROL
-; You're seeing this file because you're using Mediawiki's External Editor feature.
-; This is probably because you selected use external editor in your preferences.
-; To edit normally, either disable that preference or go to the URL:
-; $url
-; See http://www.mediawiki.org/wiki/Manual:External_editors for details.
-[Process]
-Type=$type
-Engine=MediaWiki
-Script={$wgCanonicalServer}{$wgScript}
-Server={$wgCanonicalServer}
-Path={$wgScriptPath}
-Special namespace=$special
-$files
-CONTROL;
-               echo $control;
-       }
-}
index b5b69df..5e51878 100644 (file)
@@ -631,7 +631,7 @@ EOT
         * external editing (and instructions link) etc.
         */
        protected function uploadLinksBox() {
-               global $wgEnableUploads, $wgUseExternalEditor;
+               global $wgEnableUploads;
 
                if ( !$wgEnableUploads ) {
                        return;
@@ -654,25 +654,6 @@ EOT
                        $out->addHTML( "<li id=\"mw-imagepage-upload-disallowed\">" . $this->getContext()->msg( 'upload-disallowed-here' )->escaped() . "</li>\n" );
                }
 
-               # External editing link
-               if ( $wgUseExternalEditor ) {
-                       $elink = Linker::linkKnown(
-                               $this->getTitle(),
-                               wfMessage( 'edit-externally' )->escaped(),
-                               array(),
-                               array(
-                                       'action' => 'edit',
-                                       'externaledit' => 'true',
-                                       'mode' => 'file'
-                               )
-                       );
-                       $out->addHTML(
-                               '<li id="mw-imagepage-edit-external">' . $elink . ' <small>' .
-                                       wfMessage( 'edit-externally-help' )->parse() .
-                                       "</small></li>\n"
-                       );
-               }
-
                $out->addHTML( "</ul>\n" );
        }
 
index 8766ad3..33780a4 100644 (file)
@@ -721,7 +721,7 @@ class Preferences {
         * @param $defaultPreferences Array
         */
        static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
-               global $wgUseExternalEditor, $wgAllowUserCssPrefs;
+               global $wgAllowUserCssPrefs;
 
                ## Editing #####################################
                $defaultPreferences['cols'] = array(
@@ -794,19 +794,6 @@ class Preferences {
                        );
                }
 
-               if ( $wgUseExternalEditor ) {
-                       $defaultPreferences['externaleditor'] = array(
-                               'type' => 'toggle',
-                               'section' => 'editing/advancedediting',
-                               'label-message' => 'tog-externaleditor',
-                       );
-                       $defaultPreferences['externaldiff'] = array(
-                               'type' => 'toggle',
-                               'section' => 'editing/advancedediting',
-                               'label-message' => 'tog-externaldiff',
-                       );
-               }
-
                $defaultPreferences['forceeditsummary'] = array(
                        'type' => 'toggle',
                        'section' => 'editing/advancedediting',
index dec3d84..3dd4c48 100644 (file)
@@ -43,21 +43,11 @@ class EditAction extends FormlessAction {
 
        public function show() {
                $page = $this->page;
-               $request = $this->getRequest();
                $user = $this->getUser();
-               $context = $this->getContext();
 
                if ( wfRunHooks( 'CustomEditor', array( $page, $user ) ) ) {
-                       if ( ExternalEdit::useExternalEngine( $context, 'edit' )
-                               && $this->getName() == 'edit' && !$request->getVal( 'section' )
-                               && !$request->getVal( 'oldid' ) )
-                       {
-                               $extedit = new ExternalEdit( $context );
-                               $extedit->execute();
-                       } else {
-                               $editor = new EditPage( $page );
-                               $editor->edit();
-                       }
+                       $editor = new EditPage( $page );
+                       $editor->edit();
                }
 
        }
index d03a5be..a69862d 100644 (file)
@@ -223,33 +223,6 @@ class DifferenceEngine extends ContextSource {
                        throw new PermissionsError( 'read', $permErrors );
                }
 
-               # If external diffs are enabled both globally and for the user,
-               # we'll use the application/x-external-editor interface to call
-               # an external diff tool like kompare, kdiff3, etc.
-               if ( ExternalEdit::useExternalEngine( $this->getContext(), 'diff' ) ) {
-                       //TODO: come up with a good solution for non-text content here.
-                       //      at least, the content format needs to be passed to the client somehow.
-                       //      Currently, action=raw will just fail for non-text content.
-
-                       $urls = array(
-                               'File' => array( 'Extension' => 'wiki', 'URL' =>
-                                       # This should be mOldPage, but it may not be set, see below.
-                                       $this->mNewPage->getCanonicalURL( array(
-                                               'action' => 'raw', 'oldid' => $this->mOldid ) )
-                               ),
-                               'File2' => array( 'Extension' => 'wiki', 'URL' =>
-                                       $this->mNewPage->getCanonicalURL( array(
-                                               'action' => 'raw', 'oldid' => $this->mNewid ) )
-                               ),
-                       );
-
-                       $externalEditor = new ExternalEdit( $this->getContext(), $urls );
-                       $externalEditor->execute();
-
-                       wfProfileOut( __METHOD__ );
-                       return;
-               }
-
                $rollback = '';
                $undoLink = '';
 
index 76dba58..db071e3 100644 (file)
@@ -666,8 +666,6 @@ XHTML id names.
 'tog-shownumberswatching'     => 'Show the number of watching users',
 'tog-oldsig'                  => 'Existing signature:',
 'tog-fancysig'                => 'Treat signature as wikitext (without an automatic link)',
-'tog-externaleditor'          => 'Use external editor by default (for experts only, needs special settings on your computer. [//www.mediawiki.org/wiki/Manual:External_editors More information.])',
-'tog-externaldiff'            => 'Use external diff by default (for experts only, needs special settings on your computer. [//www.mediawiki.org/wiki/Manual:External_editors More information.])',
 'tog-showjumplinks'           => 'Enable "jump to" accessibility links',
 'tog-uselivepreview'          => 'Use live preview (requires JavaScript) (experimental)',
 'tog-forceeditsummary'        => 'Prompt me when entering a blank edit summary',
index 1a0ff8a..1b6ba3c 100644 (file)
@@ -56,8 +56,6 @@ $wgMessageStructure = array(
                'tog-shownumberswatching',
                'tog-oldsig',
                'tog-fancysig',
-               'tog-externaleditor',
-               'tog-externaldiff',
                'tog-showjumplinks',
                'tog-uselivepreview',
                'tog-forceeditsummary',