fixed pod error in passing, update known pod issues
[bse.git] / site / templates / admin / article_img.tmpl
1 <:wrap admin/base.tmpl title=>"Image Wizard", js => "admin_edit.js" :>
2 <h1><:ifEq [article id] "-1":>Global<:or:><: articleType :><:eif:> Image Wizard</h1>
3 <:ifMessage:> 
4 <p><b><:message:> </b></p>
5 <:or:><:eif:>
6 <p>| <a href="/cgi-bin/admin/menu.pl">Admin menu</a> | 
7 <:switch:>
8 <:case Match [article generator] "Product":><a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit
9     product</a> | <a href="/cgi-bin/admin/shopadmin.pl">Manage catalogs</a>
10 <:case Eq [article id] [cfg articles shop]:><a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit shop</a>
11 <:case Eq [article id] "-1":><a href="/cgi-bin/admin/add.pl?id=<:article id:>">Edit sections</a>
12 <:case default:><a href="/cgi-bin/admin/add.pl?id=<:article id:>"><:ifMatch
13     [article generator] "Catalog":>Edit catalog<:or:>Edit article<:eif:></a>
14 <:endswitch:>
15 |
16 <:if Thumbs:><a href="<:script:>?id=<:article id:>&amp;_t=img&amp;f_showfull=1">Full size images</a> |<:or Thumbs:><:ifCanThumbs:><a href="<:script:>?id=<:article id:>&amp;_t=img">With Thumbnails</a> |<:or:><:eif:><:eif Thumbs:>
17 </p>
18 <:if UserCan edit_images_add:article:>
19 <h2>Add new image</h2>
20
21 <form method="post" action="<:script:>" enctype="multipart/form-data" name="add">
22
23 <input type="hidden" name="level" value="<: level :>" />
24 <input type="hidden" name="id" value="<: article id :>" />
25 <input type="hidden" name="parentid" value="<: article parentid :>" />
26 <input type="hidden" name="imgtype" value="<: articleType :>" />
27 <input type="hidden" name="_t" value="img" />
28 <:csrfp admin_add_image hidden:>
29         <table>
30           <tr> 
31             <th>Image file to add:</th>
32             <td> 
33               <input type="file" name="image" /> 
34             </td>
35             <td class="help"><:help image file:> <:error_img image:></td>
36           </tr>
37           <tr> 
38             <th>Alt text for image:</th>
39             <td> 
40               <input type="text" name="altIn" value="<:old altIn:>" />
41             </td>
42             <td class="help"><:help image alt:> <:error_img altIn:></td>
43           </tr>
44           <tr> 
45             <th>URL for image:</th>
46             <td> 
47               <input type="text" name="url" value="<:old url:>" />
48             </td>
49             <td class="help"><:help image url:> <:error_img url:></td>
50           </tr>
51           <tr> 
52             <th>Identifier for image:</th>
53             <td> 
54               <input type="text" name="name" value="<:old name:>" />
55             </td>
56             <td class="help"><:help image name:> <:error_img name:></td>
57           </tr>
58   <tr>
59     <th>Tags</th>
60     <td>
61       <input type="hidden" name="_save_tags" value="1" />
62       <div id="tags">
63       <:- .set tags = [ cgi.param("tags") ] :>
64       <:- .if tags.size == 0 :>
65         <:% tags.push("") :>
66       <:- .end if :>
67       <:.for tag in tags :>
68         <div class="tag"><input type="text" name="tags" value="<:= tag :>" /><:.call "error_img_n", "field":"tags", "index":loop.index :></div>
69       <:.end for:>
70       </div>
71     </td>
72     <td class="help"><:help edit tags:></td>
73   </tr>
74           <tr> 
75             <th>Storage:</th>
76             <td> 
77 <select name="storage">
78 <option value="">(Auto)</option>
79 <:iterator begin image_stores:>
80 <option value="<:image_store name:>"><:image_store description:></option>
81 <:iterator end image_stores:>
82 </select>
83             </td>
84             <td class="help"><:help image storage:> <:error_img storage:></td>
85           </tr>
86           <tr> 
87             <td  colspan="3" class="buttons"> 
88               <input type="submit" name="addimg" value="Add Image" />
89             </td>
90           </tr>
91         </table>
92 </form>
93 <:or UserCan:><:eif UserCan:>
94
95 <form method="post" action="<:script:>" enctype="multipart/form-data" name="manage">
96 <input type="hidden" name="level" value="<: level :>" />
97 <input type="hidden" name="id" value="<: article id :>" />
98 <input type="hidden" name="parentid" value="<: article parentid :>" />
99 <input type="hidden" name="imgtype" value="<: articleType :>" />
100 <input type="hidden" name="_t" value="img" />
101 <:csrfp admin_save_images hidden:>
102   <h2>Manage images</h2>
103
104         <table class="editform images">
105           <:if Images:><:if Eq [article id] "-1":><:or Eq:><:if Cfg basic auto_images 1:><tr> 
106             <th colspan="5">First Image Position</th>
107           </tr>
108                   <tr> 
109             <td colspan="5"> 
110 <input type="radio" name="imagePos" value="tl" <: ifEq [article imagePos] "tl":>checked<:eif:> />Top Left &nbsp;
111 <input type="radio" name="imagePos" value="tr"  <: ifEq [article imagePos] "tr":>checked<:eif:> />Top Right &nbsp;
112 <input type="radio" name="imagePos" value="bl"  <: ifEq [article imagePos] "bl":>checked<:eif:> />Bottom Left &nbsp;
113 <input type="radio" name="imagePos" value="br"  <: ifEq [article imagePos] "br":>checked<:eif:> />Bottom Right
114 <input type="radio" name="imagePos" value="xx"  <: ifEq [article imagePos] "xx":>checked<:eif:> />Don't automatically insert images
115
116 <:help image position:>
117
118             </td>
119           </tr><:eif Cfg:><:eif Eq:>
120 <:if Thumbs:>
121           <tr> 
122             <th>Image</th>
123             <th colspan="2"> &nbsp;</th>
124             <th class="col_modify"> Modify</th>
125             <th class="col_move"> Move</th>
126           </tr>
127 <:iterator begin images:>
128         <tr>
129           <td rowspan="5" class="col_thumbnail"><a href="#" onclick="window.open('<:image src:>', 'fullimage', 'width=<:arithmetic [image width]+20:>,height=<:arithmetic [image height] + 30:>,location=no,status=no,menubar=no,scrollbars=yes'); return false;"><:thumbimage editor:></a></td>
130             <th>Alt text:</th>
131             <td class="col_field"> 
132               <:ifUserCan edit_images_save:article:><input type="text" name="alt<:image id:>" value="<: oldi [concatenate alt [image id] ] 0 image alt :>" size="32" /><:or:><: image alt :><:eif:>
133             </td>
134             <td class="col_modify" rowspan="5"> 
135               <:ifUserCan edit_images_delete:article:><b><a href="<:script:>?id=<:article id:>&amp;removeimg_<: image id :>=1&amp;_t=img&amp;_csrfp=<:csrfp admin_remove_image:>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:or:><:eif:>
136 <:ifUserCan edit_images_save:article:><a href="<:script:>?a_edit_image=1&amp;id=<:article id:>&amp;image_id=<: image id :>">Edit</a><:or:><:eif:></td>
137             <td class="col_move" rowspan="5"><:imgmove:></td>
138           </tr>
139           <tr>        
140             <th>URL:</th>
141             <td class="col_field"> 
142               <:ifUserCan edit_images_save:article:><input type="text" name="url<:image id:>" value="<: oldi [concatenate url [image id] ] 0 image url :>" size="32" /><:or:><: image url :><:eif:>
143             </td>
144           </tr>
145           <tr>
146             <th>Identifier:</th>
147             <td class="col_field"> 
148               <:ifUserCan edit_images_save:article:><input type="text" name="name<:image id:>" value="<: oldi [concatenate name [image id] ] 0 image name :>" size="32" /> <:error_img [concatenate "name" [image id] ]:><:or:><: image name :><:eif:>
149             </td>
150         </tr>
151           <tr>
152             <th>Image file:</th>
153             <td class="col_field"> 
154               <:ifUserCan edit_images_save:article:><input type="file" name="image<:image id:>" size="32" /> <:error_img [concatenate "image" [image id] ]:><:or:><: image displayName :><:eif:>
155             </td>
156         </tr>
157           <tr>
158             <th>Stored:</th>
159             <td class="col_field"> 
160               <:ifUserCan edit_images_save:article:><select name="storage<:image id:>">
161 <option value="">(Auto)</option>
162 <:iterator begin image_stores:>
163 <option value="<:image_store name:>" <:ifEq [oldi [concatenate storage [image id] ] 0 image storage] [image_store name]:>selected="selected"<:or:><:eif:>><:image_store description:></option>
164 <:iterator end image_stores:>
165 </select><:error_img [concatenate "storage" [image id] ]:><:or:><: image storage :><:eif:>
166             </td>
167         </tr>
168 <:iterator end images:>          
169 <:or Thumbs:>
170           <tr> 
171             <th colspan="5">Image</th>
172           </tr>
173           <: iterator begin images :> 
174           <tr> 
175             <td class="col_image" colspan="5"><:image:></td>
176           </tr>
177           <tr> 
178             <th> Alt Text</th>
179             <th class="col_url"> URL</th>
180             <th> Identifier</th>
181             <th class="col_modify"> Modify</th>
182                         <th class="col_move"> Move</th>
183           </tr>
184           <tr> 
185             <td> 
186               <:ifUserCan edit_images_save:article:><input type="text" name="alt<:image id:>" value="<: oldi [concatenate alt [image id] ] 0 image alt :>" size="32" /><:or:><: image alt :><:eif:>
187             </td>
188             <td class="col_url"> 
189               <:ifUserCan edit_images_save:article:><input type="text" name="url<:image id:>" value="<: oldi [concatenate url [image id] ] 0 image url :>" size="32" /><:or:><: image url :><:eif:>
190             </td>
191             <td class="col_identifier"> 
192               <:ifUserCan edit_images_save:article:><input type="text" name="name<:image id:>" value="<: oldi [concatenate name [image id] ] 0 image name :>" size="32" /> <:error_img [concatenate "name" [image id] ]:><:or:><: image name :><:eif:>
193             </td>
194             <td class="col_modify"> 
195               <:ifUserCan edit_images_delete:article:><b><a href="<:script:>?id=<:article id:>&amp;removeimg_<: image id :>=1&amp;_t=img&amp;_csrfp=<:csrfp admin_remove_image:>" onClick="return window.confirm('Are you sure you want to delete this Image')">Delete</a></b><:or:><:eif:></td>
196             <td class="col_move"><:imgmove:></td>
197           </tr>
198           <: iterator separator images :> 
199           <tr> 
200             <td colspan="5">&nbsp;</td>
201           </tr>
202           <: iterator end images :> 
203 <:eif Thumbs:>
204 <:ifUserCan edit_images_save:article:>
205           <tr> 
206             <td colspan="5" class="buttons"> 
207               <input type="submit" name="process" value="Save changes" />
208             </td>
209           </tr>
210 <:or:><:eif:>
211                   <:or Images:><tr><td colspan="5" align="center" bgcolor="#FFFFFF"><:if Eq [article id] "-1":>There are no global images<:or Eq:>No images
212                       are attached to this article<:eif Eq:></td>
213           </tr><:eif Images:>
214         </table>
215
216   <p>
217     <input type="submit" name="back" value=" &lt;&lt;  Back  " />
218   </p>
219
220 </form>