Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php |
— | — | @@ -25,18 +25,22 @@ |
26 | 26 | } |
27 | 27 | |
28 | 28 | function createCategoryText($default_form, $category_name, $parent_category) { |
29 | | - global $sfgContLang; |
30 | | - |
31 | 29 | wfLoadExtensionMessages('SemanticForms'); |
32 | 30 | |
33 | 31 | if ($default_form == '') { |
34 | 32 | $text = wfMsgForContent('sf_category_desc', $category_name); |
35 | 33 | } 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 | + } |
41 | 45 | $text = wfMsgForContent('sf_category_hasdefaultform', $form_tag); |
42 | 46 | } |
43 | 47 | if ($parent_category != '') { |