Add setting $wgAJAXCategoriesNamespaces to allow configuring namespaces for where...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Thu, 17 Sep 2009 08:33:07 +0000 (08:33 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Thu, 17 Sep 2009 08:33:07 +0000 (08:33 +0000)
includes/DefaultSettings.php
includes/OutputPage.php

index bc4d85f..3997a1f 100644 (file)
@@ -4236,6 +4236,14 @@ $wgMemoryLimit = "50M";
  */
 $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
  */
index abf33fe..68eacc8 100644 (file)
@@ -1160,7 +1160,13 @@ class OutputPage {
 
                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 ) {