fixes #1780 automatically switch to the old album manager

This commit is contained in:
plegall
2022-11-08 12:17:52 +01:00
parent 26d61b976e
commit 7f00155ca7
3 changed files with 23 additions and 1 deletions

View File

@@ -13,6 +13,25 @@ if (!defined('PHPWG_ROOT_PATH'))
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
$query = '
SELECT
COUNT(*)
FROM '.CATEGORIES_TABLE.'
;';
list($albums_counter) = pwg_db_fetch_row(pwg_query($query));
if ($albums_counter > $conf['light_album_manager_threshold'])
{
$url = get_root_url().'admin.php?page=cat_list';
if (isset($_GET['parent_id']))
{
$url.= '&parent_id='.$_GET['parent_id'];
}
redirect($url);
}
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok |
// +-----------------------------------------------------------------------+

View File

@@ -226,7 +226,7 @@ $template->assign(
'U_ADD_PHOTOS_ALBUM' => $base_url.'photos_add&album='.$category['id'],
'U_CHILDREN' => $cat_list_url.'&parent_id='.$category['id'],
'U_HELP' => get_root_url().'admin/popuphelp.php?page=cat_modify',
'U_MOVE' => $base_url.'albums#cat-'.$category['id'],
'U_MOVE' => $base_url.'albums&parent_id='.$category['id'].'#cat-'.$category['id'],
'F_ACTION' => $form_action,
)

View File

@@ -98,6 +98,9 @@ $conf['newcat_default_status'] = 'public';
// newcat_default_position : at creation, should the album appear at the first or last position ?
$conf['newcat_default_position'] = 'first';
// above which number of albums should Piwigo use the lighter album manager
$conf['light_album_manager_threshold'] = 2000;
// level_separator : character string used for separating a category level
// to the sub level. Suggestions : ' / ', ' » ', ' → ', ' - ',
// ' >'