aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_list.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-02-20 19:28:43 +0000
committerplegall <plg@piwigo.org>2012-02-20 19:28:43 +0000
commit12bf0f72bb1e0c5d897bd7b11bea363cfb0b9e06 (patch)
tree2960b53953ba2ab478fce57bf23df2208256af5f /admin/cat_list.php
parent4c19a2443c0e4eab92563533eb6a62516d03cb4f (diff)
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
Diffstat (limited to '')
-rw-r--r--admin/cat_list.php100
1 files changed, 52 insertions, 48 deletions
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
@@ -100,6 +100,13 @@ $navigation.= l10n('Home');
$navigation.= '</a>';
// +-----------------------------------------------------------------------+
+// | tabs |
+// +-----------------------------------------------------------------------+
+
+$page['tab'] = 'list';
+include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php');
+
+// +-----------------------------------------------------------------------+
// | virtual categories management |
// +-----------------------------------------------------------------------+
// request to delete a virtual category
@@ -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')
+ );
}
// +-----------------------------------------------------------------------+