From a9847f6a699dc88b1574ec1d05fa2e90bf029edc Mon Sep 17 00:00:00 2001 From: z0rglub Date: Fri, 5 Mar 2004 22:55:04 +0000 Subject: deletion of expand string in $_GET array git-svn-id: http://piwigo.org/svn/trunk@387 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_category.inc.php | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index fd19770a0..1652f3b6e 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -87,12 +87,12 @@ function get_user_plain_structure() $query.= ' INNER JOIN '.USER_CATEGORY_TABLE.' AS uc'; $query.= ' ON c.id = uc.category_id'; $query.= ' WHERE user_id = '.$user['id']; - if ( $page['expand'] != 'all' ) + if ( !$user['expand'] ) { $query.= ' AND (id_uppercat is NULL'; if ( count( $page['tab_expand'] ) > 0 ) { - $query.= ' OR id_uppercat IN ('.$page['expand'].')'; + $query.= ' OR id_uppercat IN ('.implode(',',$page['tab_expand']).')'; } $query.= ')'; } @@ -174,7 +174,6 @@ function update_structure( $categories ) foreach ( $categories as $category ) { // update the "expanded" key if ( $user['expand'] - or $page['expand'] == 'all' or in_array( $category['id'], $page['tab_expand'] ) ) { $category['expanded'] = true; @@ -183,27 +182,6 @@ function update_structure( $categories ) { $category['expanded'] = false; } - // update the "expand_string" key - if ( $page['expand'] == 'all' ) - { - $category['expand_string'] = 'all'; - } - else - { - $tab_expand = $page['tab_expand']; - if ( in_array( $category['id'], $page['tab_expand'] ) ) - { - // the expand string corresponds to the $page['tab_expand'] without - // the $category['id'] - $tab_expand = array_diff( $page['tab_expand'],array($category['id']) ); - } - else if ( $category['nb_sub_categories'] > 0 ) - { - // we have this time to add the $category['id']... - $tab_expand = array_merge($page['tab_expand'],array($category['id'])); - } - $category['expand_string'] = implode( ',', $tab_expand ); - } // recursive call $category['subcats'] = update_structure( $category['subcats'] ); // adding the updated category -- cgit v1.2.3