Index: trunk/extensions/SemanticForms/includes/SF_FormField.php |
— | — | @@ -123,15 +123,32 @@ |
124 | 124 | $prop_link_text = SFUtils::linkText( SMW_NS_PROPERTY, $template_field->semantic_property ); |
125 | 125 | // TODO - remove this probably-unnecessary check? |
126 | 126 | if ( $template_field->semantic_property == "" ) { |
127 | | - // print nothing if there's no semantic field |
128 | | - } elseif ( $template_field->field_type == "" ) { |
| 127 | + // Print nothing if there's no semantic property. |
| 128 | + } elseif ( $template_field->property_type == "" ) { |
129 | 129 | $text .= '<p>' . wfMsg( 'sf_createform_fieldpropunknowntype', $prop_link_text ) . "</p>\n"; |
130 | | - } elseif ( $template_field->is_list ) { |
131 | | - $text .= '<p>' . wfMsg( 'sf_createform_fieldproplist', $prop_link_text, |
132 | | - SFUtils::linkText( SMW_NS_TYPE, $template_field->field_type ) ) . "</p>\n"; |
133 | 130 | } else { |
134 | | - $text .= '<p>' . wfMsg( 'sf_createform_fieldprop', $prop_link_text, |
135 | | - SFUtils::linkText( SMW_NS_TYPE, $template_field->field_type ) ) . "</p>\n"; |
| 131 | + if ( $template_field->is_list ) { |
| 132 | + $propDisplayMsg = 'sf_createform_fieldproplist'; |
| 133 | + } else { |
| 134 | + $propDisplayMsg = 'sf_createform_fieldprop'; |
| 135 | + } |
| 136 | + |
| 137 | + // Get the display label for this property type. |
| 138 | + global $smwgContLang; |
| 139 | + $propertyTypeStr = ''; |
| 140 | + if ( $smwgContLang != null ) { |
| 141 | + $datatypeLabels = $smwgContLang->getDatatypeLabels(); |
| 142 | + $datatypeLabels['enumeration'] = 'enumeration'; |
| 143 | + $propertyType = $datatypeLabels[$template_field->property_type]; |
| 144 | + if ( class_exists( 'SMWDIProperty' ) ) { |
| 145 | + // "Type:" namespace was removed in SMW 1.6. |
| 146 | + // TODO: link to Special:Types instead? |
| 147 | + $propertyTypeStr = $propertyType; |
| 148 | + } else { |
| 149 | + $propertyTypeStr = SFUtils::linkText( SMW_NS_TYPE, $propertyType ); |
| 150 | + } |
| 151 | + } |
| 152 | + $text .= Xml::tags( 'p', null, wfMsg( $propDisplayMsg, $prop_link_text, $propertyTypeStr ) ) . "\n"; |
136 | 153 | } |
137 | 154 | // If it's not a semantic field - don't add any text. |
138 | 155 | $form_label_text = wfMsg( 'sf_createform_formlabel' ); |