Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php |
— | — | @@ -133,27 +133,14 @@ |
134 | 134 | } |
135 | 135 | |
136 | 136 | $store = smwfGetStore(); |
137 | | - $res = SFUtils::getSMWPropertyValues( $store, $page_name, $page_namespace, $prop_smw_id ); |
| 137 | + $form_names = SFUtils::getSMWPropertyValues( $store, $page_name, $page_namespace, $prop_smw_id ); |
138 | 138 | |
139 | | - $form_names = array(); |
140 | | - foreach ( $res as $wiki_page_value ) { |
141 | | - // SMW 1.6+ |
142 | | - if ( $wiki_page_value instanceof SMWDIWikiPage ) { |
143 | | - $form_names[] = $wiki_page_value->getDBkey(); |
144 | | - } else { |
145 | | - $form_title = $wiki_page_value->getTitle(); |
146 | | - if ( ! is_null( $form_title ) ) { |
147 | | - $form_names[] = $form_title->getText(); |
148 | | - } |
149 | | - } |
150 | | - } |
151 | | - // if we're using a non-English language, check for the English string as well |
| 139 | + // If we're using a non-English language, check for the English |
| 140 | + // string as well. |
152 | 141 | if ( ! class_exists( 'SF_LanguageEn' ) || ! $sfgContLang instanceof SF_LanguageEn ) { |
153 | | - $res = SFUtils::getSMWPropertyValues( $store, $page_name, $page_namespace, $backup_prop_smw_id ); |
154 | | - foreach ( $res as $wiki_page_value ) |
155 | | - $form_names[] = $wiki_page_value->getTitle()->getText(); |
| 142 | + $backup_form_names = SFUtils::getSMWPropertyValues( $store, $page_name, $page_namespace, $backup_prop_smw_id ); |
| 143 | + $form_names = array_merge( $form_names, $backup_form_names ); |
156 | 144 | } |
157 | | - $form_names = array_unique( $form_names ); |
158 | 145 | // Add this data to the "cache". |
159 | 146 | self::$mLinkedForms[$page_key][$form_connection_type] = $form_names; |
160 | 147 | return $form_names; |
— | — | @@ -298,8 +285,9 @@ |
299 | 286 | // See if the page itself has a default form (or forms), and |
300 | 287 | // return it/them if so. |
301 | 288 | $default_forms = self::getFormsThatPagePointsTo( $title->getText(), $title->getNamespace(), self::PAGE_DEFAULT_FORM ); |
302 | | - if ( count( $default_forms ) > 0 ) |
| 289 | + if ( count( $default_forms ) > 0 ) { |
303 | 290 | return $default_forms; |
| 291 | + } |
304 | 292 | // If this is not a category page, look for a default form |
305 | 293 | // for its parent category or categories. |
306 | 294 | $namespace = $title->getNamespace(); |
Index: trunk/extensions/SemanticForms/includes/SF_TemplateField.php |
— | — | @@ -72,15 +72,14 @@ |
73 | 73 | } |
74 | 74 | // TODO - need handling for the case of more than one type. |
75 | 75 | if ( count( $types ) > 0 ) { |
76 | | - $this->field_type = $types[0]->getWikiValue(); |
| 76 | + $this->field_type = $types[0]; |
77 | 77 | } |
78 | 78 | |
79 | | - foreach ( $allowed_values as $value ) { |
| 79 | + foreach ( $allowed_values as $allowed_value ) { |
80 | 80 | // HTML-unencode each value |
81 | | - $wiki_value = html_entity_decode( $value->getWikiValue() ); |
82 | | - $this->possible_values[] = $wiki_value; |
| 81 | + $this->possible_values[] = html_entity_decode( $allowed_value ); |
83 | 82 | if ( count( $label_formats ) > 0 ) { |
84 | | - $label_format = $label_formats[0]->getWikiValue(); |
| 83 | + $label_format = $label_formats[0]; |
85 | 84 | $prop_instance = SMWDataValueFactory::findTypeID( $this->field_type ); |
86 | 85 | $label_value = SMWDataValueFactory::newTypeIDValue( $prop_instance, $wiki_value ); |
87 | 86 | $label_value->setOutputFormat( $label_format ); |