r37326 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37325‎ | r37326 | r37327 >
Date:17:41, 8 July 2008
Author:yaron
Status:old
Tags:
Comment:
Added handling for SMW's new 'Code' type
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormClasses.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormClasses.inc
@@ -289,6 +289,11 @@
290290 $datatypeLabels = $smwgContLang->getDatatypeLabels();
291291 $string_type = $datatypeLabels['_str'];
292292 $text_type = $datatypeLabels['_txt'];
 293+ // type introduced in SMW 1.2
 294+ if (array_key_exists('_cod', $datatypeLabels))
 295+ $code_type = $datatypeLabels['_cod'];
 296+ else
 297+ $code_type = 'code';
293298 $url_type = $datatypeLabels['_uri'];
294299 $email_type = $datatypeLabels['_ema'];
295300 $float_type = $datatypeLabels['_num'];
@@ -314,7 +319,7 @@
315320 } else {
316321 return array('text');
317322 }
318 - } elseif ($semantic_field_type == $text_type) {
 323+ } elseif ($semantic_field_type == $text_type || $semantic_field_type == $code_type) {
319324 return array('textarea');
320325 } elseif ($semantic_field_type == $bool_type) {
321326 return array('checkbox');

Status & tagging log