Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -133,12 +133,13 @@ |
134 | 134 | } |
135 | 135 | |
136 | 136 | $store = smwfGetStore(); |
137 | | - $form_names = SFUtils::getSMWPropertyValues( $store, $page_name, $page_namespace, $prop_smw_id ); |
| 137 | + $subject = Title::makeTitleSafe( $page_namespace, $page_name ); |
| 138 | + $form_names = SFUtils::getSMWPropertyValues( $store, $subject, $prop_smw_id ); |
138 | 139 | |
139 | 140 | // If we're using a non-English language, check for the English |
140 | 141 | // string as well. |
141 | 142 | if ( ! class_exists( 'SF_LanguageEn' ) || ! $sfgContLang instanceof SF_LanguageEn ) { |
142 | | - $backup_form_names = SFUtils::getSMWPropertyValues( $store, $page_name, $page_namespace, $backup_prop_smw_id ); |
| 143 | + $backup_form_names = SFUtils::getSMWPropertyValues( $store, $subject, $backup_prop_smw_id ); |
143 | 144 | $form_names = array_merge( $form_names, $backup_form_names ); |
144 | 145 | } |
145 | 146 | // Add this data to the "cache". |
Index: trunk/extensions/SemanticForms/includes/SF_TemplateField.php |
— | — | @@ -60,11 +60,11 @@ |
61 | 61 | |
62 | 62 | $store = smwfGetStore(); |
63 | 63 | // this returns an array of objects |
64 | | - $allowed_values = SFUtils::getSMWPropertyValues( $store, $this->semantic_property, SMW_NS_PROPERTY, "Allows value" ); |
65 | | - $label_formats = SFUtils::getSMWPropertyValues( $store, $this->semantic_property, SMW_NS_PROPERTY, "Has field label format" ); |
| 64 | + $allowed_values = SFUtils::getSMWPropertyValues( $store, $proptitle, "Allows value" ); |
| 65 | + $label_formats = SFUtils::getSMWPropertyValues( $store, $proptitle, "Has field label format" ); |
66 | 66 | // SMW 1.6+ |
67 | 67 | if ( class_exists( 'SMWDIProperty' ) ) { |
68 | | - $propValue = new SMWDIProperty( $this->semantic_property ); |
| 68 | + $propValue = SMWDIProperty::newFromUserLabel( $this->semantic_property ); |
69 | 69 | $this->property_type = $propValue->findPropertyTypeID(); |
70 | 70 | } else { |
71 | 71 | $propValue = SMWPropertyValue::makeUserProperty( $this->semantic_property ); |
Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -75,14 +75,13 @@ |
76 | 76 | * Helper function to handle getPropertyValues() in both SMW 1.6 |
77 | 77 | * and earlier versions. |
78 | 78 | */ |
79 | | - public static function getSMWPropertyValues( $store, $pageName, $pageNamespace, $propID, $requestOptions = null ) { |
| 79 | + public static function getSMWPropertyValues( $store, $subject, $propID, $requestOptions = null ) { |
80 | 80 | // SMWDIProperty was added in SMW 1.6 |
81 | 81 | if ( class_exists( 'SMWDIProperty' ) ) { |
82 | | - if ( is_null( $pageName ) ) { |
| 82 | + if ( is_null( $subject ) ) { |
83 | 83 | $page = null; |
84 | 84 | } else { |
85 | | - $pageName = str_replace( ' ', '_', $pageName ); |
86 | | - $page = new SMWDIWikiPage( $pageName, $pageNamespace, null ); |
| 85 | + $page = SMWDIWikiPage::newFromTitle( $subject ); |
87 | 86 | } |
88 | 87 | $property = SMWDIProperty::newFromUserLabel( $propID ); |
89 | 88 | $res = $store->getPropertyValues( $page, $property, $requestOptions ); |
— | — | @@ -99,9 +98,8 @@ |
100 | 99 | } |
101 | 100 | return $values; |
102 | 101 | } else { |
103 | | - $title = Title::makeTitleSafe( $pageNamespace, $pageName ); |
104 | 102 | $property = SMWPropertyValue::makeProperty( $propID ); |
105 | | - $res = $store->getPropertyValues( $title, $property, $requestOptions ); |
| 103 | + $res = $store->getPropertyValues( $subject, $property, $requestOptions ); |
106 | 104 | $values = array(); |
107 | 105 | foreach ( $res as $value ) { |
108 | 106 | if ( method_exists( $value, 'getTitle' ) ) { |
— | — | @@ -433,7 +431,7 @@ |
434 | 432 | $store = smwfGetStore(); |
435 | 433 | $requestoptions = new SMWRequestOptions(); |
436 | 434 | $requestoptions->limit = $sfgMaxAutocompleteValues; |
437 | | - $values = self::getSMWPropertyValues( $store, null, null, $property_name, $requestoptions ); |
| 435 | + $values = self::getSMWPropertyValues( $store, null, $property_name, $requestoptions ); |
438 | 436 | sort( $values ); |
439 | 437 | return $values; |
440 | 438 | } |
— | — | @@ -531,6 +529,10 @@ |
532 | 530 | return array(); |
533 | 531 | } |
534 | 532 | |
| 533 | + if ( class_exists( 'SMWDIWikiPage' ) ) { |
| 534 | + // SMW 1.6 |
| 535 | + $concept = SMWDIWikiPage::newFromTitle( $concept ); |
| 536 | + } |
535 | 537 | $desc = new SMWConceptDescription( $concept ); |
536 | 538 | $printout = new SMWPrintRequest( SMWPrintRequest::PRINT_THIS, "" ); |
537 | 539 | $desc->addPrintRequest( $printout ); |