2 <select name='option'>
3 {foreach from=$options item=item key=key}
4 {if !isset($sudoOption.$key) || ($sudoOption.$key && $item.TYPE == "LISTS")}
5 <option value='{$key}'>{$item.NAME} ({$map[$item.TYPE]})</option>
6 {/if}
7 {/foreach}
8 </select>
9 <input type="submit" name="add_option" value="{msgPool type=addButton}">
11 <table>
12 {foreach from=$sudoOption item=item key=key}
14 <!-- Special handling for lists
15 -->
16 {if $options[$key].TYPE == "LISTS"}
17 {foreach from=$item item=entry key=entry_key}
18 <tr>
19 <td>{$key} - <b>{t}List{/t}</b></td>
20 <td style="width:20px;">
21 {if $entry.NEGATE}
22 <img src='images/negate.png' alt="!">
23 {/if}
24 </td>
25 <td><input type='text' value="{$entry.VALUE.0}" name="list_value__{$key}_{$entry_key}"></td>
26 <td>
27 <input type='image' src='images/negate.png' name='negListOption_{$key}_{$entry_key}' class='center'>
28 <input type='image' src='images/edittrash.png' name='delListOption_{$key}_{$entry_key}' class='center'>
29 </td>
30 </tr>
31 {/foreach}
32 {else}
34 <!-- Default values flat values/single value
35 -->
36 <tr>
37 <td>{$key}</td>
38 <td style="width:20px;">
39 {if $item.NEGATE}
40 <img src='images/negate.png' alt="!">
41 {/if}
42 </td>
43 <td>
45 {if $options[$item.NAME].TYPE == "STRING"}
46 <!-- STRING
47 -->
48 <input type='text' name='option_value__{$key}' value="{$item.VALUE.0}" style='width:280px;'>
49 {elseif $options[$item.NAME].TYPE == "INTEGER"}
50 <!-- INTEGER
51 -->
52 <input type='text' name='option_value__{$key}' value="{$item.VALUE.0}" style='width:280px;'>
53 {elseif $options[$item.NAME].TYPE == "BOOLEAN"}
54 <!-- BOOLEAN
55 -->
56 <select name="option_value__{$key}">
57 <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
58 <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
59 </select>
60 {elseif $options[$item.NAME].TYPE == "BOOL_INTEGER"}
61 <!-- BOOLEAN_INTEGER
62 -->
63 <select name="option_selection__{$key}" id="option_selection__{$key}"
64 onChange="toggle_bool_fields('option_selection__{$key}','option_value__{$key}');">
65 <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
66 <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
67 <option {if $item.VALUE.0 != "TRUE" && $item.VALUE.0 != "FALSE"} selected {/if}
68 value="STRING">STRING</option>
69 <input type='text' value="{$item.VALUE.0}" style='width:280px;' name='option_value__{$key}'
70 id="option_value__{$key}"
71 {if $item.VALUE.0 == "FALSE" || $item.VALUE.0 == "TRUE"} disabled {/if}>
72 </select>
73 {elseif $options[$item.NAME].TYPE == "STRING_BOOL"}
74 <!-- STRING_BOOLEAN
75 -->
76 <select name="option_selection__{$key}" id="option_selection__{$key}"
77 onChange="toggle_bool_fields('option_selection__{$key}','option_value__{$key}');">
78 <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
79 <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
80 <option {if $item.VALUE.0 != "TRUE" && $item.VALUE.0 != "FALSE"} selected {/if}
81 value="STRING">STRING</option>
82 <input type='text' value="{$item.VALUE.0}" style='width:280px;' name='option_value__{$key}'
83 id="option_value__{$key}"
84 {if $item.VALUE.0 == "FALSE" || $item.VALUE.0 == "TRUE"} disabled {/if}>
85 </select>
86 {/if}
87 </td>
88 <td style='width: 40px;'>
89 <input type='image' src='images/negate.png' name='negOption_{$key}' class='center'>
90 <input type='image' src='images/edittrash.png' name='delOption_{$key}' class='center'>
91 </td>
92 </tr>
93 {/if}
94 {/foreach}
95 </table>
97 <script language="JavaScript" type="text/javascript">
98 <!--
99 {literal}
100 function toggle_bool_fields(source_select,target_input)
101 {
102 var select= document.getElementById(source_select);
103 var input = document.getElementById(target_input);
104 if(select.value == "TRUE" || select.value == "FALSE"){
105 input.disabled = true;
106 input.value = select.value;
107 }else{
108 input.disabled = false;
109 input.value = "";
110 }
111 }
112 {/literal}
113 -->
114 </script>