$daysMin = "["; $monthsLong = "["; $monthsShort = "["; for ($i = 0; $i < 7; $i++) { $daysLong .= "'" . GCalendarUtil::dayToString($i, false) . "'"; $daysShort .= "'" . GCalendarUtil::dayToString($i, true) . "'"; $daysMin .= "'" . substr(GCalendarUtil::dayToString($i, true), 0, 2) . "'"; if ($i < 6) { $daysLong .= ","; $daysShort .= ","; $daysMin .= ","; } } for ($i = 1; $i <= 12; $i++) { $monthsLong .= "'" . GCalendarUtil::monthToString($i, false) . "'"; $monthsShort .= "'" . GCalendarUtil::monthToString($i, true) . "'"; if ($i < 12) { $monthsLong .= ","; $monthsShort .= ","; } } $daysLong .= "]"; $daysShort .= "]"; $daysMin .= "]"; $monthsLong .= "]"; $monthsShort .= "]"; $calCode = "// <![CDATA[ \n"; $calCode .= "jQuery(document).ready(function(){\n"; $calCode .= "\tvar today = new Date();\n"; $calCode .= "\tvar tmpYear = today.getFullYear();\n"; $calCode .= "\tvar tmpMonth = today.getMonth();\n";
$daysMin = "["; $monthsLong = "["; $monthsShort = "["; for ($i = 0; $i < 7; $i++) { $daysLong .= "'" . htmlspecialchars(GCalendarUtil::dayToString($i, false), ENT_QUOTES) . "'"; $daysShort .= "'" . htmlspecialchars(GCalendarUtil::dayToString($i, true), ENT_QUOTES) . "'"; $daysMin .= "'" . htmlspecialchars(mb_substr(GCalendarUtil::dayToString($i, true), 0, 2), ENT_QUOTES) . "'"; if ($i < 6) { $daysLong .= ","; $daysShort .= ","; $daysMin .= ","; } } for ($i = 1; $i <= 12; $i++) { $monthsLong .= "'" . htmlspecialchars(GCalendarUtil::monthToString($i, false), ENT_QUOTES) . "'"; $monthsShort .= "'" . htmlspecialchars(GCalendarUtil::monthToString($i, true), ENT_QUOTES) . "'"; if ($i < 12) { $monthsLong .= ","; $monthsShort .= ","; } } $daysLong .= "]"; $daysShort .= "]"; $daysMin .= "]"; $monthsLong .= "]"; $monthsShort .= "]"; $calCode = "// <![CDATA[ \n"; $calCode .= "jQuery(document).ready(function(){\n"; $calCode .= "\tvar today = new Date();\n"; $calCode .= "\tvar tmpYear = today.getFullYear();\n"; $calCode .= "\tvar tmpMonth = today.getMonth();\n";
defined('_JEXEC') or die('Restricted access'); $document =& JFactory::getDocument(); $document->addStyleSheet(JURI::base() . 'modules/mod_gcalendar_upcoming/tmpl/default.css'); $event_display = $params->get('output', ''); $dateformat = $params->get('date_format', '%d.%m.%Y'); $timeformat = $params->get('time_format', '%H:%M'); echo $params->get('text_before'); if (!empty($gcalendar_data)) { if ($params->get('images', 'no') != 'no') { echo '<p style="clear: both;"/>'; } foreach ($gcalendar_data as $item) { // APRIL 2010 MOD - CALENDAR IMAGES by Tyson Moore if ($params->get('images', 'no') != 'no') { $tmp = JFactory::getDate($item->get_start_date()); $month_text = strtoupper(GCalendarUtil::monthToString($tmp->toFormat('%m'), true)); $day = $tmp->toFormat('%d'); $feed = $item->get_feed(); $colorImageBackground = $params->get('images', 'yes') == 'custom' ? '#' . $params->get('calimage_background') : GCalendarUtil::getFadedColor($feed->get('gccolor'), 80); $colorMonth = $params->get('images', 'yes') == 'custom' ? $params->get('calimage_month') : 'FFFFFF'; $colorDay = $params->get('images', 'yes') == 'custom' ? $params->get('calimage_day') : $feed->get('gccolor'); echo '<div class="gc_up_mod_img">'; echo '<div class="gc_up_mod_month_background" style="background-color: ' . $colorImageBackground . ';"></div>'; echo '<div class="gc_up_mod_month_text" style="color: #' . $colorMonth . ';">' . $month_text . '</div>'; echo '<div class="gc_up_mod_day" style="color: #' . $colorDay . ';">' . $day . '</div>'; echo '</div>'; } //END MOD echo GCalendarUtil::renderEvent($item, $event_display, $dateformat, $timeformat); if ($params->get('images', 'no') != 'no') { echo '<p style="clear: both;"/>';