aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_category.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-03-05 22:55:04 +0000
committerz0rglub <z0rglub@piwigo.org>2004-03-05 22:55:04 +0000
commita9847f6a699dc88b1574ec1d05fa2e90bf029edc (patch)
treea4e7befeb818fa5b6faf6a53e876f2e152499314 /include/functions_category.inc.php
parent989e4c3dac0101a9d40686daa330cbca6cf1a6bd (diff)
deletion of expand string in $_GET array
git-svn-id: http://piwigo.org/svn/trunk@387 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_category.inc.php')
-rw-r--r--include/functions_category.inc.php26
1 files 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