Ejemplo n.º 1
0
$limit = min($limit, 1000);
$inline = get_parameter_value($params, 'inline', -1);
$reverse = get_parameter_value($params, 'reverse', false);
// defaults for y/md/d (default to current month view).
$year = date('Y');
$month = date('m');
$day = -1;
// get y/m/d from session
$use_session = get_parameter_value($params, 'use_session');
if ($use_session) {
    $sessionkey = $use_session . cgcalendar_utils::get_sessionkey($params);
    list($year, $month, $day) = cgcalendar_utils::to_ymd($this->session_get($sessionkey . 'date', $thedate));
}
// get y/m/d from params
if (isset($params['date'])) {
    list($year, $month, $day) = cgcalendar_utils::to_ymd($params['date']);
} else {
    $year = (int) cge_utils::get_param($params, 'year', $year);
    $month = (int) cge_utils::get_param($params, 'month', $month);
    $day = (int) cge_utils::get_param($params, 'day', $day);
}
$thedate = sprintf("%d-%d", (int) $year, (int) $month);
if ($day > 0) {
    $thedate .= sprintf('-%d', (int) $day);
}
if ($day > 0) {
    $thedate .= sprintf('-%d', (int) $day);
}
if (!empty($sessionkey)) {
    $this->session_put($sessionkey . 'date', $thedate);
    $inline = 1;