Followup bug #27447 and r82308 and r82328 with patch supplied by
authorMark A. Hershberger <mah@users.mediawiki.org>
Thu, 17 Feb 2011 18:41:44 +0000 (18:41 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Thu, 17 Feb 2011 18:41:44 +0000 (18:41 +0000)
Carsten Nielsen to take care of the warning and supply some
documentation.  Also fixed up language in the comments.

includes/EditPage.php

index 9db10d7..e8bfd95 100644 (file)
@@ -2256,16 +2256,19 @@ HTML
                $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
 
                /**
-
-                * toolarray an array of arrays which each include the filename of
-                * the button image (without path), the opening tag, the closing tag,
-                * and optionally a sample text that is inserted between the two when no
-                * selection is highlighted.
-                * The tip text is shown when the user moves the mouse over the button.
+                * $toolarray is an array of arrays each of which includes the
+                * filename of the button image (without path), the opening
+                * tag, the closing tag, optionally a sample text that is
+                * inserted between the two when no selection is highlighted
+                * and an option to select which switches the automatic
+                * selection of inserted text (default is true, see
+                * mw-editbutton-image).  The tip text is shown when the user
+                * moves the mouse over the button.
                 *
-                * Already here are accesskeys (key), which are not used yet until someone
-                * can figure out a way to make them work in IE. However, we should make
-                * sure these keys are not defined on the edit page.
+                * Also here: accesskeys (key), which are not used yet until
+                * someone can figure out a way to make them work in
+                * IE. However, we should make sure these keys are not defined
+                * on the edit page.
                 */
                $toolarray = array(
                        array(
@@ -2320,7 +2323,8 @@ HTML
                                'close'  => ']]',
                                'sample' => wfMsg( 'image_sample' ),
                                'tip'    => wfMsg( 'image_tip' ),
-                               'key'    => 'D'
+                               'key'    => 'D',
+                               'select' => true
                        ) : false,
                        $imagesAvailable ? array(
                                'image'  => $wgLang->getImageFile( 'button-media' ),
@@ -2376,6 +2380,10 @@ HTML
                                continue;
                        }
 
+                       if( !isset( $tool['select'] ) ) {
+                         $tool['select'] = true;
+                       }
+
                        $params = array(
                                $image = $wgStylePath . '/common/images/' . $tool['image'],
                                // Note that we use the tip both for the ALT tag and the TITLE tag of the image.