- multiple "producer" shortcuts possible
[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.big_icon}" 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                 <a href="${config.actionRoot}?module=${module}&do=showarticles&id=${entry.id}">${lang("media.articles")}</a> |
109                 <a href="${config.actionRoot}?module=${module}&do=showcomments&id=${entry.id}">${lang("media.comments")}</a>
110              
111           </td>
112             <td>
113             ${entry.media_descr}&nbsp;
114           </td>
115             <td>
116              <if entry.mediafolder>
117                 ${entry.mediafolder.name}
118              </if>&nbsp;
119           </td>
120             <td>
121             ${entry.creator}&nbsp;
122           </td>
123             <td>&nbsp;
124             <if articleid>
125               <a href="${config.actionRoot}?module=Content&do=attach&mid=${entry.id}&articleid=${articleid}">${lang("attach")}</a>
126             <else>
127               <if commentid>
128                 <a href="${config.actionRoot}?module=Comment&do=attach&mid=${entry.id}&commentid=${commentid}">${lang("attach")}</a>
129               <else>
130                 <a href="${config.actionRoot}?module=${module}&do=delete&id=${entry.id}&okurl=${utility.encodeURI(thisurl)}&cancelurl=${utility.encodeURI(thisurl)}">${lang("delete")}</a>
131                 | 
132                 <a href="${config.actionRoot}?module=${module}&do=edit&id=${entry.id}">${lang("edit")}</a>
133               </if>
134             </if>
135           </td>
136           </tr>
137         </list>
138         <tr>
139           <td colspan="7" class="table-foot">
140             ${count} ${lang("records")} / ${lang("show_from_to", from, to)}
141           </td>
142         </tr>
143       </table>
144       
145       <call showPrevNextLinks(prevurl, nexturl, "left")>
146       <call showAddOrBack("1", module, "Admin", "start")>
147   
148     <else>
149       <P align="center">${lang("no_matches_found")}</p>
150     </if>
151
152 </function>