new admin templates! with many thanks to init...
[mir.git] / templates / admin / FUNCTIONS_media.template
diff --git a/templates/admin/FUNCTIONS_media.template b/templates/admin/FUNCTIONS_media.template
new file mode 100755 (executable)
index 0000000..ccd0924
--- /dev/null
@@ -0,0 +1,143 @@
+<comment>
+       the complete medialist-template in two functions
+       not used for image-list because imagelist uses other display method
+</comment>
+
+<function MediaSearch (module)>
+
+<form method="post" action="${config.actionRoot}">
+
+<input type="hidden" name="module" value="${module}">
+<input type="hidden" name="do" value="list">
+<input type="hidden" name="cid" value="${data.cid}">
+
+<table border="0" cellspacing="2" cellpadding="2">
+       <tr>
+               <td class="table_head">${lang("search")}:</td>
+               <td class="table_head">${lang("medialist.search_text_in")}:</td>
+               <td class="table_head">${lang("media.published")}:</td>
+               <td class="table_head">${lang("media.mediafolder")}:</td>
+               <td class="table_head">&nbsp;</td>
+               <td><a class="link_box" href="${config.actionRoot}?module=${module}&do=add">[+] ${lang("add")} </a></td>
+       </tr>
+
+       <tr>
+               <td class="listrow2">
+                       <input type="text" size="20" maxlength="30" name="query_text" value="${data.query_text}">
+               </td>   
+               <td class="listrow2">
+                       <select name="query_field">
+                               <option value="title"<if data.query_field=="title"> selected</if>>${lang("media.title")}</option>
+                               <option value="creator"<if data.query_field=="creator"> selected</if>>${lang("media.creator")}</option>
+                               <option value="place"<if data.query_field=="place"> selected</if>>${lang("media.location")}</option>
+                               <option value="keywords"<if data.query_field=="keywords"> selected</if>>${lang("media.keywords")}</option>
+                       </select>
+               </td>
+               
+               <td class="listrow2">
+                       <select name="query_is_published">
+                               <option value="">${lang("dontcare")}</option>
+                               <option value="0" <if data.query_is_published=="0"> selected</if>>${lang("no")}</option>
+                               <option value="1" <if data.query_is_published=="1"> selected</if>>${lang("yes")}</option>
+                       </select>
+               </td>
+               
+               <td class="listrow2">
+               <select name="query_media_folder">
+               <list extra.mediafolderPopupData as m>
+               <option value="${m.key}" <if m.key == data.query_media_folder>selected</if>>${m.value}</option>
+               </list>
+               </select>
+               </td>
+               
+               <td class="listrow2">
+                       <input type="submit" name="search" value="${lang("filter")}">
+               </td>
+               
+               <td>
+               &nbsp;
+               </td>
+       </tr>
+</table>
+
+</form>
+
+</function>
+
+<function MediaList (module)>
+
+<table>
+
+  <tr class="darkgrey" >
+       <td class="table_head">
+       <b>${lang("media.icon")}</b></td>
+       <td class="table_head">
+       <b>${lang("media.title")}</b></td>
+    <td class="table_head">
+       <b>${lang("media.format")}</b></td>
+    <td class="table_head">
+       <b>${lang("media.size")}</b></td>
+    <td class="table_head">
+       <b>${lang("media.mediafolder")}</b></td>
+    <td class="table_head">
+       <b>${lang("media.creator")}</b></td>
+    <td class="table_head">
+       &nbsp;</td>
+
+  </tr>
+       <if data.contentlist>
+       <list data.contentlist as entry>
+       <tr <if grey=="1"><assign grey="0">class="listrow1"<else>class="listrow2"<assign grey="1"> </if>>
+               <td>
+                       <a href="${config.actionRoot}?module=${module}&do=getMedia&id=${entry.id}">
+                       <img src="${config.docRoot}/img/${entry.big_icon}" border=0></a>
+               </td>
+               <td>
+                       ${entry.title}&nbsp;
+                       <if entry.description><br>${entry.description}</if>
+               </td>
+               <td>
+                       ${entry.media_descr}&nbsp;
+               </td>
+               <td>
+                       ${entry.human_readable_size}&nbsp;
+               </td>
+               <td>
+                       ${data.mediafolderHashdata[entry.to_media_folder]["name"]}&nbsp;
+               </td>
+               <td>
+                       ${entry.creator}&nbsp;
+               </td>
+               <td>&nbsp;
+                       <if data.cid>
+                               <a href="${config.actionRoot}?module=Content&do=attach&mid=${entry.id}&cid=${data.cid}">${lang("attach")}</a>
+                       <else>
+                               <a href="${config.actionRoot}?module=${module}&do=delete&id=${entry.id}&query_text=${utility.encodeHTML(data.query_text_encoded)}&query_field=${utility.encodeHTML(data.query_field)}&query_is_published=${data.query_is_published}&query_media_folder=${data.query_media_folder}&offset=${data.offset}">${lang("delete")}</a>
+                       | <a href="${config.actionRoot}?module=${module}&do=edit&id=${entry.id}">${lang("edit")}</a>
+                       </if>
+               </td>
+       </tr>
+       </list>
+       <tr>
+               <td colspan="7" class="table_foot">
+                       ${data.count} ${lang("records")} / ${lang("show_from_to", data.from, data.to)}
+               </td>
+       </tr>
+
+       <tr>
+               <td>
+                       <if data.prev>
+                               <a href="${config.actionRoot}?module=${module}&do=list&query_text=${data.query_text_encoded}&query_field=${data.query_field}&query_is_published=${data.query_is_published}&query_media_folder=${data.query_media_folder}&offset=${data.prev}&prev=zur&uuml;ck&cid=${data.cid}">${lang("list.previous")}</a>&nbsp;
+                       </if>
+                       <if data.next>
+                               <a href="${config.actionRoot}?module=${module}&do=list&query_text=${data.query_text_encoded}&query_field=${data.query_field}&query_is_published=${data.query_is_published}&query_media_folder=${data.query_media_folder}&offset=${data.next}&next=weiter&cid=${data.cid}">${lang("list.next")}</a>
+                       </if>
+               </td>
+       </tr>
+
+<else>
+  <tr><td align="center" class="box" colspan="7">${lang("no_matches_found")}</td></tr>
+</if>
+</table>
+
+</function>