Code

Updated sudo stuff
[gosa.git] / gosa-core / plugins / admin / sudo / options.tpl
2 <select name='option'>
3 {foreach from=$options item=item key=key}
4  <option value='{$key}'>{$item.NAME} ({$map[$item.TYPE]})</option>
5 {/foreach}
6 </select>
9 <table>
10 {foreach from=$sudoOption item=item key=key}
11  <tr>
12   <td>{$key}</td>
13   <td style="width:20px;">
14    {if $item.NEGATE}
15     <img src='images/negate.png' alt="!">
16    {/if}
17   </td>
18   <td>
20   {if $options[$item.NAME].TYPE == "STRING"}
21    <!-- STRING  
22     -->
23    <input type='text' name='option_value__{$key}' value="{$item.VALUE.0}" style='width:280px;'> 
24   {elseif $options[$item.NAME].TYPE == "INTEGER"}
25    <!-- INTEGER  
26     -->
27    <input type='text' name='option_value__{$key}' value="{$item.VALUE.0}" style='width:280px;'>
28   {elseif $options[$item.NAME].TYPE == "BOOLEAN"}
29    <!-- BOOLEAN  
30     -->
31    <select name="option_value__{$key}">
32     <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
33     <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
34    </select>
35   {elseif $options[$item.NAME].TYPE == "BOOL_INTEGER"}
36    <!-- BOOLEAN_INTEGER 
37     -->
38    <select name="option_selection__{$key}" id="option_selection__{$key}"
39         onChange="toggle_bool_fields('option_selection__{$key}','option_value__{$key}');">
40     <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
41     <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
42     <option {if $item.VALUE.0 != "TRUE" && $item.VALUE.0 != "FALSE"} selected {/if}
43         value="STRING">STRING</option>
44     <input type='text' value="{$item.VALUE.0}" style='width:280px;' name='option_value__{$key}'
45         id="option_value__{$key}"
46         {if $item.VALUE.0 == "FALSE" ||  $item.VALUE.0 == "TRUE"} disabled {/if}>
47    </select> 
48   {elseif $options[$item.NAME].TYPE == "STRING_BOOL"}
49    <!-- STRING_BOOLEAN 
50     -->
51    <select name="option_selection__{$key}" id="option_selection__{$key}"
52         onChange="toggle_bool_fields('option_selection__{$key}','option_value__{$key}');">
53     <option {if $item.VALUE.0 == "FALSE"} selected {/if}value="FALSE">FALSE</option>
54     <option {if $item.VALUE.0 == "TRUE"} selected {/if}value="TRUE">TRUE</option>
55     <option {if $item.VALUE.0 != "TRUE" && $item.VALUE.0 != "FALSE"} selected {/if}
56         value="STRING">STRING</option>
57     <input type='text' value="{$item.VALUE.0}" style='width:280px;' name='option_value__{$key}'
58         id="option_value__{$key}" 
59         {if $item.VALUE.0 == "FALSE" ||  $item.VALUE.0 == "TRUE"} disabled {/if}>
60    </select> 
61   {else}
62    {$options[$item.NAME].TYPE} 
63   {/if}
64   </td>
65   <td style='width: 40px;'>
66    <input type='image' src='images/negate.png'     name='negOption_{$key}' class='center'>
67    <input type='image' src='images/edittrash.png'  name='delOption_{$key}' class='center'>
68   </td>
69  </tr>
70 {/foreach}
71 </table>
73 <script language="JavaScript" type="text/javascript">
74  <!-- 
75   {literal}
76   function toggle_bool_fields(source_select,target_input)
77   {
78    var select= document.getElementById(source_select); 
79    var input = document.getElementById(target_input); 
80    if(select.value == "TRUE" || select.value == "FALSE"){
81     input.disabled = true;
82     input.value = select.value;
83    }else{
84     input.disabled = false;
85     input.value = "";
86    }
87   }
88   {/literal}
89  -->
90 </script>