Ejemplo n.º 1
0
    if ($event) {
        $phpcid = $event['cid'];
    }
}
if (!isset($phpcid)) {
    $calendars = $phpcdb->get_calendars();
    if (empty($calendars)) {
        if (empty($vars['action'])) {
            if (is_admin()) {
                $vars['action'] = 'admin';
            } else {
                $vars['action'] = 'settings';
            }
        }
    } else {
        if ($phpc_user->get_default_cid() !== false) {
            $default_cid = $phpc_user->get_default_cid();
        } else {
            $default_cid = $phpcdb->get_config('default_cid');
        }
        if (!empty($calendars[$default_cid])) {
            $phpcid = $default_cid;
        } else {
            $phpcid = reset($calendars)->get_cid();
        }
    }
}
if (isset($phpcid)) {
    $phpc_cal = $phpcdb->get_calendar($phpcid);
    if (empty($phpc_cal)) {
        soft_error(__("Bad calendar ID."));