1 | {include file='include/autosize.inc.tpl'} |
---|
2 | {include file='include/dbselect.inc.tpl'} |
---|
3 | {include file='include/datepicker.inc.tpl'} |
---|
4 | |
---|
5 | {combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'} |
---|
6 | |
---|
7 | {combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'} |
---|
8 | {combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.default.css"} |
---|
9 | |
---|
10 | {footer_script} |
---|
11 | (function(){ |
---|
12 | {* <!-- CATEGORIES --> *} |
---|
13 | var categoriesCache = new LocalStorageCache({ |
---|
14 | key: 'categoriesAdminList', |
---|
15 | serverKey: '{$CACHE_KEYS.categories}', |
---|
16 | serverId: '{$CACHE_KEYS._hash}', |
---|
17 | |
---|
18 | loader: function(callback) { |
---|
19 | jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.categories.getAdminList', function(data) { |
---|
20 | callback(data.result.categories); |
---|
21 | }); |
---|
22 | } |
---|
23 | }); |
---|
24 | |
---|
25 | jQuery('[data-selectize=categories]').selectize({ |
---|
26 | valueField: 'id', |
---|
27 | labelField: 'fullname', |
---|
28 | searchField: ['fullname'], |
---|
29 | plugins: ['remove_button'] |
---|
30 | }); |
---|
31 | |
---|
32 | categoriesCache.get(function(categories) { |
---|
33 | jQuery('[data-selectize=categories]').each(function() { |
---|
34 | this.selectize.load(function(callback) { |
---|
35 | callback(categories); |
---|
36 | }); |
---|
37 | |
---|
38 | jQuery.each(jQuery(this).data('value'), jQuery.proxy(function(i, id) { |
---|
39 | this.selectize.addItem(id); |
---|
40 | }, this)); |
---|
41 | }); |
---|
42 | }); |
---|
43 | |
---|
44 | {* <!-- TAGS --> *} |
---|
45 | var tagsCache = new LocalStorageCache({ |
---|
46 | key: 'tagsAdminList', |
---|
47 | serverKey: '{$CACHE_KEYS.tags}', |
---|
48 | serverId: '{$CACHE_KEYS._hash}', |
---|
49 | |
---|
50 | loader: function(callback) { |
---|
51 | jQuery.getJSON('{$ROOT_URL}ws.php?format=json&method=pwg.tags.getAdminList', function(data) { |
---|
52 | var tags = data.result.tags; |
---|
53 | |
---|
54 | for (var i=0, l=tags.length; i<l; i++) { |
---|
55 | tags[i].id = '~~' + tags[i].id + '~~'; |
---|
56 | } |
---|
57 | |
---|
58 | callback(tags); |
---|
59 | }); |
---|
60 | } |
---|
61 | }); |
---|
62 | |
---|
63 | jQuery('[data-selectize=tags]').selectize({ |
---|
64 | valueField: 'id', |
---|
65 | labelField: 'name', |
---|
66 | searchField: ['name'], |
---|
67 | plugins: ['remove_button'], |
---|
68 | create: true |
---|
69 | }); |
---|
70 | |
---|
71 | tagsCache.get(function(tags) { |
---|
72 | jQuery('[data-selectize=tags]').each(function() { |
---|
73 | this.selectize.load(function(callback) { |
---|
74 | callback(tags); |
---|
75 | }); |
---|
76 | |
---|
77 | jQuery.each(jQuery(this).data('value'), jQuery.proxy(function(i, tag) { |
---|
78 | this.selectize.addItem(tag.id); |
---|
79 | }, this)); |
---|
80 | }); |
---|
81 | }); |
---|
82 | |
---|
83 | {* <!-- DATEPICKER --> *} |
---|
84 | jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *} |
---|
85 | jQuery('[data-datepicker]').pwgDatepicker({ showTimepicker: true }); |
---|
86 | }); |
---|
87 | }()); |
---|
88 | {/footer_script} |
---|
89 | |
---|
90 | <h2>{$TITLE} › {'Edit photo'|@translate} {$TABSHEET_TITLE}</h2> |
---|
91 | |
---|
92 | <form action="{$F_ACTION}" method="post" id="catModify"> |
---|
93 | |
---|
94 | <fieldset> |
---|
95 | <legend>{'Informations'|@translate}</legend> |
---|
96 | |
---|
97 | <table> |
---|
98 | |
---|
99 | <tr> |
---|
100 | <td id="albumThumbnail"> |
---|
101 | <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail"> |
---|
102 | </td> |
---|
103 | <td id="albumLinks" style="width:400px;vertical-align:top;"> |
---|
104 | <ul style="padding-left:15px;margin:0;"> |
---|
105 | <li>{$INTRO.file}</li> |
---|
106 | <li>{$INTRO.add_date}</li> |
---|
107 | <li>{$INTRO.added_by}</li> |
---|
108 | <li>{$INTRO.size}</li> |
---|
109 | <li>{$INTRO.stats}</li> |
---|
110 | <li>{$INTRO.id}</li> |
---|
111 | </ul> |
---|
112 | </td> |
---|
113 | <td class="photoLinks"> |
---|
114 | <ul> |
---|
115 | {if isset($U_JUMPTO) } |
---|
116 | <li><a class="icon-eye" href="{$U_JUMPTO}">{'jump to photo'|@translate} →</a></li> |
---|
117 | {/if} |
---|
118 | {if !url_is_remote($PATH)} |
---|
119 | <li><a class="icon-arrows-cw" href="{$U_SYNC}">{'Synchronize metadata'|@translate}</a></li> |
---|
120 | |
---|
121 | <li><a class="icon-trash" href="{$U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');">{'delete photo'|@translate}</a></li> |
---|
122 | {/if} |
---|
123 | </ul> |
---|
124 | </td> |
---|
125 | </tr> |
---|
126 | </table> |
---|
127 | |
---|
128 | </fieldset> |
---|
129 | |
---|
130 | <fieldset> |
---|
131 | <legend>{'Properties'|@translate}</legend> |
---|
132 | |
---|
133 | <p> |
---|
134 | <strong>{'Title'|@translate}</strong> |
---|
135 | <br> |
---|
136 | <input type="text" class="large" name="name" value="{$NAME|@escape}"> |
---|
137 | </p> |
---|
138 | |
---|
139 | <p> |
---|
140 | <strong>{'Author'|@translate}</strong> |
---|
141 | <br> |
---|
142 | <input type="text" class="large" name="author" value="{$AUTHOR}"> |
---|
143 | </p> |
---|
144 | |
---|
145 | <p> |
---|
146 | <strong>{'Creation date'|@translate}</strong> |
---|
147 | <br> |
---|
148 | <input type="hidden" name="date_creation" value="{$DATE_CREATION}"> |
---|
149 | <label> |
---|
150 | <i class="icon-calendar"></i> |
---|
151 | <input type="text" data-datepicker="date_creation" data-datepicker-unset="date_creation_unset" readonly> |
---|
152 | </label> |
---|
153 | <a href="#" class="icon-cancel-circled" id="date_creation_unset">{'unset'|translate}</a> |
---|
154 | </p> |
---|
155 | |
---|
156 | <p> |
---|
157 | <strong>{'Linked albums'|@translate}</strong> |
---|
158 | <br> |
---|
159 | <select data-selectize="categories" data-value="{$associate_options_selected|@json_encode|escape:html}" |
---|
160 | name="associate[]" multiple style="width:600px;" ></select> |
---|
161 | </p> |
---|
162 | |
---|
163 | <p> |
---|
164 | <strong>{'Representation of albums'|@translate}</strong> |
---|
165 | <br> |
---|
166 | <select data-selectize="categories" data-value="{$represent_options_selected|@json_encode|escape:html}" |
---|
167 | name="represent[]" multiple style="width:600px;" ></select> |
---|
168 | </p> |
---|
169 | |
---|
170 | <p> |
---|
171 | <strong>{'Tags'|@translate}</strong> |
---|
172 | <br> |
---|
173 | <select data-selectize="tags" data-value="{$tag_selection|@json_encode|escape:html}" |
---|
174 | name="tags[]" multiple style="width:600px;" ></select> |
---|
175 | </p> |
---|
176 | |
---|
177 | <p> |
---|
178 | <strong>{'Description'|@translate}</strong> |
---|
179 | <br> |
---|
180 | <textarea name="description" id="description" class="description">{$DESCRIPTION}</textarea> |
---|
181 | </p> |
---|
182 | |
---|
183 | <p> |
---|
184 | <strong>{'Who can see this photo?'|@translate}</strong> |
---|
185 | <br> |
---|
186 | <select name="level" size="1"> |
---|
187 | {html_options options=$level_options selected=$level_options_selected} |
---|
188 | </select> |
---|
189 | </p> |
---|
190 | |
---|
191 | <p style="margin:40px 0 0 0"> |
---|
192 | <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="submit"> |
---|
193 | </p> |
---|
194 | </fieldset> |
---|
195 | |
---|
196 | </form> |
---|