improve validation and error reporting for article tags
[bse.git] / site / templates / admin / article_img.tmpl
CommitLineData
8a3b8db8 1<:wrap admin/base.tmpl title=>"Image Wizard" :>
daee3409 2<h1><:ifEq [article id] "-1":>Global<:or:><: articleType :><:eif:> Image Wizard</h1>
35c0719f
TC
3<:ifMessage:>
4<p><b><:message:> </b></p>
5<:or:><:eif:>
daee3409
TC
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:>
ab2cd916
TC
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:>
35c0719f 19<h2>Add new image</h2>
f5d30ab9 20
de30d08a 21<form method="post" action="<:script:>" enctype="multipart/form-data" name="add">
f5d30ab9 22
d09682dd
TC
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 :>" />
cc9019d1 27<input type="hidden" name="_t" value="img" />
aa6896b6 28<:csrfp admin_add_image hidden:>
8a3b8db8 29 <table>
f5d30ab9 30 <tr>
8a3b8db8
TC
31 <th>Image file to add:</th>
32 <td>
d09682dd 33 <input type="file" name="image" />
f5d30ab9 34 </td>
8a3b8db8 35 <td class="help"><:help image file:> <:error_img image:></td>
f5d30ab9
TC
36 </tr>
37 <tr>
8a3b8db8
TC
38 <th>Alt text for image:</th>
39 <td>
d09682dd 40 <input type="text" name="altIn" value="<:old altIn:>" />
f5d30ab9 41 </td>
8a3b8db8 42 <td class="help"><:help image alt:> <:error_img altIn:></td>
f5d30ab9 43 </tr>
5c5c6eb6 44 <tr>
8a3b8db8
TC
45 <th>URL for image:</th>
46 <td>
d09682dd 47 <input type="text" name="url" value="<:old url:>" />
5c5c6eb6 48 </td>
8a3b8db8 49 <td class="help"><:help image url:> <:error_img url:></td>
5c5c6eb6 50 </tr>
4772671f 51 <tr>
8a3b8db8
TC
52 <th>Identifier for image:</th>
53 <td>
d09682dd 54 <input type="text" name="name" value="<:old name:>" />
4772671f 55 </td>
8a3b8db8 56 <td class="help"><:help image name:> <:error_img name:></td>
4772671f 57 </tr>
e63c3728 58 <tr>
8a3b8db8
TC
59 <th>Storage:</th>
60 <td>
e63c3728
TC
61<select name="storage">
62<option value="">(Auto)</option>
63<:iterator begin image_stores:>
64<option value="<:image_store name:>"><:image_store description:></option>
65<:iterator end image_stores:>
66</select>
67 </td>
8a3b8db8 68 <td class="help"><:help image storage:> <:error_img storage:></td>
e63c3728 69 </tr>
f5d30ab9 70 <tr>
8a3b8db8 71 <td colspan="3" class="buttons">
d09682dd 72 <input type="submit" name="addimg" value="Add Image" />
f5d30ab9
TC
73 </td>
74 </tr>
75 </table>
99ef7979 76</form>
abf5bbc6 77<:or UserCan:><:eif UserCan:>
99ef7979 78
de30d08a 79<form method="post" action="<:script:>" enctype="multipart/form-data" name="manage">
d09682dd
TC
80<input type="hidden" name="level" value="<: level :>" />
81<input type="hidden" name="id" value="<: article id :>" />
82<input type="hidden" name="parentid" value="<: article parentid :>" />
83<input type="hidden" name="imgtype" value="<: articleType :>" />
cc9019d1 84<input type="hidden" name="_t" value="img" />
aa6896b6 85<:csrfp admin_save_images hidden:>
35c0719f 86 <h2>Manage images</h2>
f5d30ab9 87
8a3b8db8 88 <table class="editform images">
1e60d3c4 89 <:if Images:><:if Eq [article id] "-1":><:or Eq:><:if Cfg basic auto_images 1:><tr>
8a3b8db8 90 <th colspan="5">First Image Position</th>
35c0719f 91 </tr>
759c295d 92 <tr>
8a3b8db8 93 <td colspan="5">
1e60d3c4
TC
94<input type="radio" name="imagePos" value="tl" <: ifEq [article imagePos] "tl":>checked<:eif:> />Top Left &nbsp;
95<input type="radio" name="imagePos" value="tr" <: ifEq [article imagePos] "tr":>checked<:eif:> />Top Right &nbsp;
96<input type="radio" name="imagePos" value="bl" <: ifEq [article imagePos] "bl":>checked<:eif:> />Bottom Left &nbsp;
97<input type="radio" name="imagePos" value="br" <: ifEq [article imagePos] "br":>checked<:eif:> />Bottom Right
98<input type="radio" name="imagePos" value="xx" <: ifEq [article imagePos] "xx":>checked<:eif:> />Don't automatically insert images
99
100<:help image position:>
08123550 101
ca9aa2bf 102 </td>
1e60d3c4 103 </tr><:eif Cfg:><:eif Eq:>
ab2cd916 104<:if Thumbs:>
8a3b8db8 105 <tr>
ab2cd916
TC
106 <th>Image</th>
107 <th colspan="2"> &nbsp;</th>
8a3b8db8
TC
108 <th class="col_modify"> Modify</th>
109 <th class="col_move"> Move</th>
ab2cd916
TC
110 </tr>
111<:iterator begin images:>
112 <tr>
8a3b8db8 113 <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>
ab2cd916 114 <th>Alt text:</th>
8a3b8db8 115 <td class="col_field">
b95fc3a0 116 <: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:>
ab2cd916 117 </td>
8a3b8db8 118 <td class="col_modify" rowspan="5">
aa6896b6 119 <: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:>
8a3b8db8
TC
120<: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>
121 <td class="col_move" rowspan="5"><:imgmove:></td>
ab2cd916
TC
122 </tr>
123 <tr>
124 <th>URL:</th>
8a3b8db8 125 <td class="col_field">
b95fc3a0 126 <: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:>
ab2cd916
TC
127 </td>
128 </tr>
129 <tr>
130 <th>Identifier:</th>
8a3b8db8 131 <td class="col_field">
b95fc3a0
TC
132 <: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:>
133 </td>
134 </tr>
135 <tr>
136 <th>Image file:</th>
8a3b8db8 137 <td class="col_field">
b95fc3a0 138 <:ifUserCan edit_images_save:article:><input type="file" name="image<:image id:>" size="32" /> <:error_img [concatenate "image" [image id] ]:><:or:><: image displayName :><:eif:>
ab2cd916
TC
139 </td>
140 </tr>
e63c3728
TC
141 <tr>
142 <th>Stored:</th>
8a3b8db8 143 <td class="col_field">
e63c3728
TC
144 <:ifUserCan edit_images_save:article:><select name="storage<:image id:>">
145<option value="">(Auto)</option>
146<:iterator begin image_stores:>
147<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>
148<:iterator end image_stores:>
149</select><:error_img [concatenate "storage" [image id] ]:><:or:><: image storage :><:eif:>
150 </td>
151 </tr>
ab2cd916
TC
152<:iterator end images:>
153<:or Thumbs:>
8a3b8db8 154 <tr>
4772671f 155 <th colspan="5">Image</th>
27feb834 156 </tr>
ca9aa2bf 157 <: iterator begin images :>
8a3b8db8
TC
158 <tr>
159 <td class="col_image" colspan="5"><:image:></td>
35c0719f 160 </tr>
8a3b8db8 161 <tr>
08123550 162 <th> Alt Text</th>
8a3b8db8 163 <th class="col_url"> URL</th>
4772671f 164 <th> Identifier</th>
8a3b8db8
TC
165 <th class="col_modify"> Modify</th>
166 <th class="col_move"> Move</th>
35c0719f 167 </tr>
8a3b8db8
TC
168 <tr>
169 <td>
b95fc3a0 170 <: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:>
27feb834 171 </td>
8a3b8db8 172 <td class="col_url">
b95fc3a0 173 <: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:>
27feb834 174 </td>
8a3b8db8 175 <td class="col_identifier">
b95fc3a0 176 <: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:>
4772671f 177 </td>
8a3b8db8 178 <td class="col_modify">
aa6896b6 179 <: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>
8a3b8db8 180 <td class="col_move"><:imgmove:></td>
27feb834 181 </tr>
ca9aa2bf 182 <: iterator separator images :>
8a3b8db8 183 <tr>
4772671f 184 <td colspan="5">&nbsp;</td>
27feb834 185 </tr>
ca9aa2bf 186 <: iterator end images :>
ab2cd916 187<:eif Thumbs:>
1df3b258 188<:ifUserCan edit_images_save:article:>
27feb834 189 <tr>
8a3b8db8 190 <td colspan="5" class="buttons">
d09682dd 191 <input type="submit" name="process" value="Save changes" />
27feb834 192 </td>
abf5bbc6
TC
193 </tr>
194<:or:><:eif:>
daee3409
TC
195 <:or Images:><tr><td colspan="5" align="center" bgcolor="#FFFFFF"><:if Eq [article id] "-1":>There are no global images<:or Eq:>No images
196 are attached to this article<:eif Eq:></td>
759c295d 197 </tr><:eif Images:>
27feb834 198 </table>
f5d30ab9
TC
199
200 <p>
d09682dd 201 <input type="submit" name="back" value=" &lt;&lt; Back " />
35c0719f 202 </p>
f5d30ab9
TC
203
204</form>