r50898 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50897‎ | r50898 | r50899 >
Date:17:32, 22 May 2009
Author:sergeychernyshev
Status:deferred
Tags:
Comment:
Fixed a problem with namespace configuration.
Modified paths:
  • /trunk/extensions/Widgets/Widgets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Widgets/Widgets.php
@@ -24,11 +24,16 @@
2525 /**
2626 * Set this to the index of the Widget namespace
2727 */
28 -$widgetNamespaceIndex = 274;
 28+if ( !defined( 'NS_WIDGET' ) ) {
 29+ define( 'NS_WIDGET', 274 );
 30+}
 31+if ( !defined( 'NS_WIDGET_TALK' ) ) {
 32+ define( 'NS_WIDGET_TALK', NS_WIDGET + 1 );
 33+} elseif ( NS_WIDGET_TALK != NS_WIDGET + 1 ) {
 34+ throw new MWException( 'Configuration error. Do not define NS_WIDGET_TALK, it is automatically set based on NS_WIDGET.' );
 35+}
2936
30 -
3137 // Initialize Smarty
32 -
3338 require dirname(__FILE__)."/smarty/Smarty.class.php";
3439
3540 // Parser function registration
@@ -173,12 +178,9 @@
174179 }
175180
176181 function widgetNamespacesInit() {
177 - global $widgetNamespaceIndex, $wgExtraNamespaces, $wgNamespacesWithSubpages,
 182+ global $wgExtraNamespaces, $wgNamespacesWithSubpages,
178183 $wgGroupPermissions, $wgNamespaceProtection;
179184
180 - define('NS_WIDGET', $widgetNamespaceIndex);
181 - define('NS_WIDGET_TALK', $widgetNamespaceIndex+1);
182 -
183185 // Register namespace identifiers
184186 if (!is_array($wgExtraNamespaces)) { $wgExtraNamespaces=array(); }
185187 $wgExtraNamespaces = $wgExtraNamespaces + array(NS_WIDGET => 'Widget', NS_WIDGET_TALK => 'Widget_talk');

Follow-up revisions

RevisionCommit summaryAuthorDate
r51681Backported r50477, r50541, r50898, r50900, recent changes from trunk includin...tstarling05:42, 10 June 2009

Status & tagging log