whoops
[mir.git] / templates / admin / FUNCTIONS_media.template
1 <comment>
2   the complete medialist-template in two functions
3   not used for image-list because imagelist uses other display method
4 </comment>
5
6 <include "FUNCTIONS.template">
7
8 <function MediaSearch (module)>
9
10   <form method="GET" action="${config.actionRoot}">
11   
12   <input type="hidden" name="module" value="${module}">
13   <input type="hidden" name="do" value="search">
14   <input type="hidden" name="articleid" value="${articleid}">
15   <input type="hidden" name="commentid" value="${commentid}">
16   
17   <table border="0" cellspacing="2" cellpadding="2">
18     <tr>
19       <td class="table-head">${lang("search")}:</td>
20       <td class="table-head">${lang("medialist.search_text_in")}:</td>
21       <td class="table-head">${lang("media.published")}:</td>
22       <td class="table-head">${lang("media.mediafolder")}:</td>
23       <td class="table-head">&nbsp;</td>
24       <td><a class="link-box" href="${config.actionRoot}?module=${module}&do=add">[+] ${lang("add")} </a></td>
25     </tr>
26   
27     <tr>
28       <td class="listrow2">
29         <input type="text" size="20" maxlength="30" name="searchtext" value="${searchtext}">
30       </td> 
31       <td class="listrow2">
32         <select name="searchfield">
33           <option value="title"<if searchfield=="title"> selected</if>>${lang("media.title")}</option>
34           <option value="creator"<if searchfield=="creator"> selected</if>>${lang("media.creator")}</option>
35           <option value="place"<if searchfield=="place"> selected</if>>${lang("media.location")}</option>
36         </select>
37       </td>
38       
39       <td class="listrow2">
40         <select name="searchispublished">
41           <option value="">${lang("dontcare")}</option>
42           <option value="0" <if searchispublished=="0"> selected</if>>${lang("no")}</option>
43           <option value="1" <if searchispublished=="1"> selected</if>>${lang("yes")}</option>
44         </select>
45       </td>
46       
47       <td class="listrow2">
48       <select name="searchmediafolder">
49         <option value="">-</option>
50         <list mediafolders as m>
51           <option value="${m.id}" <if m.id == searchmediafolder>selected</if>>${m.name}</option>
52         </list>
53       </select>
54       </td>
55       
56       <td class="listrow2">
57         <input type="submit" class="majorbutton" name="search" value="${lang("filter")}">
58       </td>
59       
60       <td>
61       &nbsp;
62       </td>
63     </tr>
64   </table>
65   
66   </form>
67   
68 </function>
69
70 <function MediaList (module)>
71
72   <call showAddOrBack("1", module, "Admin", "start")>
73     <if medialist>
74       <call showPrevNextLinks(prevurl, nexturl, "left")>
75
76       <table>
77       
78         <tr class="darkgrey" >
79           <td class="table-head">
80         <b>${lang("media.icon")}</b></td>
81         <td class="table-head">
82         <b>${lang("media.title")}</b></td>
83           <td class="table-head">
84         <b>${lang("media.format")}</b></td>
85           <td class="table-head">
86         <b>${lang("media.mediafolder")}</b></td>
87           <td class="table-head">
88         <b>${lang("media.creator")}</b></td>
89           <td class="table-head">
90         &nbsp;</td>
91       
92         </tr>
93           <assign grey="0">
94           <list medialist as entry>
95           <tr <if grey=="1"><assign grey="0">class="listrow1"<else>class="listrow2"<assign grey="1"> </if>>
96           <td>
97               <a href="${config.actionRoot}?module=${module}&do=getMedia&id=${entry.id}">
98       <if module=="Images">
99               <img src="${config.actionRoot}?module=${module}&do=getIcon&id=${entry.id}" border=0></a>        
100       <else>
101               <img src="${config.docRoot}/img/${entry.info.bigIcon}" border=0></a>
102       </if>
103           </td>
104             <td>
105                 ${utility.encodeHTML(entry.title)}&nbsp;
106                 <if entry.description && entry.title><br></if>${utility.encodeHTML(entry.description)}
107                 <br><br>
108                 <if entry.is_published=="1">${lang("media.published")}: <a href="${entry.publish_server}${entry.publish_path}">${entry.publish_server}${entry.publish_path}</a><br></if>
109                 <a href="${config.actionRoot}?module=${module}&do=showarticles&id=${entry.id}">${lang("media.articles")}</a> |
110                 <a href="${config.actionRoot}?module=${module}&do=showcomments&id=${entry.id}">${lang("media.comments")}</a>
111              
112           </td>
113             <td>
114             ${entry.info.mediaType}&nbsp;
115           </td>
116             <td>
117              <if entry.mediafolder>
118                 ${entry.mediafolder.name}
119              </if>&nbsp;
120           </td>
121             <td>
122             ${entry.creator}&nbsp;
123           </td>
124             <td>&nbsp;
125             <if articleid>
126               <a href="${config.actionRoot}?module=Content&do=attach&mid=${entry.id}&articleid=${articleid}">${lang("attach")}</a>
127             <else>
128               <if commentid>
129                 <a href="${config.actionRoot}?module=Comment&do=attach&mid=${entry.id}&commentid=${commentid}">${lang("attach")}</a>
130               <else>
131                 <a href="${config.actionRoot}?module=${module}&do=delete&id=${entry.id}&okurl=${utility.encodeURI(thisurl)}&cancelurl=${utility.encodeURI(thisurl)}">${lang("delete")}</a>
132                 | 
133                 <a href="${config.actionRoot}?module=${module}&do=edit&id=${entry.id}">${lang("edit")}</a>
134               </if>
135             </if>
136           </td>
137           </tr>
138         </list>
139         <tr>
140           <td colspan="7" class="table-foot">
141             ${count} ${lang("records")} / ${lang("show_from_to", from, to)}
142           </td>
143         </tr>
144       </table>
145       
146       <call showPrevNextLinks(prevurl, nexturl, "left")>
147       <call showAddOrBack("1", module, "Admin", "start")>
148   
149     <else>
150       <P align="center">${lang("no_matches_found")}</p>
151     </if>
152
153 </function>