Release diogenes-0.9.22
[diogenes.git] / templates / plugin-editor.tpl
index e5b485b..14155d5 100644 (file)
@@ -1,4 +1,23 @@
 {if !$readonly}
+{literal}
+<script type="text/javascript">
+  <!--
+  function move_up( myplug ) {
+    document.plug_form.action.value = "move_up";
+    document.plug_form.plug_target.value = myplug;
+    document.plug_form.submit();
+    return true;
+  }
+  function move_down( myplug ) {
+    document.plug_form.action.value = "move_down";
+    document.plug_form.plug_target.value = myplug;
+    document.plug_form.submit();
+    return true;
+  }
+  // -->
+</script>
+{/literal}
+
 <form name="plug_form" method="post" action="{$post}">
 <input type="hidden" name="action" value="update" />
 <input type="hidden" name="plug_target" value="" />
 {foreach from=$plugins key=plugtype item=plugarr}
 <table class="light" style="width:80%">
 <tr>
-  <th colspan="2">{$plugtype} {$msg_plugedit_plugins}</th>
+  <th colspan="{if $show_params}4{else}3{/if}">{$plugtype} {$msg_plugedit_plugins}</th>
 </tr>
+{counter start=0 assign=cnt print=0}
 {foreach from=$plugarr item=plug}
-<tr class="odd">
-  <td><img class="fileicon" src="{$plug.icon}"/>&nbsp;{$plug.name}&nbsp;v{$plug.version}</td>
-  <td>
-{if $readonly || $plug.readonly}
-    {$statusvals[$plug.status]}
-{else}
-    <select name="{$plug.name}_status">{html_options options=$rwstatusvals selected=$plug.status}</select>
+<tr{if $cnt % 2} class="odd"{/if}>
+  <td style="width:30px">
+    <img class="fileicon" src="{$plug.icon}" />
+  </td>
+  <td>    
+    <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>
+{if !$readonly}
+    <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>
 {/if}
   </td>
-</tr>
-<tr>
-  <td><div class="description">{$plug.description}</div></td>
   <td>
-{if $show_params}
-    <table class="plugparams">
+  <div class="description">{$plug.description}</div>
+  </td>  
+{if !$readonly && $show_params}       
+  <td>
+    <table>
 {foreach from=$plug.params key=key item=val}
     <tr>
       <td>{$key}</td>
-      <td><input type="text" name="{$plug.name}_{$key}" value="{$val.value|escape}" size="30" /></td>
+      <td><input type="text" name="{$plug.name}_{$key}" value="{$val|escape}" size="30" /></td>
     </tr>
 {/foreach}
     </table>
-{else}
-    &nbsp;
-{/if}
   </td>
+{/if}  
 </tr>
+{counter}
 {/foreach}
 </table>
 <br/>