Show
Ignore:
Timestamp:
06/05/06 01:15:49 (2 years ago)
Author:
sdcosta
Message:

Fix for #402 ( config option to decide whether folders / categories in the sidebar are expanded or collapsed by default )

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/cls/channels.php

    r1181 r1483  
    205205            if (array_key_exists(COLLAPSED_FOLDERS_COOKIE, $_COOKIE)) { 
    206206                $this->collapsed_ids = explode(":", $_COOKIE[COLLAPSED_FOLDERS_COOKIE]); 
    207             } 
    208      
    209             //get unread count per folder 
     207            }  elseif (empty($this->collapsed_ids) && getConfig("rss.output.channelcollapsedefault")) { 
     208               // Lets collapse all folders 
     209               $res = rss_query("select id from " . getTable('folders') . " where id != 0"); 
     210               while (list ($this->collapsed_ids[]) = rss_fetch_row($res)) { 
     211               } 
     212               if (!headers_sent()) { // Sajax does not allow us to set cookies 
     213                setcookie(COLLAPSED_FOLDERS_COOKIE,  
     214                  implode(":", $this->collapsed_ids ) , time()+COOKIE_LIFESPAN,getPath()); 
     215               } 
     216            } 
    210217     
    211218            //get unread count per folder