Skip to content

Commit

Permalink
feature 1906: report the "use the album defined sort order" in the ne…
Browse files Browse the repository at this point in the history
…w Batch

Manager.


git-svn-id: http://piwigo.org/svn/trunk@8397 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Dec 30, 2010
1 parent 7ce257c commit 884437a
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions admin/batch_manager_global.php
Expand Up @@ -430,9 +430,9 @@
;';
display_select_cat_wrapper($query, $selected_category, 'filter_category_options', true);

// Dissociate from a category : categories listed for dissociation can
// only represent virtual links. Links to physical categories can't be
// broken
// Dissociate from a category : categories listed for dissociation can only
// represent virtual links. We can't create orphans. Links to physical
// categories can't be broken.
if (count($page['cat_elements_id']) > 0)
{
$query = '
Expand Down Expand Up @@ -527,10 +527,41 @@
);
$template->assign('navbar', $nav_bar);

$is_category = false;
if (isset($_SESSION['bulk_manager_filter']['category'])
and !isset($_SESSION['bulk_manager_filter']['category_recursive']))
{
$is_category = true;
}

$query = '
SELECT id,path,tn_ext,file,filesize,level,name
FROM '.IMAGES_TABLE.'
WHERE id IN ('.implode(',', $page['cat_elements_id']).')
FROM '.IMAGES_TABLE;

if ($is_category)
{
$category_info = get_cat_info($_SESSION['bulk_manager_filter']['category']);

$conf['order_by'] = $conf['order_by_inside_category'];
if (!empty($category_info['image_order']))
{
$conf['order_by'] = ' ORDER BY '.$category_info['image_order'];
}

$query.= '
JOIN '.IMAGE_CATEGORY_TABLE.' ON id = image_id';
}

$query.= '
WHERE id IN ('.implode(',', $page['cat_elements_id']).')';

if ($is_category)
{
$query.= '
AND category_id = '.$_SESSION['bulk_manager_filter']['category'];
}

$query.= '
'.$conf['order_by'].'
LIMIT '.$page['nb_images'].' OFFSET '.$page['start'].'
;';
Expand Down

0 comments on commit 884437a

Please sign in to comment.