in_ajax_call)) { ?> in_ajax_call)) { echo '
'; } $calendar = ''; $year = $offset_year; $month = $offset_month; $uxtime_first_of_month = gmmktime(0, 0, 0, $month, 1, $year); # Remember that mktime will automatically correct if invalid dates are entered # for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998 # this provides a built in "rounding" feature to generate_calendar() $month_weekday = gmdate('w', $uxtime_first_of_month); $days_in_month = gmdate('t', $uxtime_first_of_month); $day_names_long = array('SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY'); $day_names_short = array('SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'); $month_names = array('', 'JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER'); $month_name_short = Text::_($month_names[(int)$month] . '_SHORT'); $month_name_long = Text::_($month_names[(int)$month]); $weekday = ($month_weekday + 7 - $first_day) % 7; # adjust for $first_day of week $the_year = $Year_length ? $year : substr($year, -2); # full or last two digits if (!function_exists('mb_convert_case')) { $the_month = ucfirst(htmlentities($Month_length ? $month_name_short : $month_name_long, ENT_COMPAT, "UTF-8")); $the_month_prev = ucfirst(htmlentities(Text::_($month_names[(int)$prev_month] . ($Month_length ? '_SHORT' : '')), ENT_COMPAT, "UTF-8")); $the_month_next = ucfirst(htmlentities(Text::_($month_names[(int)$next_month] . ($Month_length ? '_SHORT' : '')), ENT_COMPAT, "UTF-8")); $the_month_today = ucfirst(htmlentities(Text::_($month_names[(int)$today_month] . ($Month_length ? '_SHORT' : '')), ENT_COMPAT, "UTF-8")); } else { $the_month = mb_convert_case($Month_length ? $month_name_short : $month_name_long, MB_CASE_TITLE, "UTF-8"); $the_month_prev = mb_convert_case(Text::_($month_names[(int)$prev_month] . ($Month_length ? '_SHORT' : '')), MB_CASE_TITLE, "UTF-8"); $the_month_next = mb_convert_case(Text::_($month_names[(int)$next_month] . ($Month_length ? '_SHORT' : '')), MB_CASE_TITLE, "UTF-8"); $the_month_today = mb_convert_case(Text::_($month_names[(int)$today_month] . ($Month_length ? '_SHORT' : '')), MB_CASE_TITLE, "UTF-8"); } $title = $the_month . ' ' . $the_year; # Begin calendar. Uses a real . See https://diveintomark.org/archives/2002/07/03 $calendar .= '' . "\n"; # Month navigation links # use $url_base_nojs or $url_base_ajax followed by $props_prev, $props_home, or $props_next $navi_nojs = ''; $calendar .= $navi_nojs; if ($use_ajax) { $navi_ajax = ''; $calendar .= $navi_ajax; } # If the day names should be shown ($day_name_length > 0) if ($day_name_length) { $calendar .= ''; # If day_name_length is >3, the full name of the day will be printed if ($day_name_length > 3) { for ($d = 0; $d < 7; ++$d) { $dayname = Text::_($day_names_long[($d + $first_day) % 7]); $calendar .= ''; } } else { for ($d = 0; $d < 7; ++$d) { $dayname = Text::_($day_names_short[($d + $first_day) % 7]); if (function_exists('mb_substr')) { $calendar .= ''; } else { $calendar .= ''; } } } $calendar .= "\n"; } # Today $config = Factory::getConfig(); $tzoffset = $config->get('config.offset'); $time = time() + (($tzoffset + $Time_offset) * 60 * 60); //25/2/08 Change for v 0.6 to incorporate server offset into time; $today = date('j', $time); $currmonth = date('m', $time); $curryear = date('Y', $time); # Switch off tooltips if neighter title nor text should be shown if (($Show_Tooltips_Title == 0) && ($tooltips_max_events === '0')) { $Show_Tooltips = 0; } $calendar .= ''; # Initial 'empty' days for ($counti = 0; $counti < $weekday; $counti++) { $calendar .= ''; } # The days of interest for ($day = 1; $day <= $days_in_month; $day++, $weekday++) { if ($weekday == 7) { $weekday = 0; #start a new week $calendar .= "\n"; } $istoday = ($day == $today) && ($currmonth == $month) && ($curryear == $year); $tdbaseclass = ($istoday) ? 'mod_jemcalq_caltoday' : 'mod_jemcalq_calday'; # Space in front of daynumber when day < 10 $space = ($day < 10) ? '  ': ''; if (isset($days[$day][1])) { $link = $days[$day][0]; $title = $days[$day][1]; if ($Show_Tooltips == 1) { $calendar .= ''; } else { $calendar .= ''; } } else { $calendar .= ''; } } # Remaining 'empty' days for ($counti = $weekday; $counti < 7; $counti++) { $calendar .= ''; } $calendar .= "\n
'; $navi_nojs .= $props_prev_year ? ('<<  ') : '<<  '; $navi_nojs .= $props_prev ? ('<  ') : '<  '; $navi_nojs .= $props_home ? ('' . $title . '') : $title; $navi_nojs .= $props_next ? ('  >') : '  >'; $navi_nojs .= $props_next_year ? ('  >>') : '  >>'; $navi_nojs .= ''; $navi_ajax .= $props_prev_year ? ('<<  ') : '<<  '; $navi_ajax .= $props_prev ? ('<  ') : '<  '; $navi_ajax .= $props_home ? ('' . $title . '') : $title; $navi_ajax .= $props_next ? ('  >') : '  >'; $navi_ajax .= $props_next_year ? ('  >>') : '  >>'; $navi_ajax .= '
 ' . $dayname . '  ' . mb_substr($dayname, 0, $day_name_length, 'UTF-8') . '  ' . substr($dayname, 0, $day_name_length) . ' 
 
' . $space . $day . ' 
\n"; echo $calendar; if (!$use_ajax || empty($module->in_ajax_call)) { echo "
"; }