/** Event Calendar widget. */ function ec3_widget_cal($args) { extract($args); $options = get_option('ec3_widget_cal'); echo $before_widget . $before_title; echo ec3_widget_title($options['title'], 'Event Calendar'); echo $after_title; if (ec3_check_installed('Event-Calendar')) { require_once dirname(__FILE__) . '/calendar-sidebar.php'; global $ec3; $calobj = new ec3_SidebarCalendar($options); echo $calobj->generate(); } echo $after_widget; }
function generate() { global $ec3; $result = parent::generate(); if (empty($ec3->done_bigcal_javascript)) { $ec3->done_bigcal_javascript = true; $result .= "\t<script type='text/javascript' src='" . $ec3->myfiles . "/calendar-big.js'></script>\n"; } $result .= "\t<script type='text/javascript'><!--\n" . "\t ec3.calendars['{$this->id}'].new_day = ec3.big_cal.new_day;\n" . "\t ec3.calendars['{$this->id}'].update_day = ec3.big_cal.update_day;\n" . "\t--></script>\n"; return $result; }
/** Template function, for backwards compatibility. * Call this from your template to insert the Sidebar Event Calendar. */ function ec3_get_calendar($options = false) { if (!ec3_check_installed('Event-Calendar')) { return; } require_once dirname(__FILE__) . '/calendar-sidebar.php'; $calobj = new ec3_SidebarCalendar($options); echo $calobj->generate(); }