first shot at reworking plugin system
[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="3">{$plugtype} {$msg_plugedit_plugins}</th>
33 </tr>
34 {foreach from=$plugarr item=plug}
35 <tr class="odd">
36   <td style="width:30px"><img class="fileicon" src="{$plug.icon}"/>&nbsp;{$plug.name}&nbsp;v{$plug.version}
37   </td>
38   <td>
39 {if !$readonly}
40     <select name="{$plug.name}_status">{html_options options=$statusvals selected=$plug.status}</select>
41     <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>
42 {/if}
43   </td>
44 </tr>
45 <tr>
46 {if $show_params}
47   <td><div class="description">{$plug.description}</div></td>
48   <td colspan="2">
49     <table class="plugparams">
50 {foreach from=$plug.params key=key item=val}
51     <tr>
52       <td>{$key}</td>
53       <td><input type="text" name="{$plug.name}_{$key}" value="{$val|escape}" size="30" /></td>
54     </tr>
55 {/foreach}
56     </table>
57   </td>
58 {/if}  
59 </tr>
60 {/foreach}
61 </table>
62 <br/>
63 {/foreach}
64 </div>
65
66 {if !$readonly}
67 <p>
68   <input type="submit" value="{$msg_submit}" />
69 </p>
70 </form>
71 {/if}