Changeset 25018
- Timestamp:
- Oct 19, 2013, 7:43:04 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 89 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/album_notification.php
r25005 r25018 114 114 list($group_name) = pwg_db_fetch_row(pwg_query($query)); 115 115 116 array_push( 117 $page['infos'], 118 l10n( 119 'An information email was sent to group "%s"', 120 $group_name 121 ) 122 ); 116 $page['infos'][] = l10n('An information email was sent to group "%s"', $group_name); 123 117 } 124 118 -
trunk/admin/batch_manager.php
r24835 r25018 178 178 WHERE user_id = '.$user['id'].' 179 179 ;'; 180 array_push( 181 $filter_sets, 182 array_from_query($query, 'element_id') 183 ); 180 $filter_sets[] = array_from_query($query, 'element_id'); 184 181 185 182 break; … … 191 188 WHERE user_id = '.$user['id'].' 192 189 ;'; 193 array_push( 194 $filter_sets, 195 array_from_query($query, 'image_id') 196 ); 190 $filter_sets[] = array_from_query($query, 'image_id'); 197 191 198 192 break; … … 211 205 WHERE date_available BETWEEN '.pwg_db_get_recent_period_expression(1, $row['date']).' AND \''.$row['date'].'\' 212 206 ;'; 213 array_push( 214 $filter_sets, 215 array_from_query($query, 'id') 216 ); 207 $filter_sets[] = array_from_query($query, 'id'); 217 208 } 218 209 … … 243 234 } 244 235 245 array_push( 246 $filter_sets, 247 array_diff($all_elements, $linked_to_virtual) 248 ); 236 $filter_sets[] = array_diff($all_elements, $linked_to_virtual); 249 237 250 238 break; … … 258 246 WHERE category_id is null 259 247 ;'; 260 array_push( 261 $filter_sets, 262 array_from_query($query, 'id') 263 ); 248 $filter_sets[] = array_from_query($query, 'id'); 264 249 265 250 break; … … 273 258 WHERE tag_id is null 274 259 ;'; 275 array_push( 276 $filter_sets, 277 array_from_query($query, 'id') 278 ); 260 $filter_sets[] = array_from_query($query, 'id'); 279 261 280 262 break; … … 298 280 WHERE file IN (\''.implode("','", $duplicate_files).'\') 299 281 ;'; 300 301 array_push( 302 $filter_sets, 303 array_from_query($query, 'id') 304 ); 282 $filter_sets[] = array_from_query($query, 'id'); 305 283 306 284 break; … … 338 316 WHERE category_id IN ('.implode(',', $categories).') 339 317 ;'; 340 array_push( 341 $filter_sets, 342 array_from_query($query, 'image_id') 343 ); 318 $filter_sets[] = array_from_query($query, 'image_id'); 344 319 } 345 320 … … 363 338 if (!empty($_SESSION['bulk_manager_filter']['tags'])) 364 339 { 365 array_push( 366 $filter_sets, 367 get_image_ids_for_tags( 368 $_SESSION['bulk_manager_filter']['tags'], 369 $_SESSION['bulk_manager_filter']['tag_mode'], 370 null, 371 null, 372 false // we don't apply permissions in administration screens 373 ) 340 $filter_sets[] = get_image_ids_for_tags( 341 $_SESSION['bulk_manager_filter']['tags'], 342 $_SESSION['bulk_manager_filter']['tag_mode'], 343 null, 344 null, 345 false // we don't apply permissions in administration screens 374 346 ); 375 347 } -
trunk/admin/batch_manager_global.php
r25005 r25018 83 83 if (count($collection) == 0) 84 84 { 85 array_push($page['errors'], l10n('Select at least one photo'));85 $page['errors'][] = l10n('Select at least one photo'); 86 86 } 87 87 … … 106 106 if (empty($_POST['add_tags'])) 107 107 { 108 array_push($page['errors'], l10n('Select at least one tag'));108 $page['errors'][] = l10n('Select at least one tag'); 109 109 } 110 110 else … … 134 134 else 135 135 { 136 array_push($page['errors'], l10n('Select at least one tag'));136 $page['errors'][] = l10n('Select at least one tag'); 137 137 } 138 138 } … … 242 242 foreach ($collection as $image_id) 243 243 { 244 array_push( 245 $datas, 246 array( 247 'id' => $image_id, 248 'author' => $_POST['author'] 249 ) 244 $datas[] = array( 245 'id' => $image_id, 246 'author' => $_POST['author'] 250 247 ); 251 248 } … … 269 266 foreach ($collection as $image_id) 270 267 { 271 array_push( 272 $datas, 273 array( 274 'id' => $image_id, 275 'name' => $_POST['title'] 276 ) 268 $datas[] = array( 269 'id' => $image_id, 270 'name' => $_POST['title'] 277 271 ); 278 272 } … … 303 297 foreach ($collection as $image_id) 304 298 { 305 array_push( 306 $datas, 307 array( 308 'id' => $image_id, 309 'date_creation' => $date_creation 310 ) 299 $datas[] = array( 300 'id' => $image_id, 301 'date_creation' => $date_creation 311 302 ); 312 303 } … … 325 316 foreach ($collection as $image_id) 326 317 { 327 array_push( 328 $datas, 329 array( 330 'id' => $image_id, 331 'level' => $_POST['level'] 332 ) 318 $datas[] = array( 319 'id' => $image_id, 320 'level' => $_POST['level'] 333 321 ); 334 322 } … … 363 351 if ($deleted_count > 0) 364 352 { 365 $_SESSION['page_infos'] = array( 366 sprintf( 367 l10n_dec( 368 '%d photo was deleted', 369 '%d photos were deleted', 370 $deleted_count 371 ), 372 $deleted_count 373 ) 353 $_SESSION['page_infos'][] = l10n_dec( 354 '%d photo was deleted', '%d photos were deleted', 355 $deleted_count 374 356 ); 375 357 … … 379 361 else 380 362 { 381 array_push($page['errors'], l10n('No photo can be deleted'));363 $page['errors'][] = l10n('No photo can be deleted'); 382 364 } 383 365 } 384 366 else 385 367 { 386 array_push($page['errors'], l10n('You need to confirm deletion'));368 $page['errors'][] = l10n('You need to confirm deletion'); 387 369 } 388 370 } … … 392 374 { 393 375 sync_metadata($collection); 394 395 array_push( 396 $page['infos'], 397 l10n('Metadata synchronized from file') 398 ); 376 $page['infos'][] = l10n('Metadata synchronized from file'); 399 377 } 400 378 … … 416 394 { 417 395 if ($_POST['regenerateSuccess'] != '0') 418 array_push($page['infos'], l10n('%s photos have been regenerated', $_POST['regenerateSuccess'])); 419 396 { 397 $page['infos'][] = l10n('%s photos have been regenerated', $_POST['regenerateSuccess']); 398 } 420 399 if ($_POST['regenerateError'] != '0') 421 array_push($page['warnings'], l10n('%s photos can not be regenerated', $_POST['regenerateError'])); 422 400 { 401 $page['warnings'][] = l10n('%s photos can not be regenerated', $_POST['regenerateError']); 402 } 423 403 } 424 404 … … 445 425 if ($conf['enable_synchronization']) 446 426 { 447 array_push($prefilters, 448 array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album')) 449 ); 427 $prefilters[] = array('ID' => 'no_virtual_album', 'NAME' => l10n('With no virtual album')); 450 428 } 451 429 -
trunk/admin/batch_manager_unit.php
r19703 r25018 104 104 } 105 105 106 array_push($datas, $data);106 $datas[] = $data; 107 107 108 108 // tags management … … 124 124 ); 125 125 126 array_push($page['infos'], l10n('Photo informations updated'));126 $page['infos'][] = l10n('Photo informations updated'); 127 127 } 128 128 … … 233 233 while ($row = pwg_db_fetch_assoc($result)) 234 234 { 235 array_push($element_ids, $row['id']);235 $element_ids[] = $row['id']; 236 236 237 237 $src_image = new SrcImage($row); -
trunk/admin/cat_list.php
r24985 r25018 79 79 } 80 80 81 array_push($datas, array('id' => $id, 'rank' => $current_rank));81 $datas[] = array('id' => $id, 'rank' => $current_rank); 82 82 } 83 83 $fields = array('primary' => array('id'), 'update' => array('rank')); … … 134 134 if (isset($output_create['error'])) 135 135 { 136 array_push($page['errors'], $output_create['error']);136 $page['errors'][] = $output_create['error']; 137 137 } 138 138 else 139 139 { 140 array_push($page['infos'], $output_create['info']);140 $page['infos'][] = $output_create['info']; 141 141 } 142 142 } … … 147 147 save_categories_order(array_keys($_POST['catOrd'])); 148 148 149 array_push( 150 $page['infos'], 151 l10n('Album manual order was saved') 152 ); 149 $page['infos'][] = l10n('Album manual order was saved'); 153 150 } 154 151 else if (isset($_POST['submitAutoOrder'])) … … 179 176 while ($row = pwg_db_fetch_assoc($result)) 180 177 { 181 array_push( 182 $categories, 183 array( 184 'id' => $row['id'], 185 'id_uppercat' => $row['id_uppercat'], 186 ) 178 $categories[] = array( 179 'id' => $row['id'], 180 'id_uppercat' => $row['id_uppercat'], 187 181 ); 188 array_push( 189 $names, 190 $row['name'] 191 ); 182 $names[] = $row['name']; 192 183 } 193 184 … … 200 191 save_categories_order($categories); 201 192 202 array_push( 203 $page['infos'], 204 l10n('Albums automatically sorted') 205 ); 193 $page['infos'][] = l10n('Albums automatically sorted'); 206 194 } 207 195 -
trunk/admin/cat_move.php
r19703 r25018 52 52 else 53 53 { 54 array_push( 55 $page['errors'], 56 l10n('Select at least one album') 57 ); 54 $page['errors'][] = l10n('Select at least one album'); 58 55 } 59 56 } -
trunk/admin/cat_perm.php
r23430 r25018 126 126 while ($row = pwg_db_fetch_assoc($result)) 127 127 { 128 array_push($granteds[$row['cat_id']], $row['group_id']);128 $granteds[ $row['cat_id'] ][] = $row['group_id']; 129 129 } 130 130 … … 136 136 foreach ($group_ids as $group_id) 137 137 { 138 array_push( 139 $inserts, 140 array( 141 'group_id' => $group_id, 142 'cat_id' => $cat_id 143 ) 138 $inserts[] = array( 139 'group_id' => $group_id, 140 'cat_id' => $cat_id 144 141 ); 145 142 } … … 191 188 } 192 189 193 array_push($page['infos'], l10n('Album updated successfully'));190 $page['infos'][] = l10n('Album updated successfully'); 194 191 } 195 192 … … 273 270 while ($row = pwg_db_fetch_assoc($result)) 274 271 { 275 if (!isset($granted_groups[ $row['group_id']]))276 { 277 $granted_groups[ $row['group_id']] = array();278 } 279 array_push($granted_groups[$row['group_id']], $row['user_id']);272 if (!isset($granted_groups[ $row['group_id'] ])) 273 { 274 $granted_groups[ $row['group_id'] ] = array(); 275 } 276 $granted_groups[ $row['group_id'] ][] = $row['user_id']; 280 277 } 281 278 … … 303 300 if (in_array($user_id, $user_granted_indirect_ids)) 304 301 { 305 array_push($group_usernames, $users[$user_id]);302 $group_usernames[] = $users[$user_id]; 306 303 } 307 304 } -
trunk/admin/comments.php
r19703 r25018 42 42 if (empty($_POST['comments'])) 43 43 { 44 array_push( 45 $page['errors'], 46 l10n('Select at least one comment') 47 ); 44 $page['errors'][] = l10n('Select at least one comment'); 48 45 } 49 46 else … … 56 53 validate_user_comment($_POST['comments']); 57 54 58 array_push( 59 $page['infos'], 60 l10n_dec( 61 '%d user comment validated', '%d user comments validated', 62 count($_POST['comments']) 63 ) 55 $page['infos'][] = l10n_dec( 56 '%d user comment validated', '%d user comments validated', 57 count($_POST['comments']) 64 58 ); 65 59 } … … 69 63 delete_user_comment($_POST['comments']); 70 64 71 array_push( 72 $page['infos'], 73 l10n_dec( 74 '%d user comment rejected', '%d user comments rejected', 75 count($_POST['comments']) 76 ) 65 $page['infos'][] = l10n_dec( 66 '%d user comment rejected', '%d user comments rejected', 67 count($_POST['comments']) 77 68 ); 78 69 } … … 149 140 ); 150 141 151 array_push($list, $row['id']);142 $list[] = $row['id']; 152 143 } 153 144 -
trunk/admin/configuration.php
r23813 r25018 155 155 if ( !count($_POST['order_by']) ) 156 156 { 157 array_push($page['errors'], l10n('No order field selected'));157 $page['errors'][] = l10n('No order field selected'); 158 158 } 159 159 else … … 180 180 else 181 181 { 182 array_push($page['errors'], l10n('No order field selected'));182 $page['errors'][] = l10n('No order field selected'); 183 183 } 184 184 } … … 208 208 or $_POST['nb_comment_page'] > 50) 209 209 { 210 array_push($page['errors'], l10n('The number of comments a page must be between 5 and 50 included.'));210 $page['errors'][] = l10n('The number of comments a page must be between 5 and 50 included.'); 211 211 } 212 212 foreach( $comments_checkboxes as $checkbox) … … 226 226 or $_POST['nb_categories_page'] < 4) 227 227 { 228 array_push($page['errors'], l10n('The number of albums a page must be above 4.'));228 $page['errors'][] = l10n('The number of albums a page must be above 4.'); 229 229 } 230 230 foreach( $display_checkboxes as $checkbox) … … 269 269 } 270 270 } 271 array_push($page['infos'], l10n('Information data registered in database'));271 $page['infos'][] = l10n('Information data registered in database'); 272 272 } 273 273 … … 283 283 clear_derivative_cache(); 284 284 285 array_push( 286 $page['infos'], 287 l10n('Your configuration settings are saved') 288 ); 285 $page['infos'][] = l10n('Your configuration settings are saved'); 289 286 } 290 287 … … 325 322 if (order_by_is_local()) 326 323 { 327 array_push($page['warnings'], l10n('You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !'));324 $page['warnings'][] = l10n('You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !'); 328 325 } 329 326 … … 401 398 // Reload user 402 399 $edit_user = build_user($conf['guest_id'], false); 403 array_push($page['infos'], l10n('Information data registered in database'));400 $page['infos'][] = l10n('Information data registered in database'); 404 401 } 405 402 $page['errors'] = array_merge($page['errors'], $errors); -
trunk/admin/element_set_ranks.php
r23813 r25018 65 65 foreach ($images as $id) 66 66 { 67 array_push( 68 $datas, 69 array( 70 'category_id' => $category_id, 71 'image_id' => $id, 72 'rank' => ++$current_rank, 73 ) 67 $datas[] = array( 68 'category_id' => $category_id, 69 'image_id' => $id, 70 'rank' => ++$current_rank, 74 71 ); 75 72 } … … 99 96 ); 100 97 101 array_push( 102 $page['infos'], 103 l10n('Images manual order was saved') 104 ); 98 $page['infos'][] = l10n('Images manual order was saved'); 105 99 } 106 100 … … 144 138 } 145 139 146 array_push($page['infos'], l10n('Your configuration settings are saved'));140 $page['infos'][] = l10n('Your configuration settings are saved'); 147 141 } 148 142 -
trunk/admin/extend_for_templates.php
r21567 r25018 150 150 if (pwg_query($query)) 151 151 { 152 array_push($page['infos'], 153 l10n('Templates configuration has been recorded.')); 152 $page['infos'][] = l10n('Templates configuration has been recorded.'); 154 153 } 155 154 } -
trunk/admin/group_list.php
r25005 r25018 46 46 if (empty($_POST['groupname'])) 47 47 { 48 array_push($page['errors'], l10n('The name of a group must not contain " or \' or be empty.'));48 $page['errors'][] = l10n('The name of a group must not contain " or \' or be empty.'); 49 49 } 50 50 if (count($page['errors']) == 0) … … 59 59 if ($count != 0) 60 60 { 61 array_push($page['errors'], l10n('This name is already used by another group.'));61 $page['errors'][] = l10n('This name is already used by another group.'); 62 62 } 63 63 } … … 87 87 if (count($groups) == 0) 88 88 { 89 array_push($page['errors'], l10n('Select at least one group'));89 $page['errors'][] = l10n('Select at least one group'); 90 90 } 91 91 … … 170 170 if ($count != 0) 171 171 { 172 array_push($page['errors'], l10n('This name is already used by another group.'));172 $page['errors'][] = l10n('This name is already used by another group.'); 173 173 } 174 174 else … … 256 256 if ($count != 0) 257 257 { 258 array_push($page['errors'], l10n('This name is already used by another group.'));258 $page['errors'][] = l10n('This name is already used by another group.'); 259 259 break; 260 260 } -
trunk/admin/group_perm.php
r25005 r25018 82 82 while ($row = pwg_db_fetch_assoc($result)) 83 83 { 84 array_push($private_uppercats, $row['id']);84 $private_uppercats[] = $row['id']; 85 85 } 86 86 … … 99 99 while ($row = pwg_db_fetch_assoc($result)) 100 100 { 101 array_push($authorized_ids, $row['cat_id']);101 $authorized_ids[] = $row['cat_id']; 102 102 } 103 103 … … 106 106 foreach ($to_autorize_ids as $to_autorize_id) 107 107 { 108 array_push( 109 $inserts, 110 array( 111 'group_id' => $page['group'], 112 'cat_id' => $to_autorize_id 113 ) 108 $inserts[] = array( 109 'group_id' => $page['group'], 110 'cat_id' => $to_autorize_id 114 111 ); 115 112 } … … 159 156 while ($row = pwg_db_fetch_assoc($result)) 160 157 { 161 array_push($authorized_ids, $row['id']);158 $authorized_ids[] = $row['id']; 162 159 } 163 160 -
trunk/admin/history.php
r25005 r25018 165 165 else 166 166 { 167 array_push($page['errors'], l10n('Empty query. No criteria has been entered.'));167 $page['errors'][] = l10n('Empty query. No criteria has been entered.'); 168 168 } 169 169 } -
trunk/admin/include/check_integrity.class.php
r19703 r25018 72 72 if (count($this->retrieve_list) > 0) 73 73 { 74 $header_notes[] = 75 l10n_dec('%d anomaly has been detected.', '%d anomalies have been detected.', 76 count($this->retrieve_list)); 74 $header_notes[] = l10n_dec( 75 '%d anomaly has been detected.', '%d anomalies have been detected.', 76 count($this->retrieve_list) 77 ); 77 78 } 78 79 … … 117 118 if ($corrected_count > 0) 118 119 { 119 $page['infos'][] = 120 l10n_dec('%d anomaly has been corrected.', '%d anomalies have been detected corrected.', 121 $corrected_count); 120 $page['infos'][] = l10n_dec( 121 '%d anomaly has been corrected.', '%d anomalies have been detected corrected.', 122 $corrected_count 123 ); 122 124 } 123 125 if ($not_corrected_count > 0) 124 126 { 125 $page['errors'][] = 126 l10n_dec('%d anomaly has not been corrected.', '%d anomalies have not been corrected.', 127 $not_corrected_count); 127 $page['errors'][] = l10n_dec( 128 '%d anomaly has not been corrected.', '%d anomalies have not been corrected.', 129 $not_corrected_count 130 ); 128 131 } 129 132 } … … 146 149 if ($ignored_count > 0) 147 150 { 148 $page['infos'][] = 149 l10n_dec('%d anomaly has been ignored.', '%d anomalies have been ignored.', 150 $ignored_count); 151 $page['infos'][] = l10n_dec( 152 '%d anomaly has been ignored.', '%d anomalies have been ignored.', 153 $ignored_count 154 ); 151 155 } 152 156 } -
trunk/admin/include/configuration_sizes_process.inc.php
r19703 r25018 255 255 } 256 256 257 array_push( 258 $page['infos'], 259 l10n('Your configuration settings are saved') 260 ); 257 $page['infos'][] = l10n('Your configuration settings are saved'); 261 258 } 262 259 else -
trunk/admin/include/configuration_watermark_process.inc.php
r19703 r25018 175 175 } 176 176 177 array_push( 178 $page['infos'], 179 l10n('Your configuration settings are saved') 180 ); 177 $page['infos'][] = l10n('Your configuration settings are saved'); 181 178 } 182 179 else -
trunk/admin/include/functions.php
r24987 r25018 541 541 and is_dir($path.'/'.$node)) 542 542 { 543 array_push($dirs, $path.'/'.$node);543 $dirs[] = $path.'/'.$node; 544 544 if ($recursive) 545 545 { … … 748 748 list($representative) = pwg_db_fetch_row(pwg_query($query)); 749 749 750 array_push( 751 $datas, 752 array( 753 'id' => $category_id, 754 'representative_picture_id' => $representative, 755 ) 750 $datas[] = array( 751 'id' => $category_id, 752 'representative_picture_id' => $representative, 756 753 ); 757 754 } … … 863 860 if (basename($path) == 'thumbnail') 864 861 { 865 array_push($fs['thumbnails'], $path.'/'.$node);862 $fs['thumbnails'][] = $path.'/'.$node; 866 863 } 867 864 else if (basename($path) == 'pwg_representative') 868 865 { 869 array_push($fs['representatives'], $path.'/'.$node);866 $fs['representatives'][] = $path.'/'.$node; 870 867 } 871 868 else 872 869 { 873 array_push($fs['elements'], $path.'/'.$node);870 $fs['elements'][] = $path.'/'.$node; 874 871 } 875 872 } … … 877 874 else if (isset($conf['flip_file_ext'][$extension])) 878 875 { 879 array_push($fs['elements'], $path.'/'.$node);876 $fs['elements'][] = $path.'/'.$node; 880 877 } 881 878 } 882 879 else if (is_dir($path.'/'.$node) and $node != 'pwg_high' and $recursive) 883 880 { 884 array_push($subdirs, $node);881 $subdirs[] = $node; 885 882 } 886 883 } … … 996 993 while ($uppercat) 997 994 { 998 array_push($upper_list, $uppercat);995 $upper_list[] = $uppercat; 999 996 $uppercat = $cat_map[$uppercat]['id_uppercat']; 1000 997 } … … 1003 1000 if ($new_uppercats != $cat['uppercats']) 1004 1001 { 1005 array_push( 1006 $datas, 1007 array( 1008 'id' => $id, 1009 'uppercats' => $new_uppercats 1010 ) 1002 $datas[] = array( 1003 'id' => $id, 1004 'uppercats' => $new_uppercats 1011 1005 ); 1012 1006 } … … 1096 1090 if (preg_match('/^'.$category['uppercats'].'(,|$)/', $new_parent_uppercats)) 1097 1091 { 1098 array_push( 1099 $page['errors'], 1100 l10n('You cannot move an album in its own sub album') 1101 ); 1092 $page['errors'][] = l10n('You cannot move an album in its own sub album'); 1102 1093 return; 1103 1094 } … … 1178 1169 } 1179 1170 1180 array_push( 1181 $page['infos'], 1182 l10n_dec( 1183 '%d album moved', '%d albums moved', 1184 count($categories) 1185 ) 1171 $page['infos'][] = l10n_dec( 1172 '%d album moved', '%d albums moved', 1173 count($categories) 1186 1174 ); 1187 1175 } … … 1308 1296 foreach ($granted_grps as $granted_grp) 1309 1297 { 1310 array_push( 1311 $inserts, 1312 array( 1313 'group_id' => $granted_grp, 1314 'cat_id' => $inserted_id 1315 ) 1298 $inserts[] = array( 1299 'group_id' => $granted_grp, 1300 'cat_id' => $inserted_id 1316 1301 ); 1317 1302 } … … 1587 1572 $rank = ++$current_rank_of[$category_id]; 1588 1573 1589 array_push( 1590 $inserts, 1591 array( 1592 'image_id' => $image_id, 1593 'category_id' => $category_id, 1594 'rank' => $rank, 1595 ) 1574 $inserts[] = array( 1575 'image_id' => $image_id, 1576 'category_id' => $category_id, 1577 'rank' => $rank, 1596 1578 ); 1597 1579 } … … 2316 2298 while ($row = pwg_db_fetch_assoc($result)) 2317 2299 { 2318 array_push($granteds[$row['cat_id']], $row['user_id']);2300 $granteds[ $row['cat_id'] ][] = $row['user_id']; 2319 2301 } 2320 2302 … … 2327 2309 foreach ($grant_to_users as $user_id) 2328 2310 { 2329 array_push( 2330 $inserts, 2331 array( 2332 'user_id' => $user_id, 2333 'cat_id' => $cat_id 2334 ) 2311 $inserts[] = array( 2312 'user_id' => $user_id, 2313 'cat_id' => $cat_id 2335 2314 ); 2336 2315 } … … 2514 2493 and $file != '.svn') 2515 2494 { 2516 array_push($sub_dirs, $file);2495 $sub_dirs[] = $file; 2517 2496 } 2518 2497 } -
trunk/admin/include/functions_history.inc.php
r19703 r25018 59 59 if (isset($search['fields']['date-after'])) 60 60 { 61 array_push( 62 $clauses, 63 "date >= '".$search['fields']['date-after']."'" 64 ); 61 $clauses[] = "date >= '".$search['fields']['date-after']."'"; 65 62 } 66 63 67 64 if (isset($search['fields']['date-before'])) 68 65 { 69 array_push( 70 $clauses, 71 "date <= '".$search['fields']['date-before']."'" 72 ); 66 $clauses[] = "date <= '".$search['fields']['date-before']."'"; 73 67 } 74 68 … … 89 83 } 90 84 91 array_push($local_clauses, $clause);85 $local_clauses[] = $clause; 92 86 } 93 87 } … … 95 89 if (count($local_clauses) > 0) 96 90 { 97 array_push( 98 $clauses, 99 implode(' OR ', $local_clauses) 100 ); 91 $clauses[] = implode(' OR ', $local_clauses); 101 92 } 102 93 } … … 105 96 and $search['fields']['user'] != -1) 106 97 { 107 array_push( 108 $clauses, 109 'user_id = '.$search['fields']['user'] 110 ); 98 $clauses[] = 'user_id = '.$search['fields']['user']; 111 99 } 112 100 113 101 if (isset($search['fields']['image_id'])) 114 102 { 115 array_push( 116 $clauses, 117 'image_id = '.$search['fields']['image_id'] 118 ); 103 $clauses[] = 'image_id = '.$search['fields']['image_id']; 119 104 } 120 105 … … 124 109 { 125 110 // a clause that is always false 126 array_push($clauses, '1 = 2 ');111 $clauses[] = '1 = 2 '; 127 112 } 128 113 else 129 114 { 130 array_push( 131 $clauses, 132 'image_id IN ('.implode(', ', $search['image_ids']).')' 133 ); 115 $clauses[] = 'image_id IN ('.implode(', ', $search['image_ids']).')'; 134 116 } 135 117 } … … 169 151 while ($row = pwg_db_fetch_assoc($result)) 170 152 { 171 array_push($data, $row);153 $data[] = $row; 172 154 } 173 155 -
trunk/admin/include/functions_install.inc.php
r20721 r25018 97 97 catch (Exception $e) 98 98 { 99 array_push( $errors, l10n($e->getMessage()));99 $errors[] = l10n($e->getMessage()); 100 100 } 101 101 } -
trunk/admin/include/functions_metadata.php
r19703 r25018 220 220 foreach (explode(',', $data[$key]) as $tag_name) 221 221 { 222 array_push( 223 $tags_of[$id], 224 tag_id_from_tag_name($tag_name) 225 ); 222 $tags_of[$id][] = tag_id_from_tag_name($tag_name); 226 223 } 227 224 } … … 230 227 $data['date_metadata_update'] = CURRENT_DATE; 231 228 232 array_push($datas, $data);229 $datas[] = $data; 233 230 } 234 231 … … 236 233 { 237 234 $update_fields = get_sync_metadata_attributes(); 238 array_push($update_fields, 'date_metadata_update');235 $update_fields[] = 'date_metadata_update'; 239 236 240 237 $update_fields = array_diff( … … 298 295 while ($row = pwg_db_fetch_assoc($result)) 299 296 { 300 array_push($cat_ids, $row['id']);297 $cat_ids[] = $row['id']; 301 298 } 302 299 -
trunk/admin/include/functions_notification_by_mail.inc.php
r19703 r25018 170 170 while ($nbm_user = pwg_db_fetch_assoc($result)) 171 171 { 172 array_push($data_users, $nbm_user);172 $data_users[] = $nbm_user; 173 173 } 174 174 } … … 286 286 287 287 $env_nbm['sent_mail_count'] += 1; 288 array_push($page['infos'], sprintf($env_nbm['msg_info'], stripslashes($nbm_user['username']), $nbm_user['mail_address']));288 $page['infos'][] = sprintf($env_nbm['msg_info'], stripslashes($nbm_user['username']), $nbm_user['mail_address']); 289 289 } 290 290 … … 299 299 300 300 $env_nbm['error_on_mail_count'] += 1; 301 array_push($page['errors'], sprintf($env_nbm['msg_error'], stripslashes($nbm_user['username']), $nbm_user['mail_address']));301 $page['errors'][] = sprintf($env_nbm['msg_error'], stripslashes($nbm_user['username']), $nbm_user['mail_address']); 302 302 } 303 303 … … 313 313 if ($env_nbm['error_on_mail_count'] != 0) 314 314 { 315 array_push($page['errors'], l10n_dec('%d mail was not sent.', '%d mails were not sent.', $env_nbm['error_on_mail_count'])); 315 $page['errors'][] = l10n_dec( 316 '%d mail was not sent.', '%d mails were not sent.', 317 $env_nbm['error_on_mail_count'] 318 ); 319 316 320 if ($env_nbm['sent_mail_count'] != 0) 317 array_push($page['infos'], l10n_dec('%d mail was sent.', '%d mails were sent.', $env_nbm['sent_mail_count'])); 321 { 322 $page['infos'][] = l10n_dec( 323 '%d mail was sent.', '%d mails were sent.', 324 $env_nbm['sent_mail_count'] 325 ); 326 } 318 327 } 319 328 else 320 329 { 321 330 if ($env_nbm['sent_mail_count'] == 0) 322 array_push($page['infos'], l10n('No mail to send.')); 331 { 332 $page['infos'][] = l10n('No mail to send.'); 333 } 323 334 else 324 array_push($page['infos'], l10n_dec('%d mail was sent.', '%d mails were sent.', $env_nbm['sent_mail_count'])); 335 { 336 $page['infos'][] = l10n_dec( 337 '%d mail was sent.', '%d mails were sent.', 338 $env_nbm['sent_mail_count'] 339 ); 340 } 325 341 } 326 342 } … … 395 411 { 396 412 // Stop fill list on 'send', if the quota is override 397 array_push($page['errors'], $msg_break_timeout);413 $page['errors'][] = $msg_break_timeout; 398 414 break; 399 415 } 400 416 401 417 // Fill return list 402 array_push($check_key_treated, $nbm_user['check_key']);418 $check_key_treated[] = $nbm_user['check_key']; 403 419 404 420 $do_update = true; … … 454 470 if ($do_update) 455 471 { 456 array_push 457 ( 458 $updates, 459 array 460 ( 461 'check_key' => $nbm_user['check_key'], 462 'enabled' => $enabled_value 463 ) 464 ); 472 $updates[] = array( 473 'check_key' => $nbm_user['check_key'], 474 'enabled' => $enabled_value 475 ); 465 476 $updated_data_count += 1; 466 array_push($page['infos'], sprintf($msg_info, stripslashes($nbm_user['username']), $nbm_user['mail_address']));477 $page['infos'][] = sprintf($msg_info, stripslashes($nbm_user['username']), $nbm_user['mail_address']); 467 478 } 468 479 else 469 480 { 470 481 $error_on_updated_data_count += 1; 471 array_push($page['errors'], sprintf($msg_error, stripslashes($nbm_user['username']), $nbm_user['mail_address']));482 $page['errors'][] = sprintf($msg_error, stripslashes($nbm_user['username']), $nbm_user['mail_address']); 472 483 } 473 484 … … 490 501 } 491 502 492 array_push($page['infos'], l10n_dec('%d user was updated.', '%d users were updated.', $updated_data_count)); 503 $page['infos'][] = l10n_dec( 504 '%d user was updated.', '%d users were updated.', 505 $updated_data_count 506 ); 507 493 508 if ($error_on_updated_data_count != 0) 494 509 { 495 array_push($page['errors'],496 l10n_dec('%d user wasnot updated.',497 '%d users were not updated.',498 $error_on_updated_data_count));510 $page['errors'][] = l10n_dec( 511 '%d user was not updated.', '%d users were not updated.', 512 $error_on_updated_data_count 513 ); 499 514 } 500 515 -
trunk/admin/include/functions_plugins.inc.php
r19703 r25018 40 40 else if (isset($page['errors'])) 41 41 { 42 array_push($page['errors'], 'PLUGIN ERROR: "'.$file.'" is not a valid file');42 $page['errors'][] = 'PLUGIN ERROR: "'.$file.'" is not a valid file'; 43 43 } 44 44 return $url; -
trunk/admin/include/functions_upgrade.php
r20720 r25018 94 94 while ($row = pwg_db_fetch_assoc($result)) 95 95 { 96 array_push($plugins, $row['id']);96 $plugins[] = $row['id']; 97 97 } 98 98 … … 106 106 pwg_query($query); 107 107 108 array_push($page['infos'],109 l10n('As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:').'<p><i>'.implode(', ', $plugins).'</i></p>');108 $page['infos'][] = l10n('As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:') 109 .'<p><i>'.implode(', ', $plugins).'</i></p>'; 110 110 } 111 111 } … … 136 136 while ($row = pwg_db_fetch_assoc($result)) 137 137 { 138 array_push($theme_ids, $row['id']);139 array_push($theme_names, $row['name']);138 $theme_ids[] = $row['id']; 139 $theme_names[] = $row['name']; 140 140 } 141 141 … … 149 149 pwg_query($query); 150 150 151 array_push($page['infos'],152 l10n('As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:').'<p><i>'.implode(', ', $theme_names).'</i></p>');151 $page['infos'][] = l10n('As a precaution, following themes have been deactivated. You must check for themes upgrade before reactiving them:') 152 .'<p><i>'.implode(', ', $theme_names).'</i></p>'; 153 153 154 154 // what is the default theme? … … 250 250 if (!$conf['password_verify']($password, $row['password'])) 251 251 { 252 array_push($page['errors'], l10n('Invalid password!'));252 $page['errors'][] = l10n('Invalid password!'); 253 253 } 254 254 elseif ($row['status'] != 'admin' and $row['status'] != 'webmaster') 255 255 { 256 array_push($page['errors'], l10n('You do not have access rights to run upgrade'));256 $page['errors'][] = l10n('You do not have access rights to run upgrade'); 257 257 } 258 258 else … … 280 280 and preg_match('/^(.*?)-database\.php$/', $node, $match)) 281 281 { 282 array_push($available_upgrade_ids, $match[1]);282 $available_upgrade_ids[] = $match[1]; 283 283 } 284 284 } -
trunk/admin/include/functions_upload.inc.php
r19703 r25018 123 123 else 124 124 { 125 array_push( 126 $errors, 127 sprintf( 128 $upload_form_config[$field]['error_message'], 129 $min, 130 $max 131 ) 125 $errors[] = sprintf( 126 $upload_form_config[$field]['error_message'], 127 $min, $max 132 128 ); 133 129 … … 495 491 function add_upload_error($upload_id, $error_message) 496 492 { 497 if (!isset($_SESSION['uploads_error'])) 498 { 499 $_SESSION['uploads_error'] = array(); 500 } 501 if (!isset($_SESSION['uploads_error'][$upload_id])) 502 { 503 $_SESSION['uploads_error'][$upload_id] = array(); 504 } 505 506 array_push($_SESSION['uploads_error'][$upload_id], $error_message); 493 $_SESSION['uploads_error'][$upload_id][] = $error_message; 507 494 } 508 495 -
trunk/admin/include/languages.class.php
r23821 r25018 58 58 if (isset($crt_db_language)) 59 59 { 60 array_push($errors, 'CANNOT ACTIVATE - LANGUAGE IS ALREADY ACTIVATED');60 $errors[] = 'CANNOT ACTIVATE - LANGUAGE IS ALREADY ACTIVATED'; 61 61 break; 62 62 } … … 75 75 if (!isset($crt_db_language)) 76 76 { 77 array_push($errors, 'CANNOT DEACTIVATE - LANGUAGE IS ALREADY DEACTIVATED');77 $errors[] = 'CANNOT DEACTIVATE - LANGUAGE IS ALREADY DEACTIVATED'; 78 78 break; 79 79 } … … 81 81 if ($language_id == get_default_language()) 82 82 { 83 array_push($errors, 'CANNOT DEACTIVATE - LANGUAGE IS DEFAULT LANGUAGE');83 $errors[] = 'CANNOT DEACTIVATE - LANGUAGE IS DEFAULT LANGUAGE'; 84 84 break; 85 85 } … … 96 96 if (!empty($crt_db_language)) 97 97 { 98 array_push($errors, 'CANNOT DELETE - LANGUAGE IS ACTIVATED');98 $errors[] = 'CANNOT DELETE - LANGUAGE IS ACTIVATED'; 99 99 break; 100 100 } 101 101 if (!isset($this->fs_languages[$language_id])) 102 102 { 103 array_push($errors, 'CANNOT DELETE - LANGUAGE DOES NOT EXIST');103 $errors[] = 'CANNOT DELETE - LANGUAGE DOES NOT EXIST'; 104 104 break; 105 105 } … … 369 369 and !empty($old_files)) 370 370 { 371 array_push($old_files, 'obsolete.list');371 $old_files[] = 'obsolete.list'; 372 372 foreach($old_files as $old_file) 373 373 { -
trunk/admin/include/photos_add_direct_prepare.inc.php
r23944 r25018 210 210 if (!empty($error_message)) 211 211 { 212 array_push($setup_errors, $error_message);212 $setup_errors[] = $error_message; 213 213 } 214 214 215 215 if (!function_exists('gd_info')) 216 216 { 217 array_push($setup_errors, l10n('GD library is missing'));217 $setup_errors[] = l10n('GD library is missing'); 218 218 } 219 219 … … 236 236 if ($conf['use_exif'] and !function_exists('read_exif_data')) 237 237 { 238 array_push( 239 $setup_warnings, 240 l10n('Exif extension not available, admin should disable exif use') 241 ); 238 $setup_warnings[] = l10n('Exif extension not available, admin should disable exif use'); 242 239 } 243 240 244 241 if (get_ini_size('upload_max_filesize') > get_ini_size('post_max_size')) 245 242 { 246 array_push( 247 $setup_warnings, 248 sprintf( 249 l10n('In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting'), 250 get_ini_size('upload_max_filesize', false), 251 get_ini_size('post_max_size', false) 252 ) 243 $setup_warnings[] = l10n( 244 'In your php.ini file, the upload_max_filesize (%sB) is bigger than post_max_size (%sB), you should change this setting', 245 get_ini_size('upload_max_filesize', false), 246 get_ini_size('post_max_size', false) 253 247 ); 254 248 } -
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 -
trunk/admin/include/plugins.class.php
r24159 r25018 400 400 $server_plugins[$plugin['extension_id']] = array(); 401 401 } 402 array_push($server_plugins[$plugin['extension_id']], $plugin['revision_name']);402 $server_plugins[$plugin['extension_id']][] = $plugin['revision_name']; 403 403 } 404 404 … … 504 504 and !empty($old_files)) 505 505 { 506 array_push($old_files, 'obsolete.list');506 $old_files[] = 'obsolete.list'; 507 507 foreach($old_files as $old_file) 508 508 { -
trunk/admin/include/themes.class.php
r23821 r25018 78 78 if (isset($missing_parent)) 79 79 { 80 array_push( 81 $errors, 82 sprintf( 83 l10n('Impossible to activate this theme, the parent theme is missing: %s'), 84 $missing_parent 85 ) 80 $errors[] = l10n( 81 'Impossible to activate this theme, the parent theme is missing: %s', 82 $missing_parent 86 83 ); 87 84 … … 94 91 and $conf['mobile_theme'] != $theme_id) 95 92 { 96 array_push($errors, l10n('You can activate only one mobile theme.'));93 $errors[] = l10n('You can activate only one mobile theme.'); 97 94 break; 98 95 } … … 135 132 if (count($this->db_themes_by_id) <= 1) 136 133 { 137 array_push( 138 $errors, 139 l10n('Impossible to deactivate this theme, you need at least one theme.') 140 ); 134 $errors[] = l10n('Impossible to deactivate this theme, you need at least one theme.'); 141 135 break; 142 136 } … … 191 185 if (!empty($crt_db_theme)) 192 186 { 193 array_push($errors, 'CANNOT DELETE - THEME IS INSTALLED');187 $errors[] = 'CANNOT DELETE - THEME IS INSTALLED'; 194 188 break; 195 189 } … … 203 197 if (count($children) > 0) 204 198 { 205 array_push( 206 $errors, 207 sprintf( 208 l10n('Impossible to delete this theme. Other themes depends on it: %s'), 209 implode(', ', $children) 210 ) 199 $errors[] = l10n( 200 'Impossible to delete this theme. Other themes depends on it: %s', 201 implode(', ', $children) 211 202 ); 212 203 break; … … 263 254 if (isset($test_child['parent']) and $test_child['parent'] == $theme_id) 264 255 { 265 array_push($children, $test_child['name']);256 $children[] = $test_child['name']; 266 257 } 267 258 } … … 323 314 while ($row = pwg_db_fetch_assoc($result)) 324 315 { 325 array_push($themes, $row);316 $themes[] = $row; 326 317 } 327 318 return $themes; … … 629 620 and !empty($old_files)) 630 621 { 631 array_push($old_files, 'obsolete.list');622 $old_files[] = 'obsolete.list'; 632 623 foreach($old_files as $old_file) 633 624 { -
trunk/admin/include/updates.class.php
r23821 r25018 162 162 if (in_array($ext_id, $conf['updates_ignored'][$type])) 163 163 { 164 array_push($ignore_list, $ext_id);164 $ignore_list[] = $ext_id; 165 165 } 166 166 else … … 249 249 and !empty($old_files)) 250 250 { 251 array_push($old_files, $file);251 $old_files[] = $file; 252 252 foreach($old_files as $old_file) 253 253 { … … 315 315 else 316 316 { 317 array_push($page['errors'], l10n('Unable to dump database.'));317 $page['errors'][] = l10n('Unable to dump database.'); 318 318 } 319 319 } … … 415 415 if ($step == 2) 416 416 { 417 array_push($page['infos'], l10n('Update Complete'), $upgrade_to); 417 $page['infos'][] = l10n('Update Complete'); 418 $page['infos'][] = $upgrade_to; 418 419 $step = -1; 419 420 } … … 426 427 { 427 428 file_put_contents(PHPWG_ROOT_PATH.$conf['data_location'].'update/log_error.txt', $error); 428 array_push( 429 $page['errors'], 430 sprintf( 431 l10n('An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.'), 432 get_root_url().$conf['data_location'].'update/log_error.txt' 433 ) 434 ); 429 430 $page['errors'][] = l10n( 431 'An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.', 432 get_root_url().$conf['data_location'].'update/log_error.txt' 433 ); 435 434 } 436 435 } … … 438 437 { 439 438 deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); 440 array_push($page['errors'], l10n('An error has occured during upgrade.'));439 $page['errors'][] = l10n('An error has occured during upgrade.'); 441 440 } 442 441 } 443 442 else 444 443 { 445 array_push($page['errors'], l10n('Piwigo cannot retrieve upgrade file from server'));444 $page['errors'][] = l10n('Piwigo cannot retrieve upgrade file from server'); 446 445 } 447 446 } -
trunk/admin/include/uploadify/uploadify.php
r15598 r25018 48 48 ); 49 49 50 if (!isset($_SESSION['uploads'])) 51 { 52 $_SESSION['uploads'] = array(); 53 } 54 55 if (!isset($_SESSION['uploads'][ $_POST['upload_id'] ])) 56 { 57 $_SESSION['uploads'][ $_POST['upload_id'] ] = array(); 58 } 59 60 array_push( 61 $_SESSION['uploads'][ $_POST['upload_id'] ], 62 $image_id 63 ); 50 $_SESSION['uploads'][ $_POST['upload_id'] ][] = $image_id; 64 51 65 52 $query = ' -
trunk/admin/intro.php
r25005 r25018 46 46 if (!fetchRemote(PHPWG_URL.'/download/latest_version', $result)) 47 47 { 48 array_push($page['errors'], l10n('Unable to check for upgrade.'));48 $page['errors'][] = l10n('Unable to check for upgrade.'); 49 49 } 50 50 else … … 74 74 if ('' == $versions['latest']) 75 75 { 76 array_push( 77 $page['errors'], 78 l10n('Check for upgrade failed for unknown reasons.') 79 ); 76 $page['errors'][] = l10n('Check for upgrade failed for unknown reasons.'); 80 77 } 81 78 // concatenation needed to avoid automatic transformation by release … … 83 80 else if ('%'.'PWGVERSION'.'%' == $versions['current']) 84 81 { 85 array_push( 86 $page['infos'], 87 l10n('You are running on development sources, no check possible.') 88 ); 82 $page['infos'][] = l10n('You are running on development sources, no check possible.'); 89 83 } 90 84 else if (version_compare($versions['current'], $versions['latest']) < 0) 91 85 { 92 array_push( 93 $page['infos'], 94 l10n('A new version of Piwigo is available.') 95 ); 86 $page['infos'][] = l10n('A new version of Piwigo is available.'); 96 87 } 97 88 else 98 89 { 99 array_push( 100 $page['infos'], 101 l10n('You are running the latest version of Piwigo.') 102 ); 90 $page['infos'][] = l10n('You are running the latest version of Piwigo.'); 103 91 } 104 92 } … … 202 190 'DB_ELEMENTS' => l10n_dec('%d photo', '%d photos', $nb_elements), 203 191 'DB_CATEGORIES' => 204 l10n_dec('%d album including', '%d albums including', 205 $nb_categories). 206 l10n_dec('%d physical', '%d physicals', 207 $nb_physical). 208 l10n_dec(' and %d virtual', ' and %d virtuals', 209 $nb_virtual), 192 l10n_dec('%d album including', '%d albums including', $nb_categories). 193 l10n_dec('%d physical', '%d physicals', $nb_physical). 194 l10n_dec(' and %d virtual', ' and %d virtuals', $nb_virtual), 210 195 'DB_IMAGE_CATEGORY' => l10n_dec('%d association', '%d associations', $nb_image_category), 211 196 'DB_TAGS' => l10n_dec('%d tag', '%d tags', $nb_tags), -
trunk/admin/languages_installed.php
r10594 r25018 88 88 { 89 89 $language['is_default'] = false; 90 array_push($tpl_languages, $language);90 $tpl_languages[] = $language; 91 91 } 92 92 } -
trunk/admin/languages_new.php
r25005 r25018 54 54 if (!is_webmaster()) 55 55 { 56 array_push($page['errors'], l10n('Webmaster status is required.'));56 $page['errors'][] = l10n('Webmaster status is required.'); 57 57 } 58 58 else … … 74 74 { 75 75 case 'ok': 76 array_push($page['infos'], 77 l10n('Language has been successfully installed') 78 ); 76 $page['infos'][] = l10n('Language has been successfully installed'); 79 77 break; 80 78 81 79 case 'temp_path_error': 82 array_push($page['errors'], l10n('Can\'t create temporary file.'));80 $page['errors'][] = l10n('Can\'t create temporary file.'); 83 81 break; 84 82 85 83 case 'dl_archive_error': 86 array_push($page['errors'], l10n('Can\'t download archive.'));84 $page['errors'][] = l10n('Can\'t download archive.'); 87 85 break; 88 86 89 87 case 'archive_error': 90 array_push($page['errors'], l10n('Can\'t read or extract archive.'));88 $page['errors'][] = l10n('Can\'t read or extract archive.'); 91 89 break; 92 90 93 91 default: 94 array_push( 95 $page['errors'], 96 l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])) 97 ); 92 $page['errors'][] = l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])); 98 93 } 99 94 } … … 127 122 else 128 123 { 129 array_push($page['errors'], l10n('Can\'t connect to server.'));124 $page['errors'][] = l10n('Can\'t connect to server.'); 130 125 } 131 126 -
trunk/admin/menubar.php
r19703 r25018 149 149 pwg_query($query); 150 150 151 array_push($page['infos'], l10n('Order of menubar items has been updated successfully.'));151 $page['infos'][] = l10n('Order of menubar items has been updated successfully.'); 152 152 } 153 153 -
trunk/admin/notification_by_mail.php
r25005 r25018 81 81 82 82 $must_repost = true; 83 array_push($page['errors'], 84 l10n_dec('Execution time is out, treatment must be continue [Estimated time: %d second].', 85 'Execution time is out, treatment must be continue [Estimated time: %d seconds].', 86 $time_refresh)); 83 $page['errors'][] = l10n_dec( 84 'Execution time is out, treatment must be continue [Estimated time: %d second].', 85 'Execution time is out, treatment must be continue [Estimated time: %d seconds].', 86 $time_refresh 87 ); 87 88 } 88 89 } … … 157 158 158 159 // Save key 159 array_push($check_key_list, $nbm_user['check_key']);160 $check_key_list[] = $nbm_user['check_key']; 160 161 161 162 // Insert new nbm_users 162 array_push 163 ( 164 $inserts, 165 array 166 ( 167 'user_id' => $nbm_user['user_id'], 168 'check_key' => $nbm_user['check_key'], 169 'enabled' => 'false' // By default if false, set to true with specific functions 170 ) 171 ); 172 173 array_push 174 ( 175 $page['infos'], 176 l10n( 177 'User %s [%s] added.', 178 stripslashes($nbm_user['username']), 179 get_email_address_as_display_text($nbm_user['mail_address']) 180 ) 181 ); 163 $inserts[] = array( 164 'user_id' => $nbm_user['user_id'], 165 'check_key' => $nbm_user['check_key'], 166 'enabled' => 'false' // By default if false, set to true with specific functions 167 ); 168 169 $page['infos'][] = l10n( 170 'User %s [%s] added.', 171 stripslashes($nbm_user['username']), 172 get_email_address_as_display_text($nbm_user['mail_address']) 173 ); 182 174 } 183 175 … … 283 275 { 284 276 // Stop fill list on 'list_to_send', if the quota is override 285 array_push($page['infos'], $msg_break_timeout);277 $page['infos'][] = $msg_break_timeout; 286 278 break; 287 279 } … … 289 281 { 290 282 // Stop fill list on 'send', if the quota is override 291 array_push($page['errors'], $msg_break_timeout);283 $page['errors'][] = $msg_break_timeout; 292 284 break; 293 285 } … … 300 292 set_make_full_url(); 301 293 // Fill return list of "treated" check_key for 'send' 302 array_push($return_list, $nbm_user['check_key']);294 $return_list[] = $nbm_user['check_key']; 303 295 304 296 if ($conf['nbm_send_detailed_content']) … … 403 395 inc_mail_sent_success($nbm_user); 404 396 405 $data = array('user_id' => $nbm_user['user_id'], 406 'last_send' => $dbnow); 407 array_push($datas, $data); 397 $datas[] = array( 398 'user_id' => $nbm_user['user_id'], 399 'last_send' => $dbnow 400 ); 408 401 } 409 402 else … … 420 413 { 421 414 // Fill return list of "selected" users for 'list_to_send' 422 array_push($return_list, $nbm_user);415 $return_list[] = $nbm_user; 423 416 } 424 417 } … … 449 442 if ($is_action_send) 450 443 { 451 array_push($page['errors'], l10n('No user to send notifications by mail.'));444 $page['errors'][] = l10n('No user to send notifications by mail.'); 452 445 } 453 446 } … … 530 523 } 531 524 532 array_push($page['infos'], 533 l10n_dec('%d parameter was updated.', '%d parameters were updated.', 534 $updated_param_count)); 525 $page['infos'][] = l10n_dec( 526 '%d parameter was updated.', '%d parameters were updated.', 527 $updated_param_count 528 ); 535 529 536 530 // Reload conf with new values -
trunk/admin/permalinks.php
r19703 r25018 60 60 elseif (isset($default_field) and !isset($_GET[$get_param]) ) 61 61 { 62 array_push($ret, $field);62 $ret[] = $field; 63 63 $disp = '<em>'.$disp.'</em>'; 64 64 } … … 66 66 else 67 67 { 68 array_push($ret, $field);68 $ret[] = $field; 69 69 $disp = '<em>'.$disp.'</em>'; 70 70 } … … 101 101 $result = pwg_query($query); 102 102 if (pwg_db_changes($result)==0) 103 array_push($page['errors'], l10n('Cannot delete the old permalink !')); 103 { 104 $page['errors'][] = l10n('Cannot delete the old permalink !'); 105 } 104 106 } 105 107 -
trunk/admin/photos_add_direct.php
r24834 r25018 44 44 foreach (explode(',', $_GET['batch']) as $image_id) 45 45 { 46 array_push( 47 $inserts, 48 array( 49 'user_id' => $user['id'], 50 'element_id' => $image_id, 51 ) 46 $inserts[] = array( 47 'user_id' => $user['id'], 48 'element_id' => $image_id, 52 49 ); 53 50 } -
trunk/admin/picture_modify.php
r25005 r25018 105 105 { 106 106 sync_metadata(array( intval($_GET['image_id']))); 107 array_push($page['infos'], l10n('Metadata synchronized from file'));107 $page['infos'][] = l10n('Metadata synchronized from file'); 108 108 } 109 109 … … 121 121 ) 122 122 { 123 array_push($page['errors'], l10n('wrong date'));123 $page['errors'][] = l10n('wrong date'); 124 124 } 125 125 } … … 204 204 $represent_options_selected = $_POST['represent']; 205 205 206 array_push($page['infos'], l10n('Photo informations updated'));206 $page['infos'][] = l10n('Photo informations updated'); 207 207 } 208 208 -
trunk/admin/plugins_installed.php
r19703 r25018 65 65 if (!is_webmaster()) 66 66 { 67 array_push($page['errors'], l10n('Webmaster status is required.'));67 $page['errors'][] = l10n('Webmaster status is required.'); 68 68 } 69 69 else … … 91 91 { 92 92 if ($plugin == '~~expire~~') continue; 93 array_push($incompatible_plugins, $plugin);93 $incompatible_plugins[] = $plugin; 94 94 95 95 } … … 153 153 } 154 154 155 array_push($tpl_plugins, $tpl_plugin);155 $tpl_plugins[] = $tpl_plugin; 156 156 } 157 157 … … 171 171 if (count($missing_plugin_ids) > 0) 172 172 { 173 foreach($missing_plugin_ids as $plugin_id) 174 { 175 array_push( 176 $tpl_plugins, 177 array( 178 'NAME' => $plugin_id, 179 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], 180 'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'), 181 'U_ACTION' => sprintf($action_url, $plugin_id), 182 'STATE' => 'missing', 183 ) 173 foreach ($missing_plugin_ids as $plugin_id) 174 { 175 $tpl_plugins[] = array( 176 'NAME' => $plugin_id, 177 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], 178 'DESC' => l10n('ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW.'), 179 'U_ACTION' => sprintf($action_url, $plugin_id), 180 'STATE' => 'missing', 184 181 ); 185 182 } -
trunk/admin/plugins_new.php
r25005 r25018 40 40 if (!is_webmaster()) 41 41 { 42 array_push($page['errors'], l10n('Webmaster status is required.'));42 $page['errors'][] = l10n('Webmaster status is required.'); 43 43 } 44 44 else … … 58 58 { 59 59 case 'ok': 60 array_push($page['infos'], 61 l10n('Plugin has been successfully copied'), 62 l10n('You might go to plugin list to install and activate it.')); 60 $page['infos'][] = l10n('Plugin has been successfully copied'); 61 $page['infos'][] = l10n('You might go to plugin list to install and activate it.'); 63 62 break; 64 63 65 64 case 'temp_path_error': 66 array_push($page['errors'], l10n('Can\'t create temporary file.'));65 $page['errors'][] = l10n('Can\'t create temporary file.'); 67 66 break; 68 67 69 68 case 'dl_archive_error': 70 array_push($page['errors'], l10n('Can\'t download archive.'));69 $page['errors'][] = l10n('Can\'t download archive.'); 71 70 break; 72 71 73 72 case 'archive_error': 74 array_push($page['errors'], l10n('Can\'t read or extract archive.'));73 $page['errors'][] = l10n('Can\'t read or extract archive.'); 75 74 break; 76 75 77 76 default: 78 array_push($page['errors'], 79 l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])), 80 l10n('Please check "plugins" folder and sub-folders permissions (CHMOD).')); 77 $page['errors'][] = l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])); 78 $page['errors'][] = l10n('Please check "plugins" folder and sub-folders permissions (CHMOD).'); 81 79 } 82 80 } … … 136 134 else 137 135 { 138 array_push($page['errors'], l10n('Can\'t connect to server.'));136 $page['errors'][] = l10n('Can\'t connect to server.'); 139 137 } 140 138 -
trunk/admin/rating.php
r19703 r25018 195 195 while ($row = pwg_db_fetch_assoc($result)) 196 196 { 197 array_push($images, $row);197 $images[] = $row; 198 198 } 199 199 -
trunk/admin/site_manager.php
r22979 r25018 76 76 if ($row['count'] > 0) 77 77 { 78 array_push($page['errors'], 79 l10n('This site already exists').' ['.$url.']'); 78 $page['errors'][] = l10n('This site already exists').' ['.$url.']'; 80 79 } 81 80 if (count($page['errors']) == 0) … … 83 82 if ( ! file_exists($url) ) 84 83 { 85 array_push($page['errors'], 86 l10n('Directory does not exist').' ['.$url.']'); 84 $page['errors'][] = l10n('Directory does not exist').' ['.$url.']'; 87 85 } 88 86 } … … 97 95 ;'; 98 96 pwg_query($query); 99 array_push($page['infos'], 100 $url.' '.l10n('created')); 97 $page['infos'][] = $url.' '.l10n('created'); 101 98 } 102 99 } … … 122 119 { 123 120 delete_site($page['site']); 124 array_push($page['infos'], 125 $galleries_url.' '.l10n('deleted')); 121 $page['infos'][] = $galleries_url.' '.l10n('deleted'); 126 122 break; 127 123 } -
trunk/admin/site_reader_local.php
r19703 r25018 53 53 if (!is_dir($this->site_url)) 54 54 { 55 array_push( 56 $errors, 57 array( 58 'path' => $this->site_url, 59 'type' => 'PWG-ERROR-NO-FS' 60 ) 55 $errors[] = array( 56 'path' => $this->site_url, 57 'type' => 'PWG-ERROR-NO-FS' 61 58 ); 62 59 … … 109 106 } 110 107 } 111 else if (is_dir($path.'/'.$node)108 else if (is_dir($path.'/'.$node) 112 109 and $node != 'pwg_high' 113 110 and $node != 'pwg_representative' 114 111 and $node != 'thumbnail' ) 115 112 { 116 array_push($subdirs, $node);113 $subdirs[] = $node; 117 114 } 118 115 } //end while readdir -
trunk/admin/site_update.php
r23430 r25018 200 200 if (isset($_POST['cat'])) 201 201 { 202 array_push($fs_fulldirs, $basedir);202 $fs_fulldirs[] = $basedir; 203 203 } 204 204 // If $_POST['subcats-included'] != 1 ("Search in sub-albums" is unchecked) … … 254 254 } 255 255 256 array_push($inserts, $insert); 257 array_push( 258 $infos, 259 array( 256 $inserts[] = $insert; 257 $infos[] = array( 260 258 'path' => $fulldir, 261 259 'info' => l10n('added') … … 278 276 else 279 277 { 280 array_push( 281 $errors, 282 array( 283 'path' => $fulldir, 284 'type' => 'PWG-UPDATE-1' 285 ) 278 $errors[] = array( 279 'path' => $fulldir, 280 'type' => 'PWG-UPDATE-1' 286 281 ); 287 282 } … … 327 322 $granted_grps[$row['cat_id']]=array(); 328 323 } 324 // TODO: explanaition 329 325 array_push( 330 326 $granted_grps, … … 350 346 $granted_users[$row['cat_id']]=array(); 351 347 } 348 // TODO: explanaition 352 349 array_push( 353 350 $granted_users, … … 373 370 foreach ($granted_grps[$parent_id] as $granted_grp) 374 371 { 375 array_push( 376 $insert_granted_grps, 377 array( 378 'group_id' => $granted_grp, 379 'cat_id' => $ids 380 ) 381 ); 372 $insert_granted_grps[] = array( 373 'group_id' => $granted_grp, 374 'cat_id' => $ids 375 ); 382 376 } 383 377 } … … 386 380 foreach ($granted_users[$parent_id] as $granted_user) 387 381 { 388 array_push( 389 $insert_granted_users, 390 array( 391 'user_id' => $granted_user, 392 'cat_id' => $ids 393 ) 394 ); 382 $insert_granted_users[] = array( 383 'user_id' => $granted_user, 384 'cat_id' => $ids 385 ); 395 386 } 396 387 } 397 388 foreach (get_admins() as $granted_user) 398 389 { 399 array_push( 400 $insert_granted_users, 401 array( 402 'user_id' => $granted_user, 403 'cat_id' => $ids 404 ) 405 ); 390 $insert_granted_users[] = array( 391 'user_id' => $granted_user, 392 'cat_id' => $ids 393 ); 406 394 } 407 395 } … … 421 409 422 410 // to delete categories 423 $to_delete = array(); $to_delete_derivative_dirs = array(); 411 $to_delete = array(); 412 $to_delete_derivative_dirs = array(); 413 424 414 foreach (array_diff(array_keys($db_fulldirs), $fs_fulldirs) as $fulldir) 425 415 { 426 array_push($to_delete, $db_fulldirs[$fulldir]);416 $to_delete[] = $db_fulldirs[$fulldir]; 427 417 unset($db_fulldirs[$fulldir]); 428 array_push($infos, array('path' => $fulldir, 429 'info' => l10n('deleted'))); 418 419 $infos[] = array( 420 'path' => $fulldir, 421 'info' => l10n('deleted') 422 ); 423 430 424 if (substr_compare($fulldir, '../', 0, 3)==0) 431 425 { … … 434 428 $to_delete_derivative_dirs[] = PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$fulldir; 435 429 } 430 436 431 if (count($to_delete) > 0) 437 432 { … … 506 501 if (!preg_match($conf['sync_chars_regex'], $filename)) 507 502 { 508 array_push( 509 $errors, 510 array( 511 'path' => $path, 512 'type' => 'PWG-UPDATE-1' 513 ) 503 $errors[] = array( 504 'path' => $path, 505 'type' => 'PWG-UPDATE-1' 514 506 ); 515 507 … … 533 525 } 534 526 535 array_push( 536 $inserts, 537 $insert 527 $inserts[] = $insert; 528 529 $insert_links[] = array( 530 'image_id' => $insert['id'], 531 'category_id' => $insert['storage_category_id'], 538 532 ); 539 533 540 array_push( 541 $insert_links, 542 array( 543 'image_id' => $insert['id'], 544 'category_id' => $insert['storage_category_id'], 545 ) 546 ); 547 548 array_push( 549 $infos, 550 array( 551 'path' => $insert['path'], 552 'info' => l10n('added') 553 ) 534 $infos[] = array( 535 'path' => $insert['path'], 536 'info' => l10n('added') 554 537 ); 555 538 … … 588 571 foreach (array_diff($db_elements, array_keys($fs)) as $path) 589 572 { 590 array_push($to_delete_elements, array_search($path, $db_elements)); 591 array_push($infos, array('path' => $path, 592 'info' => l10n('deleted'))); 573 $to_delete_elements[] = array_search($path, $db_elements); 574 $infos[] = array( 575 'path' => $path, 576 'info' => l10n('deleted') 577 ); 593 578 } 594 579 if (count($to_delete_elements) > 0) … … 659 644 660 645 $data['id']=$id; 661 array_push($datas, $data);646 $datas[] = $data; 662 647 } // end foreach file 663 648 … … 740 725 $data['date_metadata_update'] = CURRENT_DATE; 741 726 $data['id']=$id; 742 array_push($datas, $data);727 $datas[] = $data; 743 728 744 729 foreach (array('keywords', 'tags') as $key) … … 753 738 foreach (explode(',', $data[$key]) as $tag_name) 754 739 { 755 array_push( 756 $tags_of[$id], 757 tag_id_from_tag_name($tag_name) 758 ); 740 $tags_of[$id][] = tag_id_from_tag_name($tag_name); 759 741 } 760 742 } … … 763 745 else 764 746 { 765 array_push($errors, array('path' => $element_infos['path'], 'type' => 'PWG-ERROR-NO-FS')); 747 $errors[] = array( 748 'path' => $element_infos['path'], 749 'type' => 'PWG-ERROR-NO-FS' 750 ); 766 751 } 767 752 } -
trunk/admin/stats.php
r19703 r25018 98 98 while ($row = pwg_db_fetch_assoc($result)) 99 99 { 100 array_push($output, $row);100 $output[] = $row; 101 101 } 102 102 … … 227 227 { 228 228 $row['nb_pages'] += $need_update[$key]; 229 array_push($updates, $row);229 $updates[] = $row; 230 230 unset($need_update[$key]); 231 231 } … … 237 237 $time_tokens = explode('-', $time_key); 238 238 239 array_push( 240 $inserts, 241 array( 242 'year' => $time_tokens[0], 243 'month' => @$time_tokens[1], 244 'day' => @$time_tokens[2], 245 'hour' => @$time_tokens[3], 246 'nb_pages' => $nb_pages, 247 ) 248 ); 239 $inserts[] = array( 240 'year' => $time_tokens[0], 241 'month' => @$time_tokens[1], 242 'day' => @$time_tokens[2], 243 'hour' => @$time_tokens[3], 244 'nb_pages' => $nb_pages, 245 ); 249 246 } 250 247 … … 324 321 $url = PHPWG_ROOT_PATH.'admin.php?page=stats'; 325 322 326 array_push( 327 $title_parts, 328 '<a href="'.$url.'">'.l10n('Overall').'</a>' 329 ); 323 $title_parts[] = '<a href="'.$url.'">'.l10n('Overall').'</a>'; 330 324 331 325 $period_label = l10n('Year'); … … 335 329 $url.= '&year='.$page['year']; 336 330 337 array_push( 338 $title_parts, 339 '<a href="'.$url.'">'.$page['year'].'</a>' 340 ); 331 $title_parts[] = '<a href="'.$url.'">'.$page['year'].'</a>'; 341 332 342 333 $period_label = l10n('Month'); … … 347 338 $url.= '&month='.$page['month']; 348 339 349 array_push( 350 $title_parts, 351 '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>' 352 ); 340 $title_parts[] = '<a href="'.$url.'">'.$lang['month'][$page['month']].'</a>'; 353 341 354 342 $period_label = l10n('Day'); … … 367 355 ); 368 356 369 array_push( 370 $title_parts, 371 '<a href="'.$url.'">'.$day_title.'</a>' 372 ); 357 $title_parts[] = '<a href="'.$url.'">'.$day_title.'</a>'; 373 358 374 359 $period_label = l10n('Hour'); -
trunk/admin/tags.php
r25005 r25018 70 70 if (in_array($tag_name, $existing_names)) 71 71 { 72 array_push( 73 $page['errors'], 74 l10n( 75 'Tag "%s" already exists', 76 $tag_name 77 ) 78 ); 72 $page['errors'][] = l10n('Tag "%s" already exists', $tag_name); 79 73 } 80 74 else if (!empty($tag_name)) 81 75 { 82 array_push( 83 $updates, 84 array( 85 'id' => $tag_id, 86 'name' => addslashes($tag_name), 87 'url_name' => trigger_event('render_tag_url', $tag_name), 88 ) 76 $updates[] = array( 77 'id' => $tag_id, 78 'name' => addslashes($tag_name), 79 'url_name' => trigger_event('render_tag_url', $tag_name), 89 80 ); 90 81 } … … 135 126 if (in_array($tag_name, $existing_names)) 136 127 { 137 array_push( 138 $page['errors'], 139 l10n( 140 'Tag "%s" already exists', 141 $tag_name 142 ) 143 ); 128 $page['errors'][] = l10n('Tag "%s" already exists', $tag_name); 144 129 } 145 130 else if (!empty($tag_name)) … … 172 157 foreach ($destination_tag_image_ids as $image_id) 173 158 { 174 array_push( 175 $inserts, 176 array( 177 'tag_id' => $destination_tag_id, 178 'image_id' => $image_id 179 ) 159 $inserts[] = array( 160 'tag_id' => $destination_tag_id, 161 'image_id' => $image_id 180 162 ); 181 163 } … … 189 171 ); 190 172 } 191 array_push( 192 $page['infos'], 193 l10n( 194 'Tag "%s" is now a duplicate of "%s"', 195 stripslashes($tag_name), 196 $current_name_of[$tag_id] 197 ) 173 174 $page['infos'][] = l10n( 175 'Tag "%s" is now a duplicate of "%s"', 176 stripslashes($tag_name), 177 $current_name_of[$tag_id] 198 178 ); 199 179 } … … 218 198 if (!isset($_POST['destination_tag'])) 219 199 { 220 array_push( 221 $page['errors'], 222 l10n('No destination tag selected') 223 ); 200 $page['errors'][] = l10n('No destination tag selected'); 224 201 } 225 202 else … … 275 252 foreach ($image_ids_to_link as $image_id) 276 253 { 277 array_push( 278 $inserts, 279 array( 280 'tag_id' => $destination_tag_id, 281 'image_id' => $image_id 282 ) 254 $inserts[] = array( 255 'tag_id' => $destination_tag_id, 256 'image_id' => $image_id 283 257 ); 284 258 } … … 299 273 } 300 274 301 array_push( 302 $page['infos'], 303 l10n( 304 'Tags <em>%s</em> merged into tag <em>%s</em>', 305 implode(', ', $tags_deleted), 306 $name_of_tag[$destination_tag_id] 307 ) 275 $page['infos'][] = l10n( 276 'Tags <em>%s</em> merged into tag <em>%s</em>', 277 implode(', ', $tags_deleted), 278 $name_of_tag[$destination_tag_id] 308 279 ); 309 280 } … … 327 298 delete_tags($_POST['tags']); 328 299 329 array_push( 330 $page['infos'], 331 l10n_dec( 332 'The following tag was deleted', 333 'The %d following tags were deleted', 334 count($tag_names)).' : '. 335 implode(', ', $tag_names) 336 ); 300 $page['infos'][] = l10n_dec( 301 'The following tag was deleted', 'The %d following tags were deleted', 302 count($tag_names) 303 ) 304 .' : '.implode(', ', $tag_names); 337 305 } 338 306 … … 379 347 ); 380 348 381 array_push( 382 $page['infos'], 383 l10n( 384 'Tag "%s" was added', 385 stripslashes($tag_name) 386 ) 387 ); 349 $page['infos'][] = l10n('Tag "%s" was added', stripslashes($tag_name)); 388 350 } 389 351 else 390 352 { 391 array_push( 392 $page['errors'], 393 l10n( 394 'Tag "%s" already exists', 395 stripslashes($tag_name) 396 ) 397 ); 353 $page['errors'][] = l10n('Tag "%s" already exists', stripslashes($tag_name)); 398 354 } 399 355 } … … 421 377 foreach ($orphan_tags as $tag) 422 378 { 423 array_push($orphan_tag_names, trigger_event('render_tag_name', $tag['name']));379 $orphan_tag_names[] = trigger_event('render_tag_name', $tag['name']); 424 380 } 425 381 426 382 if (count($orphan_tag_names) > 0) 427 383 { 428 array_push( 429 $page['warnings'], 430 sprintf( 431 l10n('You have %d orphan tags: %s.').' <a href="%s">'.l10n('Delete orphan tags').'</a>', 432 count($orphan_tag_names), 433 implode(', ', $orphan_tag_names), 434 get_root_url().'admin.php?page=tags&action=delete_orphans&pwg_token='.get_pwg_token() 435 ) 384 $page['warnings'][] = sprintf( 385 l10n('You have %d orphan tags: %s.').' <a href="%s">'.l10n('Delete orphan tags').'</a>', 386 count($orphan_tag_names), 387 implode(', ', $orphan_tag_names), 388 get_root_url().'admin.php?page=tags&action=delete_orphans&pwg_token='.get_pwg_token() 436 389 ); 437 390 } -
trunk/admin/themes_installed.php
r25005 r25018 63 63 foreach ($db_themes as $db_theme) 64 64 { 65 array_push($db_theme_ids, $db_theme['id']);65 $db_theme_ids[] = $db_theme['id']; 66 66 } 67 67 … … 144 144 } 145 145 146 array_push($tpl_themes, $tpl_theme);146 $tpl_themes[] = $tpl_theme; 147 147 } 148 148 -
trunk/admin/themes_new.php
r25005 r25018 51 51 if (!is_webmaster()) 52 52 { 53 array_push($page['errors'], l10n('Webmaster status is required.'));53 $page['errors'][] = l10n('Webmaster status is required.'); 54 54 } 55 55 else … … 76 76 { 77 77 case 'ok': 78 array_push( 79 $page['infos'], 80 l10n('Theme has been successfully installed') 81 ); 78 $page['infos'][] = l10n('Theme has been successfully installed'); 82 79 break; 83 80 84 81 case 'temp_path_error': 85 array_push($page['errors'], l10n('Can\'t create temporary file.'));82 $page['errors'][] = l10n('Can\'t create temporary file.'); 86 83 break; 87 84 88 85 case 'dl_archive_error': 89 array_push($page['errors'], l10n('Can\'t download archive.'));86 $page['errors'][] = l10n('Can\'t download archive.'); 90 87 break; 91 88 92 89 case 'archive_error': 93 array_push($page['errors'], l10n('Can\'t read or extract archive.'));90 $page['errors'][] = l10n('Can\'t read or extract archive.'); 94 91 break; 95 92 96 93 default: 97 array_push(98 $page['errors'],99 l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus']))94 $page['errors'][] = l10n( 95 'An error occured during extraction (%s).', 96 htmlspecialchars($_GET['installstatus']) 100 97 ); 101 98 } … … 131 128 else 132 129 { 133 array_push($page['errors'], l10n('Can\'t connect to server.'));130 $page['errors'][] = l10n('Can\'t connect to server.'); 134 131 } 135 132 -
trunk/admin/updates_ext.php
r10596 r25018 33 33 if (!$autoupdate->get_server_extensions()) 34 34 { 35 array_push($page['errors'], l10n('Can\'t connect to server.'));36 return; 35 $page['errors'][] = l10n('Can\'t connect to server.'); 36 return; // TODO: remove this return and add a proper "page killer" 37 37 } 38 38 -
trunk/admin/updates_pwg.php
r10511 r25018 150 150 if (!is_webmaster()) 151 151 { 152 array_push($page['errors'], l10n('Webmaster status is required.'));152 $page['errors'][] = l10n('Webmaster status is required.'); 153 153 } 154 154 -
trunk/admin/user_list.php
r25005 r25018 120 120 $user['groups'] = array(); 121 121 122 array_push($users, $user);122 $users[] = $user; 123 123 } 124 124 … … 141 141 while ($row = pwg_db_fetch_assoc($result)) 142 142 { 143 array_push( 144 $users[$user_nums[$row['user_id']]]['groups'], 145 $row['group_id'] 146 ); 143 $users[ $user_nums[ $row['user_id'] ] ]['groups'][] = $row['group_id']; 147 144 } 148 145 } … … 192 189 if(empty($_POST['password'])) 193 190 { 194 array_push($page['errors'], l10n('Password is missing. Please enter the password.'));191 $page['errors'][] = l10n('Password is missing. Please enter the password.'); 195 192 } 196 193 else if(empty($_POST['password_conf'])) 197 194 { 198 array_push($page['errors'], l10n('Password confirmation is missing. Please confirm the chosen password.'));195 $page['errors'][] = l10n('Password confirmation is missing. Please confirm the chosen password.'); 199 196 } 200 197 else if(empty($_POST['email'])) 201 198 { 202 array_push($page['errors'], l10n('Email address is missing. Please specify an email address.'));199 $page['errors'][] = l10n('Email address is missing. Please specify an email address.'); 203 200 } 204 201 else if ($_POST['password'] != $_POST['password_conf']) 205 202 { 206 array_push($page['errors'], l10n('The passwords do not match'));203 $page['errors'][] = l10n('The passwords do not match'); 207 204 } 208 205 else … … 213 210 if (count($page['errors']) == 0) 214 211 { 215 array_push( 216 $page['infos'], 217 l10n( 218 'user "%s" added', 219 $_POST['login'] 220 ) 221 ); 212 $page['infos'][] = l10n('user "%s" added', $_POST['login']); 222 213 } 223 214 } … … 233 224 if (count($page['errors']) == 0) 234 225 { 235 array_push( 236 $page['infos'], 237 l10n( 238 'user "%s" added', 239 stripslashes($_POST['login']) 240 ) 241 ); 226 $page['infos'][] = l10n('user "%s" added', stripslashes($_POST['login'])); 242 227 } 243 228 } … … 296 281 foreach($page['filtered_users'] as $local_user) 297 282 { 298 array_push($collection, $local_user['id']);283 $collection[] = $local_user['id']; 299 284 } 300 285 break; … … 312 297 if (count($collection) == 0) 313 298 { 314 array_push($page['errors'], l10n('Select at least one user'));299 $page['errors'][] = l10n('Select at least one user'); 315 300 } 316 301 } … … 323 308 if (in_array($conf['guest_id'], $collection)) 324 309 { 325 array_push($page['errors'], l10n('Guest cannot be deleted'));310 $page['errors'][] = l10n('Guest cannot be deleted'); 326 311 } 327 312 if (($conf['guest_id'] != $conf['default_user_id']) and 328 313 in_array($conf['default_user_id'], $collection)) 329 314 { 330 array_push($page['errors'], l10n('Default user cannot be deleted'));315 $page['errors'][] = l10n('Default user cannot be deleted'); 331 316 } 332 317 if (in_array($conf['webmaster_id'], $collection)) 333 318 { 334 array_push($page['errors'], l10n('Webmaster cannot be deleted'));319 $page['errors'][] = l10n('Webmaster cannot be deleted'); 335 320 } 336 321 if (in_array($user['id'], $collection)) 337 322 { 338 array_push($page['errors'], l10n('You cannot delete your account'));323 $page['errors'][] = l10n('You cannot delete your account'); 339 324 } 340 325 … … 347 332 delete_user($user_id); 348 333 } 349 array_push( 350 $page['infos'], 351 l10n_dec( 352 '%d user deleted', '%d users deleted', 353 count($collection) 354 ) 334 335 $page['infos'][] = l10n_dec( 336 '%d user deleted', '%d users deleted', 337 count($collection) 355 338 ); 339 356 340 foreach ($page['filtered_users'] as $filter_key => $filter_user) 357 341 { … … 364 348 else 365 349 { 366 array_push($page['errors'], l10n('You need to confirm deletion'));350 $page['errors'][] = l10n('You need to confirm deletion'); 367 351 } 368 352 } … … 392 376 foreach ($associable as $item) 393 377 { 394 array_push($datas, 395 array('group_id'=>$_POST['associate'], 396 'user_id'=>$item)); 378 $datas[] = array( 379 'group_id' => $_POST['associate'], 380 'user_id' => $item 381 ); 397 382 } 398 383 … … 427 412 if ($conf['activate_comments']) 428 413 { 429 array_push($formfields, 'show_nb_comments');430 array_push($true_false_fields, 'show_nb_comments');414 $formfields[] = 'show_nb_comments'; 415 $true_false_fields[] = 'show_nb_comments'; 431 416 } 432 417 … … 445 430 if ($_POST[$test] != 'leave') 446 431 { 447 array_push($dbfields['update'], $formfield);432 $dbfields['update'][] = $formfield; 448 433 } 449 434 } … … 481 466 if (!in_array('level', $dbfields['update'])) 482 467 { 483 array_push($dbfields['update'], 'level');468 $dbfields['update'][] = 'level'; 484 469 } 485 470 } … … 508 493 } 509 494 510 array_push($datas, $data);495 $datas[] = $data; 511 496 } 512 497 -
trunk/admin/user_perm.php
r25005 r25018 120 120 while ($row = pwg_db_fetch_assoc($result)) 121 121 { 122 array_push($cats, $row);123 array_push($group_authorized, $row['cat_id']);122 $cats[] = $row; 123 $group_authorized[] = $row['cat_id']; 124 124 } 125 125 usort($cats, 'global_rank_compare'); … … 153 153 while ($row = pwg_db_fetch_assoc($result)) 154 154 { 155 array_push($authorized_ids, $row['id']);155 $authorized_ids[] = $row['id']; 156 156 } 157 157 -
trunk/comments.php
r25005 r25018 447 447 while ($row = pwg_db_fetch_assoc($result)) 448 448 { 449 array_push($comments, $row);450 array_push($element_ids, $row['image_id']);449 $comments[] = $row; 450 $element_ids[] = $row['image_id']; 451 451 } 452 452 -
trunk/identification.php
r20609 r25018 40 40 if ( is_a_guest() ) 41 41 { 42 array_push($page['errors'], l10n('You are not authorized to access the requested page'));42 $page['errors'][] = l10n('You are not authorized to access the requested page'); 43 43 } 44 44 } … … 48 48 if (!isset($_COOKIE[session_name()])) 49 49 { 50 array_push( 51 $page['errors'], 52 l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.') 53 ); 50 $page['errors'][] = l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.'); 54 51 } 55 52 else … … 69 66 else 70 67 { 71 array_push($page['errors'], l10n('Invalid password!'));68 $page['errors'][] = l10n('Invalid password!'); 72 69 } 73 70 } -
trunk/include/calendar_monthly.class.php
r19703 r25018 389 389 } 390 390 391 array_push( $wday_labels, array_shift($wday_labels));391 $wday_labels[] = array_shift($wday_labels); 392 392 } 393 393 -
trunk/include/calendar_weekly.class.php
r25005 r25018 69 69 $this->calendar_levels[CWEEK]['sql'] = pwg_db_get_week($this->date_field, 5).'+1'; 70 70 $this->calendar_levels[CDAY]['sql'] = pwg_db_get_weekday($this->date_field); 71 array_push( $this->calendar_levels[CDAY]['labels'], 72 array_shift( $this->calendar_levels[CDAY]['labels'] ) ); 71 $this->calendar_levels[CDAY]['labels'][] = array_shift($this->calendar_levels[CDAY]['labels']); 73 72 } 74 73 } -
trunk/include/category_cats.inc.php
r25005 r25018 208 208 if (isset($image_id) and !in_array($image_id, $image_ids)) 209 209 { 210 array_push($new_image_ids, $image_id);210 $new_image_ids[] = $image_id; 211 211 } 212 212 -
trunk/include/dblayer/functions_mysql.inc.php
r21088 r25018 329 329 $column.= " collate '".$row['Collation']."'"; 330 330 } 331 array_push($columns, $column);331 $columns[] = $column; 332 332 } 333 333 } … … 565 565 while ($row = pwg_db_fetch_row($result)) 566 566 { 567 array_push($all_tables, $row[0]);567 $all_tables[] = $row[0]; 568 568 } 569 569 … … 583 583 if ($row['Key'] == 'PRI') 584 584 { 585 array_push($all_primary_key, $row['Field']);585 $all_primary_key[] = $row['Field']; 586 586 } 587 587 } … … 599 599 if ($mysql_rc) 600 600 { 601 array_push( 602 $page['infos'], 603 l10n('All optimizations have been successfully completed.') 604 ); 601 $page['infos'][] = l10n('All optimizations have been successfully completed.'); 605 602 } 606 603 else 607 604 { 608 array_push( 609 $page['errors'], 610 l10n('Optimizations have been completed with some errors.') 611 ); 605 $page['errors'][] = l10n('Optimizations have been completed with some errors.'); 612 606 } 613 607 } -
trunk/include/dblayer/functions_mysqli.inc.php
r24346 r25018 366 366 $column.= " collate '".$row['Collation']."'"; 367 367 } 368 array_push($columns, $column);368 $columns[] = $column; 369 369 } 370 370 } … … 602 602 while ($row = pwg_db_fetch_row($result)) 603 603 { 604 array_push($all_tables, $row[0]);604 $all_tables[] = $row[0]; 605 605 } 606 606 … … 620 620 if ($row['Key'] == 'PRI') 621 621 { 622 array_push($all_primary_key, $row['Field']);622 $all_primary_key[] = $row['Field']; 623 623 } 624 624 } … … 636 636 if ($mysqli_rc) 637 637 { 638 array_push( 639 $page['infos'], 640 l10n('All optimizations have been successfully completed.') 641 ); 638 $page['infos'][] = l10n('All optimizations have been successfully completed.'); 642 639 } 643 640 else 644 641 { 645 array_push( 646 $page['errors'], 647 l10n('Optimizations have been completed with some errors.') 648 ); 642 $page['errors'][] = l10n('Optimizations have been completed with some errors.'); 649 643 } 650 644 } -
trunk/include/filter.inc.php
r19703 r25018 124 124 if (get_filter_page_value('add_notes')) 125 125 { 126 $header_notes[] = l10n_dec('Photos posted within the last %d day.', 'Photos posted within the last %d days.', $filter['recent_period']); 126 $header_notes[] = l10n_dec( 127 'Photos posted within the last %d day.', 'Photos posted within the last %d days.', 128 $filter['recent_period'] 129 ); 127 130 } 128 131 include_once(PHPWG_ROOT_PATH.'include/functions_filter.inc.php'); -
trunk/include/functions.inc.php
r25005 r25018 879 879 foreach ($caddiables as $caddiable) 880 880 { 881 array_push($datas, array('element_id' => $caddiable, 882 'user_id' => $user['id'])); 881 $datas[] = array( 882 'element_id' => $caddiable, 883 'user_id' => $user['id'], 884 ); 883 885 } 884 886 -
trunk/include/functions_calendar.inc.php
r19703 r25018 213 213 if ( isset($page['chronology_date'][0]) ) 214 214 { 215 array_push($chronology_date, $page['chronology_date'][0]);215 $chronology_date[] = $page['chronology_date'][0]; 216 216 } 217 217 } -
trunk/include/functions_comment.inc.php
r21817 r25018 94 94 if ($conf['comments_author_mandatory']) 95 95 { 96 array_push($infos, l10n('Username is mandatory'));96 $infos[] = l10n('Username is mandatory'); 97 97 $comment_action='reject'; 98 98 } … … 111 111 if ( $row['user_exists'] == 1 ) 112 112 { 113 array_push($infos, l10n('This login is already used by another user'));113 $infos[] = l10n('This login is already used by another user'); 114 114 $comment_action='reject'; 115 115 } … … 142 142 if (!url_check_format($comm['website_url'])) 143 143 { 144 array_push($infos, l10n('Your website URL is invalid'));144 $infos[] = l10n('Your website URL is invalid'); 145 145 $comment_action='reject'; 146 146 } … … 156 156 else if ($conf['comments_email_mandatory']) 157 157 { 158 array_push($infos, l10n('Email address is missing. Please specify an email address.'));158 $infos[] = l10n('Email address is missing. Please specify an email address.'); 159 159 $comment_action='reject'; 160 160 } … … 162 162 else if (!email_check_format($comm['email'])) 163 163 { 164 array_push($infos, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'));164 $infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'); 165 165 $comment_action='reject'; 166 166 } … … 193 193 if ( $counter > 0 ) 194 194 { 195 array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment'));195 $infos[] = l10n('Anti-flood system : please wait for a moment before trying to post another comment'); 196 196 $comment_action='reject'; 197 197 } -
trunk/include/functions_mail.inc.php
r24966 r25018 294 294 if (!empty($admin['mail_address'])) 295 295 { 296 array_push($admins, format_email($admin['username'], $admin['mail_address']));296 $admins[] = format_email($admin['username'], $admin['mail_address']); 297 297 } 298 298 } … … 420 420 if (!empty($row['mail_address'])) 421 421 { 422 array_push($Bcc, format_email(stripslashes($row['username']), $row['mail_address']));422 $Bcc[] = format_email(stripslashes($row['username']), $row['mail_address']); 423 423 } 424 424 } -
trunk/include/functions_notification.inc.php
r19703 r25018 207 207 while ($row = pwg_db_fetch_assoc($result)) 208 208 { 209 array_push($infos, $row);209 $infos[] = $row; 210 210 } 211 211 … … 370 370 $line = '<a href="'.$url.'">'.$line.'</a>'; 371 371 } 372 array_push($news, $line);372 $news[] = $line; 373 373 } 374 374 } … … 451 451 while ($row = pwg_db_fetch_assoc($result)) 452 452 { 453 array_push($dates, $row);453 $dates[] = $row; 454 454 } 455 455 … … 470 470 while ($row = pwg_db_fetch_assoc($result)) 471 471 { 472 array_push($dates[$i]['elements'], $row);472 $dates[$i]['elements'][] = $row; 473 473 } 474 474 } … … 490 490 while ($row = pwg_db_fetch_assoc($result)) 491 491 { 492 array_push($dates[$i]['categories'], $row);492 $dates[$i]['categories'][] = $row; 493 493 } 494 494 } … … 547 547 $description .= 548 548 '<li>' 549 .l10n_dec('%d album updated', '%d albums updated', 550 $date_detail['nb_cats']) 549 .l10n_dec('%d album updated', '%d albums updated', $date_detail['nb_cats']) 551 550 .'</li>'; 552 551 … … 558 557 .get_cat_display_name_cache($cat['uppercats']) 559 558 .' ('. 560 l10n_dec('%d new photo', 561 '%d new photos', $cat['img_count']).')' 559 l10n_dec('%d new photo', '%d new photos', $cat['img_count']).')' 562 560 .'</li>'; 563 561 } -
trunk/include/functions_plugins.inc.php
r24160 r25018 221 221 while ($row = pwg_db_fetch_assoc($result)) 222 222 { 223 array_push($plugins, $row);223 $plugins[] = $row; 224 224 } 225 225 return $plugins; -
trunk/include/functions_search.inc.php
r22175 r25018 69 69 foreach ($search['fields'][$textfield]['words'] as $word) 70 70 { 71 array_push($local_clauses, $textfield." LIKE '%".$word."%'");71 $local_clauses[] = $textfield." LIKE '%".$word."%'"; 72 72 } 73 73 … … 75 75 $local_clauses = prepend_append_array_items($local_clauses, '(', ')'); 76 76 77 array_push( 78 $clauses, 79 implode( 80 ' '.$search['fields'][$textfield]['mode'].' ', 81 $local_clauses 82 ) 77 $clauses[] = implode( 78 ' '.$search['fields'][$textfield]['mode'].' ', 79 $local_clauses 83 80 ); 84 81 } … … 101 98 foreach ($fields as $field) 102 99 { 103 array_push($field_clauses, $field." LIKE '%".$word."%'");100 $field_clauses[] = $field." LIKE '%".$word."%'"; 104 101 } 105 102 // adds brackets around where clauses 106 array_push( 107 $word_clauses, 108 implode( 109 "\n OR ", 110 $field_clauses 111 ) 103 $word_clauses[] = implode( 104 "\n OR ", 105 $field_clauses 112 106 ); 113 107 } … … 118 112 ); 119 113 120 array_push( 121 $clauses, 122 "\n ". 114 $clauses[] = "\n ". 123 115 implode( 124 "\n ". 125 $search['fields']['allwords']['mode']. 126 "\n ", 116 "\n ". $search['fields']['allwords']['mode']. "\n ", 127 117 $word_clauses 128 ) 129 ); 118 ); 130 119 } 131 120 … … 134 123 if (isset($search['fields'][$datefield])) 135 124 { 136 array_push( 137 $clauses, 138 $datefield." = '".$search['fields'][$datefield]['date']."'" 139 ); 125 $clauses[] = $datefield." = '".$search['fields'][$datefield]['date']."'" 140 126 } 141 127 … … 146 132 if (isset($search['fields'][$key])) 147 133 { 148 array_push( 149 $clauses, 150 151 $datefield. 134 $clauses[] = $datefield. 152 135 ($suffix == 'after' ? ' >' : ' <'). 153 136 ($search['fields'][$key]['inc'] ? '=' : ''). 154 " '".$search['fields'][$key]['date']."'" 155 156 ); 137 " '".$search['fields'][$key]['date']."'"; 157 138 } 158 139 } … … 172 153 173 154 $local_clause = 'category_id IN ('.implode(',', $cat_ids).')'; 174 array_push($clauses, $local_clause);155 $clauses[] = $local_clause; 175 156 } 176 157 -
trunk/include/functions_tag.inc.php
r21817 r25018 333 333 while ($row = pwg_db_fetch_assoc($result)) 334 334 { 335 array_push($tags, $row);335 $tags[] = $row; 336 336 } 337 337 return $tags; -
trunk/include/functions_url.inc.php
r23822 r25018 467 467 if (empty($maybe_permalinks)) 468 468 { 469 array_push($maybe_permalinks, $tokens[$current_token]);469 $maybe_permalinks[] = $tokens[$current_token]; 470 470 } 471 471 else 472 472 { 473 array_push($maybe_permalinks,473 $maybe_permalinks[] = 474 474 $maybe_permalinks[count($maybe_permalinks)-1] 475 . '/' . $tokens[$current_token] 476 ); 475 . '/' . $tokens[$current_token]; 477 476 } 478 477 $current_token++; … … 528 527 if ( $conf['tag_url_style'] != 'tag' and preg_match('/^(\d+)(?:-(.*)|)$/', $tokens[$i], $matches) ) 529 528 { 530 array_push($requested_tag_ids, $matches[1]);529 $requested_tag_ids[] = $matches[1]; 531 530 } 532 531 else 533 532 { 534 array_push($requested_tag_url_names, $tokens[$i]);533 $requested_tag_url_names[] = $tokens[$i]; 535 534 } 536 535 $i++; … … 598 597 { 599 598 // Add dummy element list 600 array_push($page['list'], -1);599 $page['list'][] = -1; 601 600 } 602 601 // With pictures list … … 609 608 foreach (explode(',', $tokens[$next_token]) as $image_id) 610 609 { 611 array_push($page['list'], $image_id);610 $page['list'][] = $image_id; 612 611 } 613 612 } -
trunk/include/picture_comment.inc.php
r19703 r25018 61 61 { 62 62 case 'moderate': 63 array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.'));63 $page['infos'][] = l10n('An administrator must authorize your comment before it is visible.'); 64 64 case 'validate': 65 array_push($page['infos'], l10n('Your comment has been registered'));65 $page['infos'][] = l10n('Your comment has been registered'); 66 66 break; 67 67 case 'reject': 68 68 set_status_header(403); 69 array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules'));69 $page['errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules'); 70 70 break; 71 71 default: -
trunk/include/section_init.inc.php
r22283 r25018 340 340 foreach ($page['tags'] as $tag) 341 341 { 342 array_push($page['tag_ids'], $tag['id']);342 $page['tag_ids'][] = $tag['id']; 343 343 } 344 344 -
trunk/include/ws_functions.inc.php
r25005 r25018 402 402 foreach ( array_from_query($query, 'id') as $id ) 403 403 { 404 array_push($datas, array('element_id'=>$id, 'user_id'=>$user['id']));404 $datas[] = array('element_id'=>$id, 'user_id'=>$user['id']); 405 405 } 406 406 if (count($datas)) … … 794 794 if (isset($image_id) and !in_array($image_id, $image_ids)) 795 795 { 796 array_push($new_image_ids, $image_id);796 $new_image_ids[] = $image_id; 797 797 } 798 798 … … 833 833 foreach ($user_representative_updates_for as $cat_id => $image_id) 834 834 { 835 array_push( 836 $updates, 837 array( 838 'user_id' => $user['id'], 839 'cat_id' => $cat_id, 840 'user_representative_picture_id' => $image_id, 841 ) 835 $updates[] = array( 836 'user_id' => $user['id'], 837 'cat_id' => $cat_id, 838 'user_representative_picture_id' => $image_id, 842 839 ); 843 840 } … … 995 992 { 996 993 case 'reject': 997 array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules'));994 $infos[] = l10n('Your comment has NOT been registered because it did not pass the validation rules'); 998 995 return new PwgError(403, implode("; ", $infos) ); 999 996 case 'validate': 1000 997 case 'moderate': 1001 998 $ret = array( 1002 1003 999 'id' => $comm['id'], 1000 'validation' => $comment_action=='validate', 1004 1001 ); 1005 1002 return array( 'comment' => new PwgNamedStruct($ret) ); … … 1072 1069 ); 1073 1070 $row['id']=(int)$row['id']; 1074 array_push($related_categories, $row);1071 $related_categories[] = $row; 1075 1072 } 1076 1073 usort($related_categories, 'global_rank_compare'); … … 1545 1542 { 1546 1543 ws_logfile($file); 1547 array_push($chunks, $upload_dir.'/'.$file);1544 $chunks[] = $upload_dir.'/'.$file; 1548 1545 } 1549 1546 } … … 1602 1599 if (preg_match($pattern, $file)) 1603 1600 { 1604 array_push($chunks, $upload_dir.'/'.$file);1601 $chunks[] = $upload_dir.'/'.$file; 1605 1602 } 1606 1603 } … … 1959 1956 foreach ($params['tags'] as $tag_name) 1960 1957 { 1961 $tag_id = tag_id_from_tag_name($tag_name); 1962 array_push($tag_ids, $tag_id); 1958 $tag_ids[] = tag_id_from_tag_name($tag_name); 1963 1959 } 1964 1960 } … … 1968 1964 foreach ($tag_names as $tag_name) 1969 1965 { 1970 $tag_id = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name)); 1971 array_push($tag_ids, $tag_id); 1966 $tag_ids[] = tag_id_from_tag_name(preg_replace('#\\\\*,#', ',', $tag_name)); 1972 1967 } 1973 1968 } … … 2663 2658 if ($image_id > 0) 2664 2659 { 2665 array_push($image_ids, $image_id);2660 $image_ids[] = $image_id; 2666 2661 } 2667 2662 } … … 2695 2690 } 2696 2691 2697 array_push($cat_ids, $cat_id);2692 $cat_ids[] = $cat_id; 2698 2693 2699 2694 if (!isset($rank)) … … 2804 2799 foreach ($new_cat_ids as $cat_id) 2805 2800 { 2806 array_push( 2807 $inserts, 2808 array( 2809 'image_id' => $image_id, 2810 'category_id' => $cat_id, 2811 'rank' => $rank_on_category[$cat_id], 2812 ) 2801 $inserts[] = array( 2802 'image_id' => $image_id, 2803 'category_id' => $cat_id, 2804 'rank' => $rank_on_category[$cat_id], 2813 2805 ); 2814 2806 } … … 2996 2988 if ($category_id > 0) 2997 2989 { 2998 array_push($category_ids, $category_id);2990 $category_ids[] = $category_id; 2999 2991 } 3000 2992 } … … 3054 3046 if ($category_id > 0) 3055 3047 { 3056 array_push($category_ids, $category_id);3048 $category_ids[] = $category_id; 3057 3049 } 3058 3050 } … … 3421 3413 if (!in_array($params['id'], $conf['updates_ignored'][$params['type']])) 3422 3414 { 3423 array_push($conf['updates_ignored'][$params['type']], $params['id']);3415 $conf['updates_ignored'][ $params['type'] ][] = $params['id']; 3424 3416 } 3425 3417 conf_update_param('updates_ignored', pwg_db_real_escape_string(serialize($conf['updates_ignored']))); -
trunk/include/ws_protocols/rest_encoder.php
r22729 r25018 67 67 $this->_output( '<'.$name ); 68 68 $this->_lastTagOpen = true; 69 array_push( $this->_elementStack, $name);69 $this->_elementStack[] = $name; 70 70 } 71 71 -
trunk/install.php
r25005 r25018 253 253 include(PHPWG_ROOT_PATH . 'admin/include/functions_upgrade.php'); 254 254 255 if ( isset( $_POST['install']))255 if (isset($_POST['install'])) 256 256 { 257 257 install_db_connect($infos, $errors); 258 258 pwg_db_check_charset(); 259 259 260 $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name )); 261 if ( empty($webmaster)) 262 array_push( $errors, l10n('enter a login for webmaster') ); 263 else if ( preg_match( '/[\'"]/', $webmaster ) ) 264 array_push( $errors, l10n('webmaster login can\'t contain characters \' or "') ); 265 if ( $admin_pass1 != $admin_pass2 || empty($admin_pass1) ) 266 array_push( $errors, l10n('please enter your password again') ); 267 if ( empty($admin_mail)) 268 array_push( $errors, l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)') ); 260 $webmaster = trim(preg_replace('/\s{2,}/', ' ', $admin_name)); 261 if (empty($webmaster)) 262 { 263 $errors[] = l10n('enter a login for webmaster'); 264 } 265 else if (preg_match( '/[\'"]/', $webmaster)) 266 { 267 $errors[] = l10n('webmaster login can\'t contain characters \' or "'); 268 } 269 if ($admin_pass1 != $admin_pass2 || empty($admin_pass1)) 270 { 271 $errors[] = l10n('please enter your password again'); 272 } 273 if (empty($admin_mail)) 274 { 275 $errors[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)'); 276 } 269 277 else 270 278 { 271 279 $error_mail_address = validate_mail_address(null, $admin_mail); 272 280 if (!empty($error_mail_address)) 273 array_push( $errors, $error_mail_address ); 281 { 282 $errors[] = $error_mail_address; 283 } 274 284 } 275 285 … … 389 399 foreach (get_available_upgrade_ids() as $upgrade_id) 390 400 { 391 array_push( 392 $datas, 393 array( 394 'id' => $upgrade_id, 395 'applied' => CURRENT_DATE, 396 'description' => 'upgrade included in installation', 397 ) 401 $datas[] = array( 402 'id' => $upgrade_id, 403 'applied' => CURRENT_DATE, 404 'description' => 'upgrade included in installation', 398 405 ); 399 406 } … … 450 457 else 451 458 { 452 array_push( 453 $infos, 454 l10n('Congratulations, Piwigo installation is completed') 455 ); 459 $infos[] = l10n('Congratulations, Piwigo installation is completed'); 456 460 457 461 if (isset($error_copy)) 458 462 { 459 array_push($errors, $error_copy);463 $errors[] = $error_copy; 460 464 } 461 465 else -
trunk/nbm.php
r20609 r25018 46 46 subscribe_notification_by_mail(false, array($_GET['subscribe'])); 47 47 } 48 else 49 if (isset($_GET['unsubscribe']) 48 else if (isset($_GET['unsubscribe']) 50 49 and preg_match('/^[A-Za-z0-9]{16}$/', $_GET['unsubscribe'])) 51 50 { … … 54 53 else 55 54 { 56 array_push($page['errors'], l10n('Unknown identifier'));55 $page['errors'][] = l10n('Unknown identifier'); 57 56 } 58 57 -
trunk/password.php
r25005 r25018 54 54 if (empty($_POST['username_or_email'])) 55 55 { 56 array_push($page['errors'], l10n('Invalid username or email'));56 $page['errors'][] = l10n('Invalid username or email'); 57 57 return false; 58 58 } … … 67 67 if (!is_numeric($user_id)) 68 68 { 69 array_push($page['errors'], l10n('Invalid username or email'));69 $page['errors'][] = l10n('Invalid username or email'); 70 70 return false; 71 71 } … … 77 77 if (is_a_guest($status) or is_generic($status)) 78 78 { 79 array_push($page['errors'], l10n('Password reset is not allowed for this user'));79 $page['errors'][] = l10n('Password reset is not allowed for this user'); 80 80 return false; 81 81 } … … 83 83 if (empty($userdata['email'])) 84 84 { 85 array_push( 86 $page['errors'], 87 l10n( 88 'User "%s" has no email address, password reset is not possible', 89 $userdata['username'] 90 ) 85 $page['errors'][] = l10n( 86 'User "%s" has no email address, password reset is not possible', 87 $userdata['username'] 91 88 ); 92 89 return false; … … 131 128 if (pwg_mail($userdata['email'], $email_params)) 132 129 { 133 array_push($page['infos'], l10n('Check your email for the confirmation link'));130 $page['infos'][] = l10n('Check your email for the confirmation link'); 134 131 return true; 135 132 } 136 133 else 137 134 { 138 array_push($page['errors'], l10n('Error sending email'));135 $page['errors'][] = l10n('Error sending email'); 139 136 return false; 140 137 } … … 153 150 if (!preg_match('/^[a-z0-9]{20}$/i', $key)) 154 151 { 155 array_push($page['errors'], l10n('Invalid key'));152 $page['errors'][] = l10n('Invalid key'); 156 153 return false; 157 154 } … … 168 165 if (pwg_db_num_rows($result) == 0) 169 166 { 170 array_push($page['errors'], l10n('Invalid key'));167 $page['errors'][] = l10n('Invalid key'); 171 168 return false; 172 169 } … … 176 173 if (is_a_guest($userdata['status']) or is_generic($userdata['status'])) 177 174 { 178 array_push($page['errors'], l10n('Password reset is not allowed for this user'));175 $page['errors'][] = l10n('Password reset is not allowed for this user'); 179 176 return false; 180 177 } … … 195 192 if ($_POST['use_new_pwd'] != $_POST['passwordConf']) 196 193 { 197 array_push($page['errors'], l10n('The passwords do not match'));194 $page['errors'][] = l10n('The passwords do not match'); 198 195 return false; 199 196 } … … 204 201 if (!is_numeric($user_id)) 205 202 { 206 array_push($page['errors'], l10n('Invalid key'));203 $page['errors'][] = l10n('Invalid key'); 207 204 return false; 208 205 } … … 213 210 if (is_a_guest() or is_generic()) 214 211 { 215 array_push($page['errors'], l10n('Password reset is not allowed for this user'));212 $page['errors'][] = l10n('Password reset is not allowed for this user'); 216 213 return false; 217 214 } … … 226 223 ); 227 224 228 array_push($page['infos'], l10n('Your password has been reset'));225 $page['infos'][] = l10n('Your password has been reset'); 229 226 230 227 if (isset($_GET['key'])) 231 228 { 232 array_push($page['infos'], '<a href="'.get_root_url().'identification.php">'.l10n('Login').'</a>');229 $page['infos'][] = '<a href="'.get_root_url().'identification.php">'.l10n('Login').'</a>'; 233 230 } 234 231 else 235 232 { 236 array_push($page['infos'], '<a href="'.get_gallery_home_url().'">'.l10n('Return to home page').'</a>');233 $page['infos'][] = '<a href="'.get_gallery_home_url().'">'.l10n('Return to home page').'</a>'; 237 234 } 238 235 -
trunk/picture.php
r25005 r25018 103 103 if ('best_rated'==$page['section']) 104 104 { 105 $page['rank_of'][ $page['image_id']] = count($page['items']);106 array_push($page['items'], $page['image_id'] );105 $page['rank_of'][ $page['image_id'] ] = count($page['items']); 106 $page['items'][] = $page['image_id']; 107 107 } 108 108 else … … 469 469 if (isset($page['previous_item'])) 470 470 { 471 array_push($ids, $page['previous_item']);472 array_push($ids, $page['first_item']);471 $ids[] = $page['previous_item']; 472 $ids[] = $page['first_item']; 473 473 } 474 474 if (isset($page['next_item'])) 475 475 { 476 array_push($ids, $page['next_item']);477 array_push($ids, $page['last_item']);476 $ids[] = $page['next_item']; 477 $ids[] = $page['last_item']; 478 478 } 479 479 -
trunk/plugins/LocalFilesEditor/admin.php
r25005 r25018 57 57 { 58 58 $content_file = file_get_contents(get_bak_file($edited_file)); 59 array_push($page['infos'], 60 l10n('locfiledit_bak_loaded1'), 61 l10n('locfiledit_bak_loaded2')); 59 $page['infos'][] = l10n('locfiledit_bak_loaded1'), 60 $page['infos'][] = l10n('locfiledit_bak_loaded2'); 62 61 } 63 62 … … 71 70 if (!is_webmaster()) 72 71 { 73 array_push($page['errors'], l10n('locfiledit_webmaster_only'));72 $page['errors'][] = l10n('locfiledit_webmaster_only'); 74 73 } 75 74 else … … 82 81 if ($content_file === false) 83 82 { 84 array_push($page['errors'], l10n('locfiledit_syntax_error'));83 $page['errors'][] = l10n('locfiledit_syntax_error'); 85 84 } 86 85 else … … 93 92 { 94 93 @copy($edited_file, get_bak_file($edited_file)); 95 array_push($page['infos'], l10n('locfiledit_saved_bak', substr(get_bak_file($edited_file), 2)));94 $page['infos'][] = l10n('locfiledit_saved_bak', substr(get_bak_file($edited_file), 2)); 96 95 } 97 96 … … 105 104 else 106 105 { 107 array_push($page['errors'], l10n('locfiledit_cant_save'));106 $page['errors'][] = l10n('locfiledit_cant_save'); 108 107 } 109 108 } -
trunk/plugins/LocalFilesEditor/include/css.inc.php
r20714 r25018 65 65 foreach ($db_themes as $db_theme) 66 66 { 67 array_push($db_theme_ids, $db_theme['id']);67 $db_theme_ids[] = $db_theme['id']; 68 68 } 69 69 … … 86 86 else 87 87 { 88 array_push($active_themes, $fs_theme);88 $active_themes[] = $fs_theme; 89 89 } 90 90 } 91 91 else 92 92 { 93 array_push($inactive_themes, $fs_theme);93 $inactive_themes[] = $fs_theme; 94 94 } 95 95 } -
trunk/plugins/LocalFilesEditor/include/tpl.inc.php
r20714 r25018 40 40 if (empty($filename)) 41 41 { 42 array_push($page['errors'], l10n('locfiledit_empty_filename'));42 $page['errors'][] = l10n('locfiledit_empty_filename'); 43 43 } 44 44 if (get_extension($filename) != 'tpl') … … 48 48 if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename)) 49 49 { 50 array_push($page['errors'], l10n('locfiledit_filename_error'));50 $page['errors'][] = l10n('locfiledit_filename_error'); 51 51 } 52 52 if (is_numeric($_POST['tpl_model']) and $_POST['tpl_model'] != '0') 53 53 { 54 array_push($page['errors'], l10n('locfiledit_model_error'));54 $page['errors'][] = l10n('locfiledit_model_error'); 55 55 } 56 56 if (file_exists($_POST['tpl_parent'] . '/' . $filename)) 57 57 { 58 array_push($page['errors'], l10n('locfiledit_file_already_exists'));58 $page['errors'][] = l10n('locfiledit_file_already_exists'); 59 59 } 60 60 if (!empty($page['errors'])) -
trunk/plugins/LocalFilesEditor/main.inc.php
r24926 r25018 36 36 function localfiles_admin_menu($menu) 37 37 { 38 array_push( 39 $menu, 40 array( 41 'NAME' => 'LocalFiles Editor', 42 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 43 ) 38 $menu[] = array( 39 'NAME' => 'LocalFiles Editor', 40 'URL' => get_root_url().'admin.php?page=plugin-'.basename(dirname(__FILE__)) 44 41 ); 45 42 -
trunk/profile.php
r20609 r25018 202 202 if (!empty($_POST['use_new_pwd'])) 203 203 { 204 array_push($fields, $conf['user_fields']['password']);204 $fields[] = $conf['user_fields']['password']; 205 205 // password is hashed with function $conf['password_hash'] 206 206 $data{$conf['user_fields']['password']} = $conf['password_hash']($_POST['use_new_pwd']); … … 212 212 if ($_POST['username'] != $userdata['username'] and get_userid($_POST['username'])) 213 213 { 214 array_push($page['errors'], l10n('this login is already used'));214 $page['errors'][] = l10n('this login is already used'); 215 215 unset($_POST['redirect']); 216 216 } 217 217 else 218 218 { 219 array_push($fields, $conf['user_fields']['username']);219 $fields[] = $conf['user_fields']['username']; 220 220 $data{$conf['user_fields']['username']} = $_POST['username']; 221 221 … … 263 263 if ($conf['activate_comments']) 264 264 { 265 array_push($fields, 'show_nb_comments');265 $fields[] = 'show_nb_comments'; 266 266 } 267 267 -
trunk/register.php
r20609 r25018 45 45 { 46 46 set_status_header(403); 47 array_push($page['errors'],'Invalid/expired form key');47 $page['errors'][] = l10n('Invalid/expired form key'); 48 48 } 49 49 50 50 if ($_POST['password'] != $_POST['password_conf']) 51 51 { 52 array_push($page['errors'], l10n('please enter your password again'));52 $page['errors'][] = l10n('please enter your password again'); 53 53 } 54 54 -
trunk/search.php
r25005 r25018 150 150 else 151 151 { 152 array_push($page['errors'], l10n('Empty query. No criteria has been entered.'));152 $page['errors'][] = l10n('Empty query. No criteria has been entered.'); 153 153 } 154 154 } -
trunk/search_rules.php
r25005 r25018 139 139 while ($row = pwg_db_fetch_assoc($result)) 140 140 { 141 array_push($categories, $row);141 $categories[] = $row; 142 142 } 143 143 } -
trunk/tags.php
r20609 r25018 132 132 } 133 133 134 array_push( 135 $letter['tags'], 136 array_merge( 137 $tag, 138 array( 139 'URL' => make_index_url( 140 array( 141 'tags' => array($tag), 142 ) 143 ), 144 ) 134 $letter['tags'][] = array_merge( 135 $tag, 136 array( 137 'URL' => make_index_url(array('tags' => array($tag))), 145 138 ) 146 139 ); -
trunk/upgrade.php
r25005 r25018 74 74 if (preg_match('/^'.PREFIX_TABLE.'/', $row[0])) 75 75 { 76 array_push($tables, $row[0]);76 $tables[] = $row[0]; 77 77 } 78 78 } … … 101 101 while ($row = pwg_db_fetch_row($result)) 102 102 { 103 array_push($columns_of[$table], $row[0]);103 $columns_of[$table][] = $row[0]; 104 104 } 105 105 } … … 390 390 if (!@file_put_contents($config_file, $config_file_contents)) 391 391 { 392 array_push( 393 $page['infos'], 394 sprintf( 395 l10n('In <i>%s</i>, before <b>?></b>, insert:'), 396 PWG_LOCAL_DIR.'config/database.inc.php' 397 ) 398 .'<p><textarea rows="4" cols="40">' 399 .implode("\r\n" , $mysql_changes).'</textarea></p>' 400 ); 392 $page['infos'][] = l10n( 393 'In <i>%s</i>, before <b>?></b>, insert:', 394 PWG_LOCAL_DIR.'config/database.inc.php' 395 ) 396 .'<p><textarea rows="4" cols="40">' 397 .implode("\r\n" , $mysql_changes).'</textarea></p>'; 401 398 } 402 399 } … … 431 428 ); 432 429 433 array_push($page['infos'], 434 l10n('Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.') 435 ); 430 $page['infos'][] = l10n('Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.'); 436 431 437 432 // Save $page['infos'] in order to restore after maintenance actions
Note: See TracChangeset
for help on using the changeset viewer.