Index: trunk/extensions/SemanticForms/includes/SF_TemplateField.inc |
— | — | @@ -29,14 +29,20 @@ |
30 | 30 | if ($proptitle === NULL) |
31 | 31 | return; |
32 | 32 | $store = smwfGetStore(); |
33 | | - $types = $store->getSpecialValues($proptitle, SMW_SP_HAS_TYPE); |
| 33 | + if (class_exists('SMWPropertyValue')) { |
| 34 | + $types = $store->getPropertyValues($proptitle, SMWPropertyValue::makeUserProperty("Has type")); |
| 35 | + // this returns an array of objects |
| 36 | + $allowed_values = $store->getPropertyValues($proptitle, SMWPropertyValue::makeUserProperty("Allows value")); |
| 37 | + } else { |
| 38 | + $types = $store->getSpecialValues($proptitle, SMW_SP_HAS_TYPE); |
| 39 | + // this returns an array of objects |
| 40 | + $allowed_values = $store->getSpecialValues($proptitle, SMW_SP_POSSIBLE_VALUE); |
| 41 | + } |
34 | 42 | // TODO - need handling for the case of more than one type |
35 | 43 | if (count($types) > 0) |
36 | 44 | $this->field_type = $types[0]->getWikiValue(); |
37 | 45 | |
38 | | - // this returns an array of objects |
39 | | - $SMW_values = smwfGetStore()->getSpecialValues($proptitle, SMW_SP_POSSIBLE_VALUE); |
40 | | - foreach ($SMW_values as $value) { |
| 46 | + foreach ($allowed_values as $value) { |
41 | 47 | $this->possible_values[] = $value->getXSDValue(); |
42 | 48 | } |
43 | 49 | // HACK - if there were any possible values, set the field |