Changeset 4811
- Timestamp:
- Feb 1, 2010, 11:57:13 AM (14 years ago)
- Location:
- extensions/upload_form
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/upload_form/language/en_UK/plugin.lang.php
r4807 r4811 35 35 $lang['Privacy level set to "%s"'] = 'Privacy level set to "%s"'; 36 36 $lang['Category "%s" now contains %d photos'] = 'Category "%s" now contains %d photos'; 37 $lang['Manage this set of %d photos'] = 'Manage this set of %d photos'; 37 38 ?> -
extensions/upload_form/language/fr_FR/plugin.lang.php
r4807 r4811 35 35 $lang['Privacy level set to "%s"'] = 'Niveau de confidentialité "%s"'; 36 36 $lang['Category "%s" now contains %d photos'] = 'La catégorie "%s" contient désormais %d photos'; 37 $lang['Manage this set of %d photos'] = 'Gérer ce lot de %d photos'; 37 38 ?> -
extensions/upload_form/upload.php
r4807 r4811 30 30 31 31 $admin_base_url = get_root_url().'admin.php?page=plugin§ion=upload_form%2Fupload.php'; 32 $thumbnails = array();33 32 34 33 // +-----------------------------------------------------------------------+ … … 36 35 // +-----------------------------------------------------------------------+ 37 36 check_status(ACCESS_ADMINISTRATOR); 37 38 // +-----------------------------------------------------------------------+ 39 // | batch management request | 40 // +-----------------------------------------------------------------------+ 41 42 if (isset($_GET['batch'])) 43 { 44 check_input_parameter('batch', $_GET['batch'], false, '/^\d+(,\d+)*$/'); 45 46 $query = ' 47 DELETE FROM '.CADDIE_TABLE.' 48 WHERE user_id = '.$user['id'].' 49 ;'; 50 pwg_query($query); 51 52 $inserts = array(); 53 foreach (explode(',', $_GET['batch']) as $image_id) 54 { 55 array_push( 56 $inserts, 57 array( 58 'user_id' => $user['id'], 59 'element_id' => $image_id, 60 ) 61 ); 62 } 63 mass_inserts( 64 CADDIE_TABLE, 65 array_keys($inserts[0]), 66 $inserts 67 ); 68 69 redirect(get_root_url().'admin.php?page=element_set&cat=caddie'); 70 } 38 71 39 72 // +-----------------------------------------------------------------------+ … … 77 110 } 78 111 } 79 112 113 $image_ids = array(); 114 $page['thumbnails'] = array(); 115 80 116 $starttime = get_moment(); 81 117 … … 93 129 $_POST['level'] 94 130 ); 131 132 array_push($image_ids, $image_id); 95 133 96 134 // TODO: if $image_id is not an integer, something went wrong … … 135 173 ; 136 174 137 array_push($ thumbnails, $thumbnail);175 array_push($page['thumbnails'], $thumbnail); 138 176 } 139 177 } … … 143 181 // printf('%.2f ms', $elapsed); 144 182 145 if (!empty($ thumbnails))183 if (!empty($page['thumbnails'])) 146 184 { 147 185 array_push( … … 149 187 sprintf( 150 188 l10n('%d photos uploaded'), 151 count($ thumbnails)189 count($page['thumbnails']) 152 190 ) 153 191 ); … … 187 225 ); 188 226 } 227 228 $page['batch_link'] = $admin_base_url.'&batch='.implode(',', $image_ids); 189 229 } 190 230 } … … 204 244 'F_ADD_ACTION'=> $admin_base_url, 205 245 'plugin_path' => UPLOAD_FORM_PATH, 206 'thumbnails' => $thumbnails,207 246 ) 208 247 ); 248 249 if (isset($page['thumbnails'])) 250 { 251 $template->assign( 252 array( 253 'thumbnails' => $page['thumbnails'], 254 ) 255 ); 256 257 // only display the batch link if we have more than 1 photo 258 if (count($page['thumbnails']) > 1) 259 { 260 $template->assign( 261 array( 262 'batch_link' => $page['batch_link'], 263 'batch_label' => sprintf( 264 l10n('Manage this set of %d photos'), 265 count($page['thumbnails']) 266 ), 267 ) 268 ); 269 } 270 } 209 271 210 272 $query = ' -
extensions/upload_form/upload.tpl
r4807 r4811 22 22 margin-bottom:2px; 23 23 padding:0; 24 } 25 26 #batchLink { 27 text-align:center; 24 28 } 25 29 </style> … … 50 54 {/foreach} 51 55 </div> 56 <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p> 52 57 </fieldset> 53 58 {/if}
Note: See TracChangeset
for help on using the changeset viewer.