r44400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44399‎ | r44400 | r44401 >
Date:15:25, 10 December 2008
Author:yaron
Status:deferred
Tags:
Comment:
Removed inclusion of 'Form' namespace when using SMW 1.4 or higher
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_CreateCategory.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php
@@ -25,18 +25,22 @@
2626 }
2727
2828 function createCategoryText($default_form, $category_name, $parent_category) {
29 - global $sfgContLang;
30 -
3129 wfLoadExtensionMessages('SemanticForms');
3230
3331 if ($default_form == '') {
3432 $text = wfMsgForContent('sf_category_desc', $category_name);
3533 } else {
36 - $namespace_labels = $sfgContLang->getNamespaces();
37 - $form_label = $namespace_labels[SF_NS_FORM];
38 - $specprops = $sfgContLang->getSpecialPropertiesArray();
39 - $form_tag = "[[" . $specprops[SF_SP_HAS_DEFAULT_FORM] .
40 - "::$form_label:$default_form|$default_form]]";
 34+ global $sfgContLang;
 35+ $specprops = $sfgContLang->getPropertyLabels();
 36+ // a simpler call is possible in SMW 1.4 and higher
 37+ if (class_exists('SMWPropertyValue')) {
 38+ $form_tag = "[[" . $specprops[SF_SP_HAS_DEFAULT_FORM] . "::$default_form]]";
 39+ } else {
 40+ $namespace_labels = $sfgContLang->getNamespaces();
 41+ $form_label = $namespace_labels[SF_NS_FORM];
 42+ $form_tag = "[[" . $specprops[SF_SP_HAS_DEFAULT_FORM] .
 43+ "::$form_label:$default_form|$default_form]]";
 44+ }
4145 $text = wfMsgForContent('sf_category_hasdefaultform', $form_tag);
4246 }
4347 if ($parent_category != '') {

Status & tagging log