mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
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
This commit is contained in:
+53
-49
@@ -99,6 +99,13 @@ $navigation = '<a href="'.$base_url.'">';
|
||||
$navigation.= l10n('Home');
|
||||
$navigation.= '</a>';
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | 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);
|
||||
}
|
||||
|
||||
$query = '
|
||||
$categories = array();
|
||||
$names = array();
|
||||
$id_uppercats = array();
|
||||
|
||||
$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
|
||||
);
|
||||
save_categories_order($categories);
|
||||
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
{
|
||||
array_push(
|
||||
$page['infos'],
|
||||
l10n('Albums automatically sorted')
|
||||
$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
|
||||
);
|
||||
save_categories_order($categories);
|
||||
|
||||
array_push(
|
||||
$page['infos'],
|
||||
l10n('Albums automatically sorted')
|
||||
);
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user