Location: PHPKode > projects > phlyMail Lite > phlymail/handlers/calendar/folderlist.php
<?php
/**
 * Returning the list of folders (calendars)
 * @package phlyMail Nahariya 4.0+, Branch MessageCenter
 * @subpackage Handler Calendar
 * @copyright 2004-2009 phlyLabs, Berlin (http://phlylabs.de)
 * @version 0.1.2 2009-11-14
 */
// Only valid within phlyMail
if (!defined('_IN_PHM_')) die();

class calendar
{
    public function __construct(&$_PM_, $mode)
    {
    	if (file_exists($_PM_['path']['handler'].'/calendar/lang.'.$GLOBALS['WP_msg']['language'].'.php')) {
    		require_once($_PM_['path']['handler'].'/calendar/lang.'.$GLOBALS['WP_msg']['language'].'.php');
    	} else {
    		require_once($_PM_['path']['handler'].'/calendar/lang.de.php');
    	}
        require_once($_PM_['path']['handler'].'/calendar/driver.mysql.php');
        $this->cDB = new calendar_driver($_SESSION['phM_uid']);
        $this->_PM_ = $_PM_;
    	$this->WP_msg = $WP_msg;
        return true;
    }

    public function get()
    {
        $return = array();
        foreach ($this->cDB->get_grouplist(true) as $k => $v) {
            $return[] = array
                ('path' => $v['gid']
                ,'icon' => ':calendar'
                ,'foldername' => $v['name']
                ,'type' => 2
                ,'subdirs' => false
                );
        }
        return array(0 => array
            ('path' => 0
            ,'icon' => ':calendar'
            ,'foldername' => $this->WP_msg['CalCalendar']
            ,'type' => 2
            ,'subdirs' => (!empty($return)) ? $return : false
            ));
    }
}
?>
Return current item: phlyMail Lite