Location: PHPKode > projects > phlyMail Lite > phlymail/handlers/calendar/flist.php
<?php
/**
 * @package phlyMail Nahariya 4.0+ Default Branch
 * @subpackage Calendar Handler
 * @copyright 2004-2010 phlyLabs, Berlin (http://phlylabs.de)
 * @version 4.1.2 2010-01-20
 */
// Only valid within phlyMail
if (!defined('_IN_PHM_')) die();
$icon_path = $_PM_['path']['theme'].'/icons/';

// No privleges, no folders
if (!$_SESSION['phM_privs']['all'] && !$_SESSION['phM_privs']['calendar_see_calendar']) {
    sendJS(array('handler' => 'calendar', 'childof' => array(), 'folders' => array()), 1, 1);
}
if (file_exists($_PM_['path']['handler'].'/calendar/lang.'.$WP_msg['language'].'.php')) {
    require_once($_PM_['path']['handler'].'/calendar/lang.'.$WP_msg['language'].'.php');
} else {
    require_once($_PM_['path']['handler'].'/calendar/lang.de.php');
}
require_once($_PM_['path']['handler'].'/calendar/driver.mysql.php');
$cDB = new calendar_driver($_SESSION['phM_uid']);
session_write_close(); // Don't block other processes
$childof = array(0 => array('root'));
$return = array('root' => false);
foreach ($cDB->get_grouplist(true) as $k => $v) {
    $return[$v['gid']] = array
            ('path' => $v['gid'], 'foldername' => $v['name']
            ,'icon' => $icon_path.'calendar.png', 'big_icon' => $icon_path.'calendar_big.gif'
            ,'type' => 2
            ,'subdirs' => 0
            ,'childof' => 'root'
            ,'has_folders' => 0
            ,'has_items' => 1, 'level' => 1, 'ctx' => 1
            ,'ctx_props' => 1, 'ctx_resync' => 0, 'ctx_subfolder' => 0
            ,'is_collapsed' => (isset($_PM_['foldercollapses']) && isset($_PM_['foldercollapses']['calendar_'.$k]) && $_PM_['foldercollapses']['calendar_'.$k]) ? 1 : 0
            ,'ctx_move' => 0
            ,'ctx_rename' => ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['calendar_edit_group']) ? 1 : 0
            ,'ctx_dele' => ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['calendar_delete_group']) ? 1 : 0
            ,'ctx_share' => 0
            );
    $childof['root'][] = $v['gid'];
}
$return['root'] = array
        ('path' => 0, 'foldername' => $WP_msg['CalMyEvents']
        ,'icon' => $icon_path.'calendar.png', 'big_icon' => $icon_path.'calendar_big.gif'
        ,'type' => 2, 'subdirs' => (!empty($return)) ? 1 : 0
        ,'has_folders' => (!empty($return)) ? 1 : 0
        ,'has_items' => 1
        ,'childof' => 0
        ,'level' => 0
        ,'ctx' => 1
        ,'ctx_props' => 1
        ,'ctx_resync' => 0
        ,'ctx_subfolder' => ($_SESSION['phM_privs']['all'] || $_SESSION['phM_privs']['calendar_add_group']) ? 1 : 0
        ,'is_collapsed' => (isset($_PM_['foldercollapses']) && isset($_PM_['foldercollapses']['calendar_root']) && $_PM_['foldercollapses']['calendar_root']) ? 1 : 0
        ,'ctx_move' => 0, 'ctx_rename' => 0, 'ctx_dele' => 0, 'ctx_share' => 0
        );
sendJS(array('handler' => 'calendar', 'childof' => $childof, 'folders' => $return), 1, 1);
?>
Return current item: phlyMail Lite