r60335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60334‎ | r60335 | r60336 >
Date:19:46, 23 December 2009
Author:yaron
Status:deferred
Tags:
Comment:
New UploadWindow class for MW 1.16+, removed namespace setting (not necessary, since it's done by SMW)
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_GlobalFunctions.php
@@ -7,7 +7,7 @@
88
99 if ( !defined( 'MEDIAWIKI' ) ) die();
1010
11 -define('SF_VERSION','1.8.5');
 11+define('SF_VERSION','1.8.6');
1212
1313 $wgExtensionCredits['specialpage'][]= array(
1414 'path' => __FILE__,
@@ -77,9 +77,14 @@
7878 $wgSpecialPages['RunQuery'] = 'SFRunQuery';
7979 $wgAutoloadClasses['SFRunQuery'] = $sfgIP . '/specials/SF_RunQuery.php';
8080 $wgSpecialPageGroups['RunQuery'] = 'sf_group';
81 -$wgSpecialPages['UploadWindow'] = 'SFUploadWindow';
82 -$wgAutoloadClasses['SFUploadWindow'] = $sfgIP . '/specials/SF_UploadWindow.php';
83 -
 81+// different upload-window class for MW 1.16+
 82+if (class_exists('HTMLForm')) { // added in MW 1.16
 83+ $wgSpecialPages['UploadWindow'] = 'SFUploadWindow2';
 84+ $wgAutoloadClasses['SFUploadWindow2'] = $sfgIP . '/specials/SF_UploadWindow2.php';
 85+} else {
 86+ $wgSpecialPages['UploadWindow'] = 'SFUploadWindow';
 87+ $wgAutoloadClasses['SFUploadWindow'] = $sfgIP . '/specials/SF_UploadWindow.php';
 88+}
8489 $wgAutoloadClasses['SFTemplateField'] = $sfgIP . '/includes/SF_TemplateField.inc';
8590 $wgAutoloadClasses['SFForm'] = $sfgIP . '/includes/SF_FormClasses.inc';
8691 $wgAutoloadClasses['SFTemplateInForm'] = $sfgIP . '/includes/SF_FormClasses.inc';
@@ -134,18 +139,8 @@
135140 * greater or equal to 100.
136141 */
137142 function sffInitNamespaces() {
138 - global $sfgNamespaceIndex, $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespacesWithSubpages, $wgLanguageCode, $sfgContLang;
 143+ global $wgExtraNamespaces, $wgNamespaceAliases, $wgNamespacesWithSubpages, $wgLanguageCode, $sfgContLang;
139144
140 - if (!isset($sfgNamespaceIndex)) {
141 - $sfgNamespaceIndex = 106;
142 - }
143 -
144 - // these namespaces are defined in versions 1.4 and later of SMW
145 - if (! defined('SF_NS_FORM'))
146 - define('SF_NS_FORM', $sfgNamespaceIndex);
147 - if (! defined('SF_NS_FORM_TALK'))
148 - define('SF_NS_FORM_TALK', $sfgNamespaceIndex+1);
149 -
150145 sffInitContentLanguage($wgLanguageCode);
151146
152147 // Register namespace identifiers

Status & tagging log