LSformElement_select : Added error message on display an unrecognized value
authorBenjamin Renard <brenard@easter-eggs.com>
Mon, 15 Nov 2010 16:33:47 +0000 (17:33 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Mon, 15 Nov 2010 16:33:47 +0000 (17:33 +0100)
public_html/includes/class/class.LSformElement_select.php
public_html/templates/default/LSformElement_select.tpl

index c0f96d6..f2eb81b 100644 (file)
@@ -55,6 +55,7 @@ class LSformElement_select extends LSformElement {
       LSsession :: addJSscript('LSformElement_select.js');
     }
     $params['possible_values'] = $this -> params['text_possible_values'];
+    $params['unrecognized_value_label_format'] = _("%{value} (unrecognized value)");
     $return['html'] = $this -> fetchTemplate(NULL,$params);
     return $return;
   }
index 99de2ef..df4c4f4 100644 (file)
@@ -1,7 +1,11 @@
 <ul class='LSform' id='{$attr_name}'>
 {if $freeze}
   {foreach from=$values item=value}
+    {if $possible_values.$value}
     <li>{$possible_values.$value}</li>
+    {else}
+    <li class='LSform-errors'>{getFData format=$unrecognized_value_label_format data=$value}</li>
+    {/if}
   {foreachelse}
     <li>{$noValueTxt}</li>
   {/foreach}