Changeset 559 for trunk/plogger.php

Show
Ignore:
Timestamp:
07/15/08 14:08:55 (4 months ago)
Author:
sidtheduck
Message:

+ Partial fix for ticket #184 - truncating the collections and albums if only 1 album or 1 collection is present

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plogger.php

    r555 r559  
    7171// use plogger specific variables to avoid name clashes if Plogger is embedded 
    7272 
    73 $GLOBALS['plogger_level'] = isset($_GET["level"]) ? $_GET["level"] : ''; 
    74 $GLOBALS['plogger_id'] = isset($_GET["id"]) ? intval($_GET["id"]) : 0; 
    75 $GLOBALS['plogger_mode'] = isset($_GET["mode"]) ? $_GET["mode"] : ''; 
     73$GLOBALS['plogger_level'] = isset($_GET['level']) ? $_GET['level'] : ''; 
     74$GLOBALS['plogger_id'] = isset($_GET['id']) ? intval($_GET['id']) : 0; 
     75$GLOBALS['plogger_mode'] = isset($_GET['mode']) ? $_GET['mode'] : ''; 
     76 
     77// count collections and albums with pictures in them 
     78$active = get_active_collections_albums(); 
     79 
     80// if only 1 active album, truncate the "collection" & "collections" portion of Plogger 
     81if (count($active['albums']) == 1) { 
     82        $config['truncate_breadcrumb'] = 'album'; 
     83        if ($GLOBALS['plogger_level']!="picture") { 
     84                if ($GLOBALS['plogger_level']!="search") { 
     85                        $GLOBALS['plogger_level'] = "album"; 
     86                } 
     87                $GLOBALS['plogger_id'] = $active['albums'][0]; 
     88        } 
     89// if only 1 active collection, truncate the "collections" portion of Plogger 
     90} else if (count($active['collections']) == 1) { 
     91        $config['truncate_breadcrumb'] = 'collection'; 
     92        if ($GLOBALS['plogger_level']!="album" && $GLOBALS['plogger_level']!='picture') { 
     93                if ($GLOBALS['plogger_level']!="search") { 
     94                        $GLOBALS['plogger_level'] = "collection"; 
     95                } 
     96                $GLOBALS['plogger_id'] = $active['collections'][0]; 
     97        } 
     98} else { 
     99        $config['truncate_breadcrumb'] = false; 
     100} 
    76101 
    77102$allowed_levels = array('collections','collection','album','picture','search');