add 'scripts' directory
[diogenes.git] / templates / plugin-editor.tpl
1 {if !$readonly}
2 {literal}
3 <script type="text/javascript">
4   <!--
5   function move_up( myplug ) {
6     document.plug_form.action.value = "move_up";
7     document.plug_form.plug_target.value = myplug;
8     document.plug_form.submit();
9     return true;
10   }
11   function move_down( myplug ) {
12     document.plug_form.action.value = "move_down";
13     document.plug_form.plug_target.value = myplug;
14     document.plug_form.submit();
15     return true;
16   }
17   // -->
18 </script>
19 {/literal}
20
21 <form name="plug_form" method="post" action="{$post}">
22 <input type="hidden" name="action" value="update" />
23 <input type="hidden" name="plug_target" value="" />
24 <input type="hidden" name="plug_page" value="{$plug_page}" />
25 <input type="hidden" name="plug_barrel" value="{$plug_barrel}" />
26 {/if}
27
28 <div class="plugins">
29 {foreach from=$plugins key=plugtype item=plugarr}
30 <table class="light" style="width:80%">
31 <tr>
32   <th colspan="{if $show_params}4{else}3{/if}">{$plugtype} {$msg_plugedit_plugins}</th>
33 </tr>
34 {counter start=0 assign=cnt print=0}
35 {foreach from=$plugarr item=plug}
36 <tr{if $cnt % 2} class="odd"{/if}>
37   <td style="width:30px">
38     <img class="fileicon" src="{$plug.icon}" />
39   </td>
40   <td>    
41     <div class="name">{if !$readonly}<input type="checkbox" name="plugins_active[]" value="{$plug.name}"{if $plug.active} checked="checked"{/if} />&nbsp;{/if}{$plug.name}&nbsp;v{$plug.version}</div>
42 {if !$readonly}
43     <a class="action"{if $plug.move_up}href="javascript:move_up('{$plug.name}');"{/if}>{$msg_move_up}</a>&nbsp;<a class="action"{if $plug.move_down}href="javascript:move_down('{$plug.name}');"{/if}>{$msg_move_down}</a>
44 {/if}
45   </td>
46   <td>
47   <div class="description">{$plug.description}</div>
48   </td>  
49 {if !$readonly && $show_params}       
50   <td>
51     <table>
52 {foreach from=$plug.params key=key item=val}
53     <tr>
54       <td>{$key}</td>
55       <td><input type="text" name="{$plug.name}_{$key}" value="{$val|escape}" size="30" /></td>
56     </tr>
57 {/foreach}
58     </table>
59   </td>
60 {/if}  
61 </tr>
62 {counter}
63 {/foreach}
64 </table>
65 <br/>
66 {/foreach}
67 </div>
68
69 {if !$readonly}
70 <p>
71   <input type="submit" value="{$msg_submit}" />
72 </p>
73 </form>
74 {/if}