Changeset 25018 for trunk/admin/include/photos_add_direct_process.inc.php
- Timestamp:
- Oct 19, 2013, 7:43:04 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/photos_add_direct_process.inc.php
r19703 r25018 35 35 if (!isset($_POST['submit_upload'])) 36 36 { 37 array_push( 38 $page['errors'], 39 sprintf( 40 l10n('The uploaded files exceed the post_max_size directive in php.ini: %sB'), 41 ini_get('post_max_size') 42 ) 37 $page['errors'][] = l10n( 38 'The uploaded files exceed the post_max_size directive in php.ini: %sB', 39 ini_get('post_max_size') 43 40 ); 44 41 } … … 52 49 foreach ($_POST['onUploadError'] as $error) 53 50 { 54 array_push($page['errors'], $error);51 $page['errors'][] = $error; 55 52 } 56 53 } … … 98 95 if (is_valid_image_extension(pathinfo($node['filename'], PATHINFO_EXTENSION))) 99 96 { 100 array_push($indexes_to_extract, $node['index']);97 $indexes_to_extract[] = $node['index']; 101 98 102 array_push( 103 $images_to_add, 104 array( 105 'source_filepath' => $upload_dir.'/'.$temporary_archive_name.'/'.$node['filename'], 106 'original_filename' => basename($node['filename']), 107 ) 99 $images_to_add[] = array( 100 'source_filepath' => $upload_dir.'/'.$temporary_archive_name.'/'.$node['filename'], 101 'original_filename' => basename($node['filename']), 108 102 ); 109 103 } … … 122 116 elseif (is_valid_image_extension($extension)) 123 117 { 124 array_push( 125 $images_to_add, 126 array( 127 'source_filepath' => $_FILES['image_upload']['tmp_name'][$idx], 128 'original_filename' => $_FILES['image_upload']['name'][$idx], 129 ) 118 $images_to_add[] = array( 119 'source_filepath' => $_FILES['image_upload']['tmp_name'][$idx], 120 'original_filename' => $_FILES['image_upload']['name'][$idx], 130 121 ); 131 122 } … … 140 131 ); 141 132 142 array_push($image_ids, $image_id);133 $image_ids[] = $image_id; 143 134 144 135 // TODO: if $image_id is not an integer, something went wrong … … 149 140 $error_message = file_upload_error_message($error); 150 141 151 array_push( 152 $page['errors'], 153 sprintf( 154 l10n('Error on file "%s" : %s'), 155 $_FILES['image_upload']['name'][$idx], 156 $error_message 157 ) 142 $page['errors'][] = l10n( 143 'Error on file "%s" : %s', 144 $_FILES['image_upload']['name'][$idx], 145 $error_message 158 146 ); 159 147 } … … 173 161 foreach ($_SESSION['uploads_error'][ $_POST['upload_id'] ] as $error) 174 162 { 175 array_push($page['errors'], $error);163 $page['errors'][] = $error; 176 164 } 177 165 } … … 217 205 $thumbnail['link'] = get_root_url().'admin.php?page=photo-'.$image_id.'&cat_id='.$category_id; 218 206 219 array_push($page['thumbnails'], $thumbnail);207 $page['thumbnails'][] = $thumbnail; 220 208 } 221 209 222 210 if (!empty($page['thumbnails'])) 223 211 { 224 array_push( 225 $page['infos'], 226 sprintf( 227 l10n('%d photos uploaded'), 228 count($page['thumbnails']) 229 ) 230 ); 212 $page['infos'][] = l10n('%d photos uploaded', count($page['thumbnails'])); 231 213 232 214 if (0 != $_POST['level']) 233 215 { 234 array_push( 235 $page['infos'], 236 sprintf( 237 l10n('Privacy level set to "%s"'), 238 l10n( 239 sprintf('Level %d', $_POST['level']) 240 ) 241 ) 216 $page['infos'][] = l10n( 217 'Privacy level set to "%s"', 218 l10n(sprintf('Level %d', $_POST['level'])) 242 219 ); 243 220 } … … 253 230 254 231 // information 255 array_push( 256 $page['infos'], 257 sprintf( 258 l10n('Album "%s" now contains %d photos'), 259 '<em>'.$category_name.'</em>', 260 $count 261 ) 232 $page['infos'][] = l10n( 233 'Album "%s" now contains %d photos', 234 '<em>'.$category_name.'</em>', 235 $count 262 236 ); 263 237
Note: See TracChangeset
for help on using the changeset viewer.