Index: trunk/extensions/SemanticForms/includes/SF_TemplateField.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | /** |
4 | 4 | * Defines a class, SFTemplateField, that represents a field in a template, |
5 | 5 | * including any possible semantic aspects it may have. Used in both creating |
6 | | - * templates and displaying user-created forms |
| 6 | + * templates and displaying user-created forms. |
7 | 7 | * |
8 | 8 | * @author Yaron Koren |
9 | 9 | * @file |
— | — | @@ -31,11 +31,11 @@ |
32 | 32 | * in the template definition (which we first have to find) |
33 | 33 | */ |
34 | 34 | static function createFromList( $field_name, $all_fields, $strict_parsing ) { |
35 | | - // see if this field matches one of the fields defined for |
| 35 | + // See if this field matches one of the fields defined for |
36 | 36 | // the template it's part of - if it is, use all available |
37 | 37 | // information about that field; if it's not, either create |
38 | 38 | // an object for it or not, depending on whether the |
39 | | - // template has a 'strict' setting in the form definition |
| 39 | + // template has a 'strict' setting in the form definition. |
40 | 40 | $the_field = null; |
41 | 41 | foreach ( $all_fields as $cur_field ) { |
42 | 42 | if ( $field_name == $cur_field->field_name ) { |
— | — | @@ -62,8 +62,8 @@ |
63 | 63 | // this returns an array of objects |
64 | 64 | $allowed_values = SFUtils::getSMWPropertyValues( $store, $proptitle, "Allows value" ); |
65 | 65 | $label_formats = SFUtils::getSMWPropertyValues( $store, $proptitle, "Has field label format" ); |
66 | | - // SMW 1.6+ |
67 | 66 | if ( class_exists( 'SMWDIProperty' ) ) { |
| 67 | + // SMW 1.6+ |
68 | 68 | $propValue = SMWDIProperty::newFromUserLabel( $this->semantic_property ); |
69 | 69 | $this->property_type = $propValue->findPropertyTypeID(); |
70 | 70 | } else { |
— | — | @@ -91,7 +91,8 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | | - * Called when template is parsed during the creation of a form |
| 95 | + * Called if a matching property is found for a template field when |
| 96 | + * a template is parsed during the creation of a form. |
96 | 97 | */ |
97 | 98 | function setSemanticProperty( $semantic_property ) { |
98 | 99 | $this->semantic_property = str_replace( '\\', '', $semantic_property ); |
— | — | @@ -136,7 +137,7 @@ |
137 | 138 | $setInternalText = null; |
138 | 139 | } |
139 | 140 | |
140 | | - // Topmost part of table depends on format |
| 141 | + // Topmost part of table depends on format. |
141 | 142 | if ( $template_format == 'infobox' ) { |
142 | 143 | // A CSS style can't be used, unfortunately, since most |
143 | 144 | // MediaWiki setups don't have an 'infobox' or |