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;"/>';
        }
    }
}
echo $params->get('text_after');
?>

    foreach ($this->calendars as $calendar) {
        $itemID = GCalendarUtil::getItemId($calendar->get('gcid'));
        $menus =& JSite::getMenu();
        $params = $menus->getParams($itemID);
        if (empty($params)) {
            $params = new JParameter('');
        }
        $dateformat = $params->get('description_date_format', '%d.%m.%Y');
        $timeformat = $params->get('description_time_format', '%H:%M');
        $event_display = $params->get('description_format', '<p>{startdate} {starttime} {dateseparator} {enddate} {endtime}<br/>{description}</p>');
        if (!empty($itemID)) {
            $itemID = '&Itemid=' . $itemID;
        } else {
            $menu = JSite::getMenu();
            $activemenu = $menu->getActive();
            if ($activemenu != null) {
                $itemID = '&Itemid=' . $activemenu->id;
            }
        }
        $items = $calendar->get_items();
        foreach ($items as $event) {
            $allDayEvent = $event->get_day_type() == $event->SINGLE_WHOLE_DAY || $event->get_day_type() == $event->MULTIPLE_WHOLE_DAY;
            $description = GCalendarUtil::renderEvent($event, $event_display, $dateformat, $timeformat);
            if (strlen($description) > 200) {
                $description = substr($description, 0, 196) . ' ...';
            }
            $data[] = array('id' => $event->get_id(), 'title' => htmlspecialchars_decode($event->get_title()), 'start' => strftime('%Y-%m-%dT%H:%M:%S', $event->get_start_date()), 'end' => strftime('%Y-%m-%dT%H:%M:%S', $allDayEvent ? $event->get_end_date() - $SECSINDAY : $event->get_end_date()), 'url' => JRoute::_('index.php?option=com_gcalendar&view=event&eventID=' . $event->get_id() . '&start=' . $event->get_start_date() . '&end=' . $event->get_end_date() . '&gcid=' . $calendar->get('gcid') . $itemID), 'className' => "gcal-event_gccal_" . $calendar->get('gcid'), 'allDay' => $allDayEvent, 'description' => $description);
        }
    }
}
echo json_encode($data);