MediaWiki r56495 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r56494‎ | r56495 (on ViewVC)‎ | r56496 >
Date:08:33, 17 September 2009
Author:siebrand
Status:ok
Tags:
Comment:
Add setting $wgAJAXCategoriesNamespaces to allow configuring namespaces for where the category add/remove widget is used when $wgUseAJAXCategories is set to true. Default behaviour has been left unchanged.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php	(revision 56494)
+++ trunk/phase3/includes/OutputPage.php	(revision 56495)
@@ -1160,7 +1160,13 @@
 
 		global $wgUseAJAXCategories;
 		if ($wgUseAJAXCategories) {
-			$this->addScriptClass( 'ajaxCategories' );
+			global $wgAJAXCategoriesNamespaces;
+
+			$title = $this->getTitle();
+
+			if( empty( $wgAJAXCategoriesNamespaces ) || in_array( $title->getNamespace(), $wgAJAXCategoriesNamespaces ) ) {
+				$this->addScriptClass( 'ajaxCategories' );
+			}
 		}
 
 		if( $wgUniversalEditButton ) {
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 56494)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 56495)
@@ -4237,6 +4237,14 @@
 $wgUseAJAXCategories = false;
 
 /**
+ * Only enable AJAXCategories on configured namespaces. Default is all.
+ *
+ * Example:
+ *   $wgAJAXCategoriesNamespaces = array( NS_MAIN, NS_PROJECT );
+ */
+$wgAJAXCategoriesNamespaces = array();
+
+/**
  * To disable file delete/restore temporarily
  */
 $wgUploadMaintenance = false;

Follow-up revisions

Rev.Commit summaryAuthorDate
r56501Add $wgUseAJAXCategories and $wgAJAXCategoriesNamespaces to RELEASE-NOTES. Re...siebrand10:05, 17 September 2009

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox