r90398 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90397‎ | r90398 | r90399 >
Date:16:52, 19 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Improved some comments
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_TemplateField.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_TemplateField.php
@@ -2,7 +2,7 @@
33 /**
44 * Defines a class, SFTemplateField, that represents a field in a template,
55 * 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.
77 *
88 * @author Yaron Koren
99 * @file
@@ -31,11 +31,11 @@
3232 * in the template definition (which we first have to find)
3333 */
3434 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
3636 // the template it's part of - if it is, use all available
3737 // information about that field; if it's not, either create
3838 // 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.
4040 $the_field = null;
4141 foreach ( $all_fields as $cur_field ) {
4242 if ( $field_name == $cur_field->field_name ) {
@@ -62,8 +62,8 @@
6363 // this returns an array of objects
6464 $allowed_values = SFUtils::getSMWPropertyValues( $store, $proptitle, "Allows value" );
6565 $label_formats = SFUtils::getSMWPropertyValues( $store, $proptitle, "Has field label format" );
66 - // SMW 1.6+
6766 if ( class_exists( 'SMWDIProperty' ) ) {
 67+ // SMW 1.6+
6868 $propValue = SMWDIProperty::newFromUserLabel( $this->semantic_property );
6969 $this->property_type = $propValue->findPropertyTypeID();
7070 } else {
@@ -91,7 +91,8 @@
9292 }
9393
9494 /**
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.
9697 */
9798 function setSemanticProperty( $semantic_property ) {
9899 $this->semantic_property = str_replace( '\\', '', $semantic_property );
@@ -136,7 +137,7 @@
137138 $setInternalText = null;
138139 }
139140
140 - // Topmost part of table depends on format
 141+ // Topmost part of table depends on format.
141142 if ( $template_format == 'infobox' ) {
142143 // A CSS style can't be used, unfortunately, since most
143144 // MediaWiki setups don't have an 'infobox' or