1 | {* $Id: picture.tpl 5938 2010-04-22 13:11:32Z laurent.duretz $ *} |
---|
2 | |
---|
3 | {* Example of resizeable *} |
---|
4 | {* |
---|
5 | {include file='include/autosize.inc.tpl'} |
---|
6 | *} |
---|
7 | |
---|
8 | {if isset($errors)} |
---|
9 | <div class="errors"> |
---|
10 | <ul> |
---|
11 | {foreach from=$errors item=error} |
---|
12 | <li>{$error}</li> |
---|
13 | {/foreach} |
---|
14 | </ul> |
---|
15 | </div> |
---|
16 | {/if} |
---|
17 | |
---|
18 | {if isset($infos)} |
---|
19 | <div class="infos"> |
---|
20 | <ul> |
---|
21 | {foreach from=$infos item=info} |
---|
22 | <li>{$info}</li> |
---|
23 | {/foreach} |
---|
24 | </ul> |
---|
25 | </div> |
---|
26 | {/if} |
---|
27 | |
---|
28 | {if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if} |
---|
29 | |
---|
30 | <div id="imageHeaderBar"> |
---|
31 | <div class="browsePath"> |
---|
32 | {$SECTION_TITLE} |
---|
33 | {$LEVEL_SEPARATOR}{$current.TITLE} |
---|
34 | </div> |
---|
35 | <div class="imageNumber">{$PHOTO}</div> |
---|
36 | {if $SHOW_PICTURE_NAME_ON_TITLE } |
---|
37 | <h2>{$current.TITLE}</h2> |
---|
38 | {/if} |
---|
39 | </div> |
---|
40 | |
---|
41 | <div id="imageToolBar"> |
---|
42 | <div class="randomButtons"> |
---|
43 | {if isset($U_SLIDESHOW_START) } |
---|
44 | <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/start_slideshow.png" class="button" alt="{'slideshow'|@translate}"></a> |
---|
45 | {/if} |
---|
46 | {if isset($U_SLIDESHOW_STOP) } |
---|
47 | <a href="{$U_SLIDESHOW_STOP}" title="{'slideshow_stop'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/stop_slideshow.png" class="button" alt="{'slideshow_stop'|@translate}"></a> |
---|
48 | {/if} |
---|
49 | <a href="{$U_METADATA}" title="{'picture_show_metadata'|@translate}" rel="nofollow"><img src="{$ROOT_URL}{$themeconf.icon_dir}/metadata.png" class="button" alt="metadata" /></a> |
---|
50 | {if isset($current.U_DOWNLOAD) } |
---|
51 | <a href="{$current.U_DOWNLOAD}" title="{'download_hint'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/save.png" class="button" alt="{'download'|@translate}"></a> |
---|
52 | {/if} |
---|
53 | {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if} |
---|
54 | {if isset($favorite) } |
---|
55 | <a href="{$favorite.U_FAVORITE}" title="{$favorite.FAVORITE_HINT}"><img src="{$favorite.FAVORITE_IMG}" class="button" alt="favorite" title="{$favorite.FAVORITE_HINT}"></a> |
---|
56 | {/if} |
---|
57 | {if !empty($U_SET_AS_REPRESENTATIVE) } |
---|
58 | <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as category representative'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/representative.png" class="button" alt="{'representative'|@translate}"></a> |
---|
59 | {/if} |
---|
60 | {if isset($U_ADMIN) } |
---|
61 | <a href="{$U_ADMIN}" title="{'link_info_image'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/preferences.png" class="button" alt="{'edit'|@translate}"></a> |
---|
62 | {/if} |
---|
63 | {if isset($U_CADDIE) }{*caddie management BEGIN*} |
---|
64 | <script type="text/javascript"> |
---|
65 | {literal}function addToCadie(aElement, rootUrl, id) |
---|
66 | { |
---|
67 | if (aElement.disabled) return; |
---|
68 | aElement.disabled=true; |
---|
69 | var y = new PwgWS(rootUrl); |
---|
70 | |
---|
71 | y.callService( |
---|
72 | "pwg.caddie.add", {image_id: id} , |
---|
73 | { |
---|
74 | onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; }, |
---|
75 | onSuccess: function(result) { aElement.disabled = false; } |
---|
76 | } |
---|
77 | ); |
---|
78 | }{/literal} |
---|
79 | </script> |
---|
80 | <a href="{$U_CADDIE}" onclick="addToCadie(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}); return false;" title="{'add to caddie'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/caddie_add.png" class="button" alt="{'caddie'|@translate}"></a> |
---|
81 | {/if}{*caddie management END*} |
---|
82 | </div> |
---|
83 | {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'} |
---|
84 | </div> <!-- imageToolBar --> |
---|
85 | |
---|
86 | <div id="theImage"> |
---|
87 | {$ELEMENT_CONTENT} |
---|
88 | |
---|
89 | {if isset($COMMENT_IMG)} |
---|
90 | <p>{$COMMENT_IMG}</p> |
---|
91 | {/if} |
---|
92 | |
---|
93 | {if isset($U_SLIDESHOW_STOP) } |
---|
94 | <p> |
---|
95 | [ <a href="{$U_SLIDESHOW_STOP}">{'slideshow_stop'|@translate}</a> ] |
---|
96 | </p> |
---|
97 | {/if} |
---|
98 | |
---|
99 | </div> |
---|
100 | |
---|
101 | {if isset($previous) } |
---|
102 | <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'previous_page'|@translate} : {$previous.TITLE}" rel="prev"> |
---|
103 | <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}"> |
---|
104 | </a> |
---|
105 | {/if} |
---|
106 | {if isset($next) } |
---|
107 | <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'next_page'|@translate} : {$next.TITLE}" rel="next"> |
---|
108 | <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}"> |
---|
109 | </a> |
---|
110 | {/if} |
---|
111 | |
---|
112 | <table class="infoTable" summary="Some info about this picture"> |
---|
113 | <tr> |
---|
114 | <td class="label">{'Author'|@translate}</td> |
---|
115 | <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td> |
---|
116 | </tr> |
---|
117 | <tr> |
---|
118 | <td class="label">{'Created on'|@translate}</td> |
---|
119 | <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td> |
---|
120 | </tr> |
---|
121 | <tr> |
---|
122 | <td class="label">{'Posted on'|@translate}</td> |
---|
123 | <td class="value">{$INFO_POSTED_DATE}</td> |
---|
124 | </tr> |
---|
125 | <tr> |
---|
126 | <td class="label">{'Dimensions'|@translate}</td> |
---|
127 | <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td> |
---|
128 | </tr> |
---|
129 | <tr> |
---|
130 | <td class="label">{'File'|@translate}</td> |
---|
131 | <td class="value">{$INFO_FILE}</td> |
---|
132 | </tr> |
---|
133 | <tr> |
---|
134 | <td class="label">{'Filesize'|@translate}</td> |
---|
135 | <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td> |
---|
136 | </tr> |
---|
137 | <tr> |
---|
138 | <td class="label">{'Tags'|@translate}</td> |
---|
139 | <td class="value"> |
---|
140 | {if isset($related_tags)} |
---|
141 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if} |
---|
142 | <a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
143 | {/if} |
---|
144 | </td> |
---|
145 | </tr> |
---|
146 | <tr> |
---|
147 | <td class="label">{'Categories'|@translate}</td> |
---|
148 | <td class="value"> |
---|
149 | {if isset($related_categories)} |
---|
150 | <ul> |
---|
151 | {foreach from=$related_categories item=cat} |
---|
152 | <li>{$cat}</li> |
---|
153 | {/foreach} |
---|
154 | </ul> |
---|
155 | {/if} |
---|
156 | </td> |
---|
157 | </tr> |
---|
158 | <tr> |
---|
159 | <td class="label">{'Visits'|@translate}</td> |
---|
160 | <td class="value">{$INFO_VISITS}</td> |
---|
161 | </tr> |
---|
162 | |
---|
163 | {if isset($rate_summary) } |
---|
164 | <tr> |
---|
165 | <td class="label">{'Average rate'|@translate}</td> |
---|
166 | <td class="value" id="ratingSummary"> |
---|
167 | {if $rate_summary.count} |
---|
168 | {assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate } |
---|
169 | {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) } |
---|
170 | {else} |
---|
171 | {'no_rate'|@translate} |
---|
172 | {/if} |
---|
173 | </td> |
---|
174 | </tr> |
---|
175 | {/if} |
---|
176 | |
---|
177 | {if isset($rating)} |
---|
178 | <tr> |
---|
179 | <td class="label"> |
---|
180 | <span id="updateRate">{if isset($rating.USER_RATE)}{'update_rate'|@translate}{else}{'new_rate'|@translate}{/if}</span> |
---|
181 | </td> |
---|
182 | <td class="value"> |
---|
183 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
184 | <div> |
---|
185 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
186 | {if !$smarty.foreach.rate_loop.first} | {/if} |
---|
187 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
188 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}" /> |
---|
189 | {else} |
---|
190 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}" /> |
---|
191 | {/if} |
---|
192 | {/foreach} |
---|
193 | <script type="text/javascript" src="{$ROOT_URL}template/{$themeconf.template}/rating.js"></script> |
---|
194 | <script type="text/javascript"> |
---|
195 | makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id}, |
---|
196 | updateRateText: "{'update_rate'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"), |
---|
197 | ratingSummaryText: "{'%.2f (rated %d times, standard deviation = %.2f)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} ); |
---|
198 | </script> |
---|
199 | </div> |
---|
200 | </form> |
---|
201 | </td> |
---|
202 | </tr> |
---|
203 | {/if} |
---|
204 | |
---|
205 | {if isset($available_permission_levels) } |
---|
206 | <tr> |
---|
207 | <td class="label">{'Privacy level'|@translate}:</td> |
---|
208 | <td class="value"> |
---|
209 | <script type="text/javascript"> |
---|
210 | {literal}function setPrivacyLevel(selectElement, rootUrl, id, level) |
---|
211 | { |
---|
212 | selectElement.disabled = true; |
---|
213 | var y = new PwgWS(rootUrl); |
---|
214 | y.callService( |
---|
215 | "pwg.images.setPrivacyLevel", {image_id: id, level:level} , |
---|
216 | { |
---|
217 | method: "POST", |
---|
218 | onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); }, |
---|
219 | onSuccess: function(result) { selectElement.disabled = false; } |
---|
220 | } |
---|
221 | ); |
---|
222 | }{/literal} |
---|
223 | </script> |
---|
224 | <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)"> |
---|
225 | {foreach from=$available_permission_levels item=level} |
---|
226 | <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option> |
---|
227 | {/foreach} |
---|
228 | </select> |
---|
229 | </td></tr> |
---|
230 | {/if} |
---|
231 | |
---|
232 | </table> |
---|
233 | |
---|
234 | {if isset($metadata)} |
---|
235 | <table class="infoTable" summary="Some more (technical) info about this picture"> |
---|
236 | {foreach from=$metadata item=meta} |
---|
237 | <tr> |
---|
238 | <th colspan="2">{$meta.TITLE}</th> |
---|
239 | </tr> |
---|
240 | {foreach from=$meta.lines item=value key=label} |
---|
241 | <tr> |
---|
242 | <td class="label">{$label}</td> |
---|
243 | <td class="value">{$value}</td> |
---|
244 | </tr> |
---|
245 | {/foreach} |
---|
246 | {/foreach} |
---|
247 | </table> |
---|
248 | {/if} |
---|
249 | |
---|
250 | |
---|
251 | <hr class="separation"> |
---|
252 | |
---|
253 | {if isset($COMMENT_COUNT)} |
---|
254 | <div id="comments"> |
---|
255 | {if $COMMENT_COUNT > 0} |
---|
256 | <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3> |
---|
257 | {/if} |
---|
258 | {if !empty($COMMENT_NAV_BAR)} |
---|
259 | <div class="navigationBar">{$COMMENT_NAV_BAR}</div> |
---|
260 | {/if} |
---|
261 | |
---|
262 | {if isset($comments)} |
---|
263 | {include file='comment_list.tpl' comment_separator=true} |
---|
264 | {/if} |
---|
265 | |
---|
266 | {if isset($comment_add)} |
---|
267 | <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment"> |
---|
268 | <fieldset> |
---|
269 | <legend>{'comments_add'|@translate}</legend> |
---|
270 | {if $comment_add.SHOW_AUTHOR} |
---|
271 | <label>{'upload_author'|@translate}<input type="text" name="author"></label> |
---|
272 | {/if} |
---|
273 | <label>{'comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label> |
---|
274 | <input type="hidden" name="key" value="{$comment_add.KEY}" /> |
---|
275 | <input class="submit" type="submit" value="{'Submit'|@translate}"> |
---|
276 | </fieldset> |
---|
277 | </form> |
---|
278 | {/if} |
---|
279 | </div> |
---|
280 | {/if} {*comments*} |
---|
281 | |
---|
282 | {if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if} |
---|