});
	});

</script>
<div id="select_eventspot_event" style="display:none;">
	<div class="wrap">
		<div style="padding:15px 15px 0 15px;">

			<a href="http://katz.si/4o" rel="external"><img src="<?php 
echo plugins_url('images/eventspot-logo.png', EVENTSPOT_FILE);
?>
" alt="EventSpot from Constant Contact" /></a>

		<?php 
$return = array();
$events = constant_contact_old_api_get_all('Events', CTCT_EventSpot::getInstance()->old_api, null, $return, null, true);
if ($events instanceof Exception) {
    printf(__('<p>There was a problem fetching the Events:</p><pre>%s</pre>', 'ctct'), $events->getMessage());
    $events = false;
}
if (empty($events)) {
    include EVENTSPOT_FILE_PATH . '/views/promo.php';
} else {
    include EVENTSPOT_FILE_PATH . '/views/insert-event.php';
}
// End empty events
?>
		</div>
	</div>
</div>
 /**
  * Output events.
  *
  * Pass $args as an array with the following settings.
  * 'id' // REQUIRED if you want to show a single event! The ID is the ID of the event. Looks like a18g4v1b611561nn40b. If empty, show a list of events.
  * 'limit' // If you want to embed a list of events, limit the list to this number. You can set the limit to 0 and have it show all events (not ideal if you have a bunch of events). Default: 3; Type: number
  * 'showtitle' // Show the title of the event. Default: true
  * 'showdescription' // Show the description of the event. Default: true
  * 'datetime' // Show the date and time of the event. Default: true
  * 'location' // Show the location of the event. Default: false
  * 'map' // Show a link to the map. Default: false
  * 'calendar' // Show a link to add the event to calendar. Default: false
  * 'style' // Style the event listing with some basic styles? Default: true
  * 'newwindow' // Open the links in a new window? Default: false
  * 'onlyactive' // Only show active events? Default: true
  * 'mobile' // If users are on mobile devices, link to a mobile-friendly registration page? Default: true,
  * 'no_events_text' // Text to display when there are no events shown.
  * @param  array   $args    Output settings. See function description.
  * @param  boolean $echo    Echo or return events output
  * @return [type]           [description]
  */
 function events_output($args = array(), $echo = false)
 {
     $settings = shortcode_atts(array('limit' => 3, 'showtitle' => true, 'showdescription' => true, 'datetime' => true, 'location' => false, 'calendar' => false, 'style' => true, 'id' => false, 'newwindow' => false, 'map' => false, 'onlyactive' => true, 'sidebar' => false, 'mobile' => true, 'class' => 'cc_event', 'no_events_text' => __('There are no active events.', 'ctct')), $args);
     foreach ($settings as $key => $arg) {
         if (strtolower($arg) == 'false' || empty($arg)) {
             $settings["{$key}"] = false;
         }
     }
     if (empty($settings['id'])) {
         $settings['events'] = constant_contact_old_api_get_all('Events', $this->old_api);
         $settings['class'] .= ' multiple_events';
     } else {
         $settings['class'] .= ' single_event';
         $settings['events'] = array(CTCT_EventSpot::getInstance()->old_api->getEventDetails(new Event(array('link' => sprintf('/ws/customers/%s/events/%s', CTCT_USERNAME, $settings['id'])))));
     }
     $this->settings = $settings;
     $output = kws_ob_include(EVENTSPOT_FILE_PATH . 'shortcode.php', $this);
     if ($echo) {
         echo $output;
     } else {
         return $output;
     }
 }