Fix select ui element and add states into smarty defaults
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 11 Jul 2019 19:46:46 +0000 (15:46 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 11 Jul 2019 19:46:46 +0000 (15:46 -0400)
Adding states into the smarty Standard Template Parameters.
Correcting select. Need $key as well as $val for generic select.

setup/standardTemplateParams.php
views/ui/f6/select.html

index 14310cd..0b38b88 100644 (file)
@@ -38,6 +38,7 @@ $smarty->templateAssign('thisYear', date ( 'Y' ) );
 $smarty->templateAssign('ref_type_numb', $this->config['ref_type_numb']);
 $smarty->templateAssign('settings', $this->config['settings']);
 $smarty->templateAssign('terms', $this->config['terms']);
+$smarty->templateAssign('states', $this->config['states']);
 
 
 if (is_admin()) {
index 2e26b10..ba45c1f 100644 (file)
 
             {if $ui.l_blank}<option value=""></option>{/if}
 
-            {foreach $ui.list as $v}
+            {foreach $ui.list as $k => $v}
                 {if isset($ui.l_value) && isset($ui.l_label)}
                     <option value="{$v[$ui.l_value]}"{if $ui.value == $v[$ui.l_value]} selected="selected"{/if}>{$v[$ui.l_label]}</option>
                 {else}
-                    <option value="{$v}"{if $ui.value == $v} selected="selected"{/if}>{$v}</option>
+                    <option value="{$k}"{if $ui.value == $k} selected="selected"{/if}>{$v}</option>
                 {/if}
             {/foreach}
         </select>