merged with 1.1
[mir.git] / templates / admin / abuse.filters.template
index 1c02048..9ec9763 100755 (executable)
@@ -1,75 +1,74 @@
-<function showFilterEntry(aType, anExpression, anId)>
-      <form method="post" action="${config.actionRoot}">
-        <input type="hidden" name="module" value="Abuse">
-        <input type="hidden" name="do" value="editfilter">
-        <if anId>
-          <input type="hidden" name="id" value="${anId}">
-        </if>
-        <if grey=="1"><assign grey="0"><tr class="listrow1"><else><tr class="listrow2"><assign grey="1"> </if>
-          <td>
-            <select name="type">
-              <list filtertypes as t>
-                <option value="${t.id}" <if t.id==aType>selected</if>>${lang("abuse.filtertype."+t.resource)}</option>
-              </list>
-            </select>
-          </td>
-          <td><input type="text" name="expression" size="30" value="${utility.encodeHTML(anExpression)}"></td>
-          <if anId>
-            <td>
-              <input type="submit" name="save" value="${lang("save")}">
-            </td>
-            <td>
-                <a class="listcommand" href="${config.actionRoot}?module=Abuse&do=deletefilter&id=${anId}">[${lang("delete")}]</a>
-                &nbsp;
-            </td>
-          <else>
-            <td>
-              <input class="majorbutton" type="submit" name="save" value="${lang("add")}">
-            </td>
-          </if>
-        </tr>
-      </form>
-</function>
-
-
 <html>
 <head>
-  <title>${config["Mir.Name"]} | ${lang("userlist.htmltitle")}</title>
+  <title>${config["Mir.Name"]} | ${lang("abuse.filters.htmltitle")}</title>
   <link rel="stylesheet" type="text/css" href="${config.docRoot}/style/admin.css">
 </head>
-
 <body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
+<include "LISTFUNCTIONS.template">
+<include "FUNCTIONS.template">
 <include "head.template">
-<p>
-  <a class="link-box" href="${config.actionRoot}?module=Abuse">[ &lt; ] ${lang("back")}</a>&nbsp;&nbsp;
-  <a class="link-box" href="${config.actionRoot}?module=Abuse&do=showlog">${lang("abuse.showlog")}</a>
-  <br><br>
-</p>
-<table border="0" cellpadding="2" cellspacing="1">
-  <tr>
-    <td class="table-head"><b>${lang("abuse.filter.type")}</b></td>
-    <td class="table-head"><b>${lang("abuse.filter.expression")}</b></td>
-    <td class="table-head"><b>&nbsp;</b></td>
-    <td class="table-head"><b>&nbsp;</b></td>
-  </tr>
 
-  <assign grey="0">      
-  <list filters as i>
-    <call showFilterEntry(i.type, i.expression, i.id)>
-  </list>
+    <p>
+      <a class="link-box" href="${config.actionRoot}?module=Abuse">[ &lt; ] ${lang("back")}</a>&nbsp;&nbsp;
+      <a class="link-box" href="${config.actionRoot}?module=Abuse&do=add">[+] ${lang("add")}</a> &nbsp;
+      <if config["Abuse.DisallowIPLogging"]!="1">
+        <a class="link-box" href="${config.actionRoot}?module=Abuse&do=showlog">${lang("abuse.showlog")}</a>
+      </if>
+      <br><br>
+    </p>
+    <call ListStart()>\r
+    <call ListHead([
+          lang("abuse.filter.type"), 
+          lang("abuse.filter.expression"),
+          lang("abuse.filter.articleaction"),
+          lang("abuse.filter.commentaction"),
+          lang("abuse.filter.comments"),
+          lang("abuse.filter.lasthit"), 
+           ])>
+    <list filters as f>    
+    <if f.lastHit>\r
+        <call ListEntry([
+          lang("abuse.filtertype."+f.type),
+          utility.encodeHTML(f.expression),
+          lang("content.operation."+f.articleAction),
+          lang("comment.operation."+f.commentAction),
+          f.comments,                                                   
+          f.lastHit.format(config["Mir.DefaultDateTimeFormat"], config["Mir.DefaultTimezone"])
+          ], 
+          "module=Abuse&id="+f.id, 
+          ["&do=edit", "&do=delete"], 
+          [lang("edit"), lang("delete")])
+        >
+    <else>
+        <call ListEntry([
+          lang("abuse.filtertype."+f.type),
+          utility.encodeHTML(f.expression),
+          lang("content.operation."+f.articleAction),
+          lang("comment.operation."+f.commentAction),
+          f.comments,
+          "-"
+          ], 
+          "module=Abuse&id="+f.id, 
+          ["&do=edit", "&do=delete"], 
+          [lang("edit"), lang("delete")])
+        >
+    </if>
+    </list>\r
+    <call ListEnd()>\r
+    
+    <p>
+      <a class="link-box" href="${config.actionRoot}?module=Abuse">[ &lt; ] ${lang("back")}</a>&nbsp;&nbsp;
+      <a class="link-box" href="${config.actionRoot}?module=Abuse&do=add">[+] ${lang("add")}</a> &nbsp;
+      <if config["Abuse.DisallowIPLogging"]!="1">
+        <a class="link-box" href="${config.actionRoot}?module=Abuse&do=showlog">${lang("abuse.showlog")}</a>
+      </if>
+      <br><br>
+    </p>
 
-  <call showFilterEntry("", "", "")>
-  </table>
-
-  
-<p>
-  <a class="link-box" href="${config.actionRoot}?module=Abuse">[ &lt; ] ${lang("back")}</a>&nbsp;&nbsp;
-  <a class="link-box" href="${config.actionRoot}?module=Abuse&do=showlog">${lang("abuse.showlog")}</a>
-</p>
-    <include "foot.template">
-  </body>
+  <include "foot.template">
+</body>
 </html>
 
 
+
+