aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_list.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-10-19 17:43:04 +0000
committermistic100 <mistic@piwigo.org>2013-10-19 17:43:04 +0000
commitae707279a1945e383c312cd648d288606a79e341 (patch)
tree917bdc6e0609ed0eefed5f3693de3a017685acc4 /admin/cat_list.php
parent35ff1b7c1f933799397a0ce0a6723cf82f416ff3 (diff)
remove all array_push (50% slower than []) + some changes missing for feature:2978
git-svn-id: http://piwigo.org/svn/trunk@25018 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/cat_list.php')
-rw-r--r--admin/cat_list.php30
1 files changed, 9 insertions, 21 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php
index baba5e2c9..6caa393f4 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -78,7 +78,7 @@ function save_categories_order($categories)
$current_rank++;
}
- array_push($datas, array('id' => $id, 'rank' => $current_rank));
+ $datas[] = array('id' => $id, 'rank' => $current_rank);
}
$fields = array('primary' => array('id'), 'update' => array('rank'));
mass_updates(CATEGORIES_TABLE, $fields, $datas);
@@ -133,11 +133,11 @@ else if (isset($_POST['submitAdd']))
if (isset($output_create['error']))
{
- array_push($page['errors'], $output_create['error']);
+ $page['errors'][] = $output_create['error'];
}
else
{
- array_push($page['infos'], $output_create['info']);
+ $page['infos'][] = $output_create['info'];
}
}
// save manual category ordering
@@ -146,10 +146,7 @@ else if (isset($_POST['submitManualOrder']))
asort($_POST['catOrd'], SORT_NUMERIC);
save_categories_order(array_keys($_POST['catOrd']));
- array_push(
- $page['infos'],
- l10n('Album manual order was saved')
- );
+ $page['infos'][] = l10n('Album manual order was saved');
}
else if (isset($_POST['submitAutoOrder']))
{
@@ -178,17 +175,11 @@ SELECT id, name, id_uppercat
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
{
- array_push(
- $categories,
- array(
- 'id' => $row['id'],
- 'id_uppercat' => $row['id_uppercat'],
- )
- );
- array_push(
- $names,
- $row['name']
+ $categories[] = array(
+ 'id' => $row['id'],
+ 'id_uppercat' => $row['id_uppercat'],
);
+ $names[] = $row['name'];
}
array_multisort(
@@ -199,10 +190,7 @@ SELECT id, name, id_uppercat
);
save_categories_order($categories);
- array_push(
- $page['infos'],
- l10n('Albums automatically sorted')
- );
+ $page['infos'][] = l10n('Albums automatically sorted');
}
// +-----------------------------------------------------------------------+