1.1 restoration
[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     <if returnurl>
72       <call showAddOrBack2("1", module, returnurl)>
73     <else>
74       <call showAddOrBack("1", module, "Admin", "start")>
75     </if>
76
77     <if medialist>
78       <call showPrevNextLinks(prevurl, nexturl, "left")>
79
80       <table>
81       
82         <tr class="darkgrey" >
83           <td class="table-head">
84         <b>${lang("media.icon")}</b></td>
85         <td class="table-head">
86         <b>${lang("media.title")}</b></td>
87           <td class="table-head">
88         <b>${lang("media.format")}</b></td>
89           <td class="table-head">
90         <b>${lang("media.mediafolder")}</b></td>
91           <td class="table-head">
92         <b>${lang("media.creator")}</b></td>
93           <td class="table-head">
94         &nbsp;</td>
95       
96         </tr>
97           <assign grey="0">
98           <list medialist as entry>
99           <tr <if grey=="1"><assign grey="0">class="listrow1"<else>class="listrow2"<assign grey="1"> </if>>
100           <td>
101               <a href="${config.actionRoot}?module=${module}&do=getMedia&id=${entry.id}">
102       <if module=="Images">
103               <img src="${config.actionRoot}?module=${module}&do=getIcon&id=${entry.id}" border=0></a>        
104       <else>
105               <img src="${config.docRoot}/img/${entry.info.bigIcon}" border=0></a>
106       </if>
107           </td>
108             <td>
109                 ${utility.encodeHTML(entry.title)}&nbsp;
110                 <if entry.description && entry.title><br></if>${utility.encodeHTML(entry.description)}
111                 <br><br>
112                 <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>
113                 <a href="${config.actionRoot}?module=${module}&do=showarticles&id=${entry.id}">${lang("media.articles")}</a> |
114                 <a href="${config.actionRoot}?module=${module}&do=showcomments&id=${entry.id}">${lang("media.comments")}</a>
115              
116           </td>
117             <td>
118             ${entry.info.mediaType}&nbsp;
119           </td>
120             <td>
121              <if entry.mediafolder>
122                 ${entry.mediafolder.name}
123              </if>&nbsp;
124           </td>
125             <td>
126             ${entry.creator}&nbsp;
127           </td>
128             <td>&nbsp;
129             <if articleid>
130               <a href="${config.actionRoot}?module=Content&do=attach&mid=${entry.id}&articleid=${articleid}">${lang("attach")}</a>
131             <else>
132               <if commentid>
133                 <a href="${config.actionRoot}?module=Comment&do=attach&mid=${entry.id}&commentid=${commentid}">${lang("attach")}</a>
134               <else>
135                 <a href="${config.actionRoot}?module=${module}&do=delete&id=${entry.id}&okurl=${utility.encodeURI(thisurl)}&cancelurl=${utility.encodeURI(thisurl)}">${lang("delete")}</a>
136                 | 
137                 <a href="${config.actionRoot}?module=${module}&do=edit&id=${entry.id}">${lang("edit")}</a>
138               </if>
139             </if>
140           </td>
141           </tr>
142         </list>
143         <tr>
144           <td colspan="7" class="table-foot">
145             ${count} ${lang("records")} / ${lang("show_from_to", from, to)}
146           </td>
147         </tr>
148       </table>
149       
150       <call showPrevNextLinks(prevurl, nexturl, "left")>
151
152       <if returnurl>
153         <call showAddOrBack2("1", module, returnurl)>
154       <else>
155         <call showAddOrBack("1", module, "Admin", "start")>
156       </if>
157   
158     <else>
159       <P align="center">${lang("no_matches_found")}</p>
160     </if>
161
162 </function>