aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-09-11 21:40:00 +0000
committerplegall <plg@piwigo.org>2008-09-11 21:40:00 +0000
commitd39db9aaaf43eaedd634a7a5b7d06bcb69d41152 (patch)
tree645010e01f3d84ecbc131c883ca941c50386489b /index.php
parentfdffe42bdc703a9f2391c77ae0256c33a3eac935 (diff)
feature 169 added: ability to manually sort images inside a category. A
dedicated screen let the administrator sort the images (pur HTML, no JavaScript yet). The "rank" sort order is available only for a category without flat mode. New database column image_category.rank. git-svn-id: http://piwigo.org/svn/trunk@2517 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/index.php b/index.php
index 0cf3a11ca..b74c370c5 100644
--- a/index.php
+++ b/index.php
@@ -260,16 +260,19 @@ if ( count($page['items']) > 0
$order_idx = pwg_get_session_var( 'image_order', 0 );
$orders = get_category_preferred_image_orders();
- for ($i = 0; $i < count($orders); $i++)
+ foreach ($orders as $order_id => $order)
{
- if ($orders[$i][2])
+ if ($order[2])
{
$template->append(
'image_orders',
array(
- 'DISPLAY' => $orders[$i][0],
- 'URL' => add_url_params( duplicate_index_url(), array('image_order'=>$i) ),
- 'SELECTED' => ($order_idx==$i ? true:false),
+ 'DISPLAY' => $order[0],
+ 'URL' => add_url_params(
+ duplicate_index_url(),
+ array('image_order' => $order_id)
+ ),
+ 'SELECTED' => ($order_idx == $order_id ? true:false),
)
);
}