Ejemplo n.º 1
0
 public function widget($args, $instance)
 {
     extract($args);
     /* User-selected settings. */
     $title = apply_filters('widget_title', $instance['title']);
     // get the current post
     global $post;
     if (isset($post->post_content)) {
         // check the post content for the short code
         if (strpos($post->post_content, '[ESPRESSO_CALENDAR') === FALSE) {
             // Before widget (defined by themes).
             echo $before_widget;
             // Title of widget (before and after defined by themes).
             if ($title) {
                 echo $before_title . $title . $after_title;
             }
             $attributes = array('event_category_id' => $instance['category_id'], 'show_expired' => $instance['show_expired'], 'cal_view' => 'month', 'widget' => TRUE, 'header_left' => 'prev', 'header_center' => 'title', 'header_right' => 'next', 'titleFormat_month' => 'MMM yyyy');
             // get calendar options
             $calendar_options = get_option('espresso_calendar_options', array());
             if (isset($calendar_options['show_tooltips']) && $calendar_options['show_tooltips'] ? TRUE : FALSE) {
                 wp_enqueue_style('qtip');
                 wp_enqueue_script('jquery-qtip');
             }
             wp_enqueue_style('fullcalendar');
             wp_enqueue_style('espresso_calendar');
             wp_enqueue_script('espresso_calendar');
             echo EE_Calendar::instance()->espresso_calendar($attributes);
             // After widget (defined by themes).
             echo $after_widget;
         }
     }
 }
Ejemplo n.º 2
0
        return FALSE;
    }
    public function __clone()
    {
        return FALSE;
    }
    public function __wakeup()
    {
        return FALSE;
    }
    public function __destruct()
    {
        return FALSE;
    }
}
EE_Calendar::instance();
// http://uniapple.net/blog/?p=274
/*class Elapse_time {
	private $_start = 0;
	private $_stop = 0;
	private $_elpase = 0;

	public function start(){
		$this->_start = array_sum(explode(' ',microtime()));
	}
	public function stop(){
		$this->_stop = array_sum(explode(' ',microtime()));
	}
	public function get_elapse( $line_nmbr ){
		$this->_elpase = $this->_stop - $this->_start;
		return sprintf( 'L# %d) elpased time : %.3f<br/>', $line_nmbr, $this->_elpase );