TTO has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/87649


Change subject: Make edit toolbar Signature button optional in content 
namespaces
......................................................................

Make edit toolbar Signature button optional in content namespaces

Most wikis do not require user signatures on content pages, so having the
button available is confusing.

This change does nothing by default, but eventually I think we will want
to set $wgShowSigButtonInContentNamespaces = false by default, since this
is what the majority of installations would be expected to want.

Bug: 5645
Change-Id: I7ccf1093b888c7b33721234349ca0ac054c3cd3f
---
M includes/DefaultSettings.php
M includes/EditPage.php
2 files changed, 18 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/87649/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 19b2f41..66a13f7 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -5370,6 +5370,14 @@
  */
 $wgUseAutomaticEditSummaries = true;
 
+/**
+ * Whether to display the Signature button on the edit toolbar in the content
+ * namespaces defined by $wgContentNamespaces. Most wikis will want to set this
+ * to false - only more traditional, "MeatballWiki"-style wikis should need
+ * this set to true.
+ */
+$wgShowSigButtonInContentNamespaces = true;
+
 /** @} */ # end edit UI }
 
 /************************************************************************//**
diff --git a/includes/EditPage.php b/includes/EditPage.php
index 12cd4b3..fef8004 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -2258,7 +2258,7 @@
                $wgOut->addHTML( $this->editFormTextBeforeContent );
 
                if ( !$this->isCssJsSubpage && $showToolbar && 
$wgUser->getOption( 'showtoolbar' ) ) {
-                       $wgOut->addHTML( EditPage::getEditToolbar() );
+                       $wgOut->addHTML( EditPage::getEditToolbar( 
$this->mTitle ) );
                }
 
                if ( $this->isConflict ) {
@@ -3247,13 +3247,18 @@
         * It can be disabled in the user preferences.
         * The necessary JavaScript code can be found in skins/common/edit.js.
         *
+        * @param $title Title object for the page being edited (optional)
         * @return string
         */
-       static function getEditToolbar() {
+       static function getEditToolbar( $title = false ) {
                global $wgStylePath, $wgContLang, $wgLang, $wgOut;
-               global $wgUseTeX, $wgEnableUploads, $wgForeignFileRepos;
+               global $wgUseTeX, $wgEnableUploads, $wgForeignFileRepos, 
$wgShowSigButtonInContentNamespaces;
 
                $imagesAvailable = $wgEnableUploads || count( 
$wgForeignFileRepos );
+               $showSignature = true;
+               if ( $title ) {
+                        $showSignature = $wgShowSigButtonInContentNamespaces 
|| !( $title->isContentPage() );
+               }
 
                /**
                 * $toolarray is an array of arrays each of which includes the
@@ -3350,7 +3355,7 @@
                                'tip'    => wfMessage( 'nowiki_tip' )->text(),
                                'key'    => 'N'
                        ),
-                       array(
+                       $showSignature ? array(
                                'image'  => $wgLang->getImageFile( 'button-sig' 
),
                                'id'     => 'mw-editbutton-signature',
                                'open'   => '--~~~~',
@@ -3358,7 +3363,7 @@
                                'sample' => '',
                                'tip'    => wfMessage( 'sig_tip' )->text(),
                                'key'    => 'Y'
-                       ),
+                       ) : false,
                        array(
                                'image'  => $wgLang->getImageFile( 'button-hr' 
),
                                'id'     => 'mw-editbutton-hr',

-- 
To view, visit https://gerrit.wikimedia.org/r/87649
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ccf1093b888c7b33721234349ca0ac054c3cd3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to