Changeset 387


Ignore:
Timestamp:
Mar 5, 2004, 11:55:04 PM (21 years ago)
Author:
z0rglub
Message:

deletion of expand string in $_GET array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_category.inc.php

    r362 r387  
    8888  $query.= ' ON c.id = uc.category_id';
    8989  $query.= ' WHERE user_id = '.$user['id'];
    90   if ( $page['expand'] != 'all' )
     90  if ( !$user['expand'] )
    9191  {
    9292    $query.= ' AND (id_uppercat is NULL';
    9393    if ( count( $page['tab_expand'] ) > 0 )
    9494    {
    95       $query.= ' OR id_uppercat IN ('.$page['expand'].')';
     95      $query.= ' OR id_uppercat IN ('.implode(',',$page['tab_expand']).')';
    9696    }
    9797    $query.= ')';
     
    175175    // update the "expanded" key
    176176    if ( $user['expand']
    177          or $page['expand'] == 'all'
    178177         or in_array( $category['id'], $page['tab_expand'] ) )
    179178    {
     
    183182    {
    184183      $category['expanded'] = false;
    185     }
    186     // update the "expand_string" key
    187     if ( $page['expand'] == 'all' )
    188     {
    189       $category['expand_string'] = 'all';
    190     }
    191     else
    192     {
    193       $tab_expand = $page['tab_expand'];
    194       if ( in_array( $category['id'], $page['tab_expand'] ) )
    195       {
    196         // the expand string corresponds to the $page['tab_expand'] without
    197         // the $category['id']
    198         $tab_expand = array_diff( $page['tab_expand'],array($category['id']) );
    199       }
    200       else if ( $category['nb_sub_categories'] > 0 )
    201       {
    202         // we have this time to add the $category['id']...
    203         $tab_expand = array_merge($page['tab_expand'],array($category['id']));
    204       }
    205       $category['expand_string'] = implode( ',', $tab_expand );
    206184    }
    207185    // recursive call
Note: See TracChangeset for help on using the changeset viewer.