From 12bf0f72bb1e0c5d897bd7b11bea363cfb0b9e06 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 20 Feb 2012 19:28:43 +0000 Subject: feature 2581: new design on albums list management. icons removed, replaced by text links visible on :hover better ergonomy for automatic order: the "save manual order" submit button only appears when a change is detected in the album ordering. The "automatic sort order" becomes a dedicated fieldset, hidden by default, displayed "on user demand". new virtual album form displayed only "on user demand" cat_list, cat_move and permalinks are 3 tabs for the "Albums > Manage" link in the menubar. permalinks admin page slightly redesign: fieldsets instead of centered h3, "on user demand" form to add/modify permalinks. git-svn-id: http://piwigo.org/svn/trunk@13282 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/cat_list.php | 100 ++++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 48 deletions(-) (limited to 'admin/cat_list.php') diff --git a/admin/cat_list.php b/admin/cat_list.php index c8df189d1..f1d57390b 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -99,6 +99,13 @@ $navigation = ''; $navigation.= l10n('Home'); $navigation.= ''; +// +-----------------------------------------------------------------------+ +// | tabs | +// +-----------------------------------------------------------------------+ + +$page['tab'] = 'list'; +include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php'); + // +-----------------------------------------------------------------------+ // | virtual categories management | // +-----------------------------------------------------------------------+ @@ -134,71 +141,68 @@ else if (isset($_POST['submitAdd'])) } } // save manual category ordering -else if (isset($_POST['submitOrder'])) +else if (isset($_POST['submitManualOrder'])) { - if ('manual' == $_POST['order_type']) - { - asort($_POST['catOrd'], SORT_NUMERIC); - save_categories_order(array_keys($_POST['catOrd'])); + asort($_POST['catOrd'], SORT_NUMERIC); + save_categories_order(array_keys($_POST['catOrd'])); - array_push( - $page['infos'], - l10n('Album manual order was saved') - ); - } - else - { - $query = ' + array_push( + $page['infos'], + l10n('Album manual order was saved') + ); +} +else if (isset($_POST['submitAutoOrder'])) +{ + $query = ' SELECT id FROM '.CATEGORIES_TABLE.' WHERE id_uppercat '. (!isset($_GET['parent_id']) ? 'IS NULL' : '= '.$_GET['parent_id']).' ;'; - $category_ids = array_from_query($query, 'id'); + $category_ids = array_from_query($query, 'id'); - if (isset($_POST['recursive'])) - { - $category_ids = get_subcat_ids($category_ids); - } - - $categories = array(); - $names = array(); - $id_uppercats = array(); + if (isset($_POST['recursive'])) + { + $category_ids = get_subcat_ids($category_ids); + } + + $categories = array(); + $names = array(); + $id_uppercats = array(); - $query = ' + $query = ' SELECT id, name, id_uppercat FROM '.CATEGORIES_TABLE.' WHERE id IN ('.implode(',', $category_ids).') ;'; - $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'] - ); - } - - array_multisort( - $names, - SORT_REGULAR, - 'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC, - $categories + $result = pwg_query($query); + while ($row = pwg_db_fetch_assoc($result)) + { + array_push( + $categories, + array( + 'id' => $row['id'], + 'id_uppercat' => $row['id_uppercat'], + ) ); - save_categories_order($categories); - array_push( - $page['infos'], - l10n('Albums automatically sorted') + $names, + $row['name'] ); } + + array_multisort( + $names, + SORT_REGULAR, + 'asc' == $_POST['ascdesc'] ? SORT_ASC : SORT_DESC, + $categories + ); + save_categories_order($categories); + + array_push( + $page['infos'], + l10n('Albums automatically sorted') + ); } // +-----------------------------------------------------------------------+ -- cgit v1.2.3