__( 'Map of events posts', 'event-post' ))); $this->defaults = array( 'numberposts' => '', 'widgettitle' => '', 'cat' => '', 'tag' => '', 'height' => '', 'width' => '', 'future' => 0, 'past' => 0, 'thumbnail' => 0, 'thumbnail_size' => '', 'excerpt' => 0, 'tile' => $EventPost->settings['tile'], ); // UI options foreach($EventPost->map_interactions as $int_key=>$int_name){ $this->defaults[$int_key]=true; } } public function EventPost_Map(){ $this->__construct(); } function widget($args, $local_instance) { global $EventPost; extract( $args ); $instance = wp_parse_args((array) $local_instance, $this->defaults); global $EventPost; $events = $EventPost->get_events( array( 'nb' => $instance['numberposts'], 'future' => $instance['future'], 'past' => $instance['past'], 'geo' => 1, 'cat' => $instance['cat'], 'tag' => $instance['tag'] ) ); if (sizeof($events) > 0) { echo $args['before_widget']; if (!empty($instance['widgettitle'])) { echo $args['before_title']; echo $instance['widgettitle']; echo $args['after_title']; } $atts = array( 'events' => $events, 'width' => $instance['width'], 'height' => $instance['height'], 'geo' => 1, 'class' => 'eventpost_widget', 'thumbnail' => $instance['thumbnail'], 'thumbnail_size' => $instance['thumbnail_size'], 'excerpt' => $instance['excerpt'], 'tile' => $instance['tile'] ); foreach($EventPost->map_interactions as $int_key=>$int_name){ $atts[$int_key]=$instance[$int_key]; } echo $EventPost->list_events($atts, 'event_geolist', 'widget'); echo $args['after_widget']; } } /** * * @global object $EventPost * @param array $new_instance * @param array $old_instance * @return array */ function update($new_instance, $old_instance) { global $EventPost; foreach($EventPost->map_interactions as $int_key=>$int_name){ if(!isset($new_instance[$int_key])){ $new_instance[$int_key]=false; } } return $new_instance; } /** * * @global object $EventPost * @param array $instance */ function form($local_instance) { global $EventPost; $instance = wp_parse_args( (array) $local_instance, $this->defaults ); $cats = get_categories(); $tags = get_tags(); $thumbnail_sizes = $EventPost->get_thumbnail_sizes(); ?>


(px, %)

(px, %)


map_interactions as $int_key=>$int_name): ?>