function render()
 {
     $updated = isset($_GET['incsub_event_settings_saved']) && $_GET['incsub_event_settings_saved'] == 1;
     if (!class_exists('WpmuDev_HelpTooltips')) {
         require_once eab_plugin_dir() . 'lib/class_wd_help_tooltips.php';
     }
     $tips = new WpmuDev_HelpTooltips();
     $tips->set_icon_url(eab_plugin_url() . 'img/information.png');
     if (!(defined('EAB_PREVENT_SETTINGS_SECTIONS') && EAB_PREVENT_SETTINGS_SECTIONS)) {
         $tabbable = 'tabbable';
     } else {
         $tabbable = false;
     }
     $hide = !empty($tabbable) ? 'hide' : '';
     $archive_tpl = file_exists(get_stylesheet_directory() . '/archive-incsub_event.php') ? get_stylesheet_directory() . '/archive-incsub_event.php' : get_template_directory() . '/archive-incsub_event.php';
     $archive_tpl_present = apply_filters('eab-settings-appearance-archive_template_copied', file_exists($archive_tpl));
     $single_tpl = file_exists(get_stylesheet_directory() . '/single-incsub_event.php') ? get_stylesheet_directory() . '/single-incsub_event.php' : get_template_directory() . '/single-incsub_event.php';
     $single_tpl_present = apply_filters('eab-settings-appearance-single_template_copied', file_exists($single_tpl));
     $theme_tpls_present = apply_filters('eab-settings-appearance-templates_copied', $archive_tpl_present && $single_tpl_present);
     $raw_tpl_sets = glob(EAB_PLUGIN_DIR . 'default-templates/*');
     $templates = array();
     foreach ($raw_tpl_sets as $item) {
         if (!is_dir($item)) {
             continue;
         }
         $key = basename($item);
         $label = ucwords(preg_replace('/[^a-z0-9]+/i', ' ', $key));
         $templates[$key] = sprintf(__("Plugin: %s", eab_domain()), $label);
     }
     foreach (get_page_templates() as $name => $tpl) {
         $templates[$tpl] = sprintf(__("Theme: %s", eab_domain()), $name);
     }
     include_once 'views/settings-menu.php';
 }
    function render()
    {
        // Filter the help....
        $help = apply_filters('eab-shortcodes-shortcode_help', array());
        if (!class_exists('WpmuDev_HelpTooltips')) {
            require_once eab_plugin_dir() . 'lib/class_wd_help_tooltips.php';
        }
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $out = '';
        $count = 0;
        $half = (int) (count($help) / 2);
        $out .= '<div class="postbox-container">';
        foreach ($help as $shortcode) {
            $out .= '<div class="eab-metabox postbox"><h3 class="eab-hndle">' . $shortcode['title'] . '</h3>';
            $out .= '<div class="eab-inside">';
            $out .= '	<div class="eab-settings-settings_item">';
            $out .= '		<strong>' . __('Tag:', eab_domain()) . '</strong> <code>[' . $shortcode['tag'] . ']</code>';
            if (!empty($shortcode['note'])) {
                $out .= '<div class="eab-note">' . $shortcode['note'] . '</div>';
            }
            $out .= '	</div>';
            if (!empty($shortcode['arguments'])) {
                $out .= ' <div class="eab-settings-settings_item" style="line-height:1.5em"><strong>' . __('Arguments:', eab_domain()) . '</strong>';
                foreach ($shortcode['arguments'] as $argument => $data) {
                    if (!empty($shortcode['advanced_arguments']) && !current_user_can('manage_options')) {
                        if (in_array($argument, $shortcode['advanced_arguments'])) {
                            continue;
                        }
                    }
                    $type = !empty($data['type']) ? eab_call_template('util_shortcode_argument_type_string_info', $data['type'], $argument, $shortcode['tag'], $tips) : false;
                    $out .= "<div class='eab-shortcode-attribute_item'><code>{$argument}</code> - {$data['help']} {$type}</div>";
                }
                $out .= '</div><!-- Attributes -->';
            }
            $out .= '</div></div>';
            $count++;
            if ($count == $half) {
                $out .= '</div><div class="postbox-container eab-postbox_container-last">';
            }
        }
        $out .= '</div>';
        echo '<div class="wrap">
				<h1>' . __('Events Shortcodes', eab_domain()) . '</h1>
				<div class="eab-metaboxcol metabox-holder eab-metaboxcol-one eab-metaboxcol-center columns-2">';
        echo $out;
        echo '</div></div>';
    }
    /**
     * Admin settings
     *
     */
    function show_settings()
    {
        if (!class_exists('WpmuDev_HelpTooltips')) {
            require_once dirname(__FILE__) . '/lib/class_wd_help_tooltips.php';
        }
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        ?>
		<div id="eab-settings-redirect" class="eab-metabox postbox">
				<h3 class="eab-hndle"><?php 
        _e('Event Controlled Redirect settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
				<div class="eab-inside">
					<div class="eab-settings-settings_item">
					    <label for="incsub_event-global_redirect_source" ><?php 
        _e('Global source page ID', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="10" name="event_default[global_redirect_source]" value="<?php 
        print $this->_data->get_option('global_redirect_source');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('If you enter an ID here all events which do NOT have a source page ID setting will use this setting.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

					<div class="eab-settings-settings_item">
					    <label for="incsub_event-global_redirect_target" ><?php 
        _e('Global target url', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="40" name="event_default[global_redirect_target]" value="<?php 
        print $this->_data->get_option('global_redirect_target');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('If you enter an url here all events which do NOT have a target url setting will use this setting.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>


				</div>
		    </div>
		<?php 
    }
    /**
     * Admin settings
     *
     */
    function show_settings()
    {
        if (!class_exists('WpmuDev_HelpTooltips')) {
            require_once dirname(__FILE__) . '/lib/class_wd_help_tooltips.php';
        }
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        ?>
		<div id="eab-settings-weekly_calendar" class="eab-metabox postbox">
				<h3 class="eab-hndle"><?php 
        _e('Weekly Event Calendar settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
				<div class="eab-inside">
					<div class="eab-settings-settings_item">
					    <label for="incsub_event-weekly_calendar_start" ><?php 
        _e('Calendar start hour', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="10" name="event_default[weekly_calendar_start]" value="<?php 
        print $this->_data->get_option('weekly_calendar_start');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('Enter the hour of the day calendar starts in 24 hour format, without am/pm and minutes, e.g. 13. Default is 10 (10am).', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

					<div class="eab-settings-settings_item">
					    <label for="incsub_event-weekly_calendar_end" ><?php 
        _e('Calendar end hour', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="10" name="event_default[weekly_calendar_end]" value="<?php 
        print $this->_data->get_option('weekly_calendar_end');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('Enter the hour of the day calendar ends in 24 hour format, without am/pm and minutes, e.g. 22. Default is 24 (12pm).', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

					<div class="eab-settings-settings_item">
					    <label for="incsub_event-weekly_calendar_interval" ><?php 
        _e('Calendar step interval (minutes)', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="10" name="event_default[weekly_calendar_interval]" value="<?php 
        print $this->_data->get_option('weekly_calendar_interval');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('Enter the number of minutes which will determine how many rows the calendar table will have. Default is 120 (2 hours). Minimum allowed value is 10. Too small values may result a long table.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

					<div class="eab-settings-settings_item">
					    <label for="incsub_event-weekly_calendar_display" ><?php 
        _e('Display in tooltip', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<select name="event_default[weekly_calendar_display]">
						<option value=""><?php 
        _e('Event venue, thumbnail, starting date and content', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</option>
						<option value="author" <?php 
        if ($this->_data->get_option('weekly_calendar_display')) {
            echo "selected='selected'";
        }
        ?>
><?php 
        _e('Author name, avatar and bio', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</option>

						</select>
						<span><?php 
        echo $tips->add_tip(__('Select which items should be displayed in the tooltip, i.e. when visitor places the mouse over the event.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

				</div>
		    </div>
		<?php 
    }
    function show_settings()
    {
        $categories = get_terms('eab_events_category', array('hide_empty' => false));
        array_unshift($categories, 'default');
        $colors = $this->_data->get_option("eab-colors");
        $colors = $colors ? $colors : array();
        $default_bg = '#75AB24';
        $default_fg = '#FFFFFF';
        $use_widget = $this->_data->get_option('eab-colors-use_widget') ? 'checked="checked"' : '';
        $use_expanded_widget = $this->_data->get_option('eab-colors-use_expanded_widget') ? 'checked="checked"' : '';
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        ?>
<div id="eab-settings-colors" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Event Colors', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
	<?php 
        foreach ($categories as $category) {
            ?>
		<div class="eab-settings-settings_item">
		<?php 
            if (is_object($category)) {
                $label = sprintf(__('Event category: &quot;%s&quot;', Eab_EventsHub::TEXT_DOMAIN), esc_html($category->name));
                $cat = sanitize_html_class($category->slug);
                $for = esc_attr("eab-colors-{$category->slug}");
                $value_bg = !empty($colors[$cat]['bg']) || '#' == $colors[$cat]['bg'] ? esc_attr($colors[$cat]['bg']) : $default_bg;
                $value_fg = !empty($colors[$cat]['fg']) || '#' == $colors[$cat]['fg'] ? esc_attr($colors[$cat]['fg']) : $default_fg;
            } else {
                $label = __('Default', Eab_EventsHub::TEXT_DOMAIN);
                $cat = '__default__';
                $for = esc_attr("eab-colors-{$cat}");
                $value_bg = !empty($colors[$cat]['bg']) || '#' == $colors[$cat]['bg'] ? esc_attr($colors[$cat]['bg']) : $default_bg;
                $value_fg = !empty($colors[$cat]['fg']) || '#' == $colors[$cat]['fg'] ? esc_attr($colors[$cat]['fg']) : $default_fg;
                $default_bg = $value_bg;
                $default_fg = $value_fg;
            }
            ?>
			<b><?php 
            echo $label;
            ?>
</b><br />
			<label for="<?php 
            echo $for;
            ?>
-bg">
				<?php 
            _e('Background', Eab_EventsHub::TEXT_DOMAIN);
            ?>
				<input type="color" name="eab-colors[<?php 
            echo $cat;
            ?>
][bg]" value="<?php 
            echo $value_bg;
            ?>
" />
			</label>
			<label for="<?php 
            echo $for;
            ?>
-fg">
				<?php 
            _e('Text', Eab_EventsHub::TEXT_DOMAIN);
            ?>
				<input type="color" name="eab-colors[<?php 
            echo $cat;
            ?>
][fg]" value="<?php 
            echo $value_fg;
            ?>
" />
			</label>
			<label for="<?php 
            echo $for;
            ?>
-skip">
				<input type="checkbox" id="<?php 
            echo $for;
            ?>
-skip" name="eab-colors[<?php 
            echo $cat;
            ?>
][skip]" value="1" <?php 
            echo !empty($colors[$cat]['skip']) ? 'checked="checked"' : '';
            ?>
 />
				<?php 
            _e('Skip', Eab_EventsHub::TEXT_DOMAIN);
            ?>
			</label>
		</div>
	<?php 
        }
        ?>
		<div class="eab-settings-settings_item">
			<button id="eab-colors-reset_to_defaults" class="button"><?php 
        _e('Reset to defaults', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</button>
		</div>
		<div class="eab-settings-settings_item">
			<input type="hidden" name="eab-colors-use_widget" value="" />
			<input type="checkbox" name="eab-colors-use_widget" id="eab-colors-use_widget" value="1" <?php 
        echo $use_widget;
        ?>
 />
			<label for="eab-colors-use_widget"><?php 
        esc_html_e(__('Apply backgrounds to single-category calendar widget', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Selecting this option will propagate foreground and background color to your Calendar widget events, provided there is only one category selected for displaying.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
		</div>
		<div class="eab-settings-settings_item">
			<input type="hidden" name="eab-colors-use_expanded_widget" value="" />
			<input type="checkbox" name="eab-colors-use_expanded_widget" id="eab-colors-use_expanded_widget" value="1" <?php 
        echo $use_expanded_widget;
        ?>
 />
			<label for="eab-colors-use_expanded_widget"><?php 
        esc_html_e(__('Apply colors to calendar widget expanded events', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</label>
		</div>
	</div>
</div>
<script>
(function ($) {
$(function () {
	var $fields = $('#eab-settings-colors input[type="color"]');
	if ($fields.length && $fields.wpColorPicker) $fields.wpColorPicker();
	$("#eab-colors-reset_to_defaults").click(function () {
		$fields.val('');
	});
});
})(jQuery);
</script>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $from = $this->_data->get_option('eab_rsvps-email-from');
        $from = $from ? $from : get_option('admin_email');
        $subject = $this->_data->get_option('eab_rsvps-email-subject');
        $body = $this->_data->get_option('eab_rsvps-email-body');
        $codec = new Eab_Events_RsvpEmail_Codec();
        $macros = join('</code>, <code>', $codec->get_macros());
        $events = Eab_CollectionFactory::get_upcoming_events(eab_current_time(), array('posts_per_page' => 10));
        ?>
<div id="eab-settings-eab_rsvps_email" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('RSVP Email settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_rsvps-from"><?php 
        _e('From email address', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('This is the address the RSVP email will be sent from', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<input type="text" id="eab_event-eab_rsvps-from" name="eab_rsvps[email-from]" value="<?php 
        esc_attr_e($from);
        ?>
" />
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_rsvps-subject"><?php 
        _e('Email subject', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(sprintf(__('This is your email subject. You can use these macros: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros));
        ?>
</span>
			<input type="text" class="widefat" id="eab_event-eab_rsvps-subject" name="eab_rsvps[email-subject]" value="<?php 
        esc_attr_e($subject);
        ?>
" />
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_rsvps-body"><?php 
        _e('Email body', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(sprintf(__('This is your email body. You can use these macros: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros));
        ?>
</span>
			<?php 
        wp_editor($body, 'eab_rsvps-email-body', array('name' => 'eab_rsvps-email-body'));
        ?>
	    </div>
	    <div class="eab-settings-settings_item"><small><?php 
        printf(__('You can use these macros in your subject and body: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros);
        ?>
</small></div>
	<?php 
        if ($events) {
            ?>
	    <div class="eab-settings-settings_item">
	    	<input type="button" class="button" id="eab_event-eab_rsvps-preview" value="<?php 
            esc_attr_e(__('Preview', Eab_EventsHub::TEXT_DOMAIN));
            ?>
" />
	    	<?php 
            _e('using this event data:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
	    	<select id="eab_event-eab_rsvps-events">
	    	<?php 
            foreach ($events as $event) {
                ?>
	    		<option value="<?php 
                esc_attr_e($event->get_id());
                ?>
"><?php 
                echo $event->get_title();
                ?>
</option>
	    	<?php 
            }
            ?>
	    	</select>
	    	<div id="eab_event-eab_rsvp-email_preview_container" style="line-height: 1.2em"></div>
	    </div>
	<?php 
        }
        ?>
	</div>
</div>
<script type="text/javascript">
(function ($) {
$(function () {
	var $container = $("#eab_event-eab_rsvp-email_preview_container"),
		$subject = $("#eab_event-eab_rsvps-subject"),
		$events = $("#eab_event-eab_rsvps-events")
	;
	$("#eab_event-eab_rsvps-preview").on("click", function () {
		var body_string = (tinyMCE && tinyMCE.activeEditor
			? tinyMCE.activeEditor.getContent()
			: $("#eab_rsvps-email-body").val()
		);
		$container.html('<?php 
        echo esc_js(__("Please, hold on... ", Eab_EventsHub::TEXT_DOMAIN));
        ?>
');
		$.post(ajaxurl, {
			"action": "eab_rsvp_email-preview_email",
			"subject": $subject.val(),
			"body": body_string,
			"event_id": $events.val()
		}, function (data) {
			$container.html(data);
		}, 'html');
	});
})
})(jQuery);
</script>
		<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $runs = array('3600' => __('Hour', Eab_EventsHub::TEXT_DOMAIN), '7200' => __('Two hours', Eab_EventsHub::TEXT_DOMAIN), '10800' => __('Three hours', Eab_EventsHub::TEXT_DOMAIN), '21600' => __('Six hours', Eab_EventsHub::TEXT_DOMAIN), '43200' => __('Twelve hours', Eab_EventsHub::TEXT_DOMAIN), '86400' => __('Day', Eab_EventsHub::TEXT_DOMAIN));
        $run_each = $this->_data->get_option('rsvp_auto_reset-run_each');
        $run_each = $run_each ? $run_each : 3600;
        $cutoff = $this->_data->get_option('rsvp_auto_reset-cutoff');
        $cutoff = $cutoff ? $cutoff : 3600;
        $remove_attendance = $this->_data->get_option('rsvp_auto_reset-remove_attendance') ? 'checked="checked"' : '';
        ?>
<div id="eab-settings-rsvp_status_auto_reset" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('RSVP status auto-reset settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
	    	<label><?php 
        _e('Schedule checks to run every:', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<select name="eab_rsvps[rsvp_auto_reset-run_each]">
			<?php 
        foreach ($runs as $sinterval => $slabel) {
            ?>
				<option value="<?php 
            echo (int) $sinterval;
            ?>
" <?php 
            echo selected($sinterval, $run_each);
            ?>
><?php 
            echo $slabel;
            ?>
</option>
			<?php 
        }
        ?>
			</select>
			<span><?php 
        echo $tips->add_tip(__('Schedule runs to execute this often', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label><?php 
        _e('Auto-reset unpaid RSVPs older then:', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<select name="eab_rsvps[rsvp_auto_reset-cutoff]">
			<?php 
        foreach ($runs as $cinterval => $clabel) {
            ?>
				<option value="<?php 
            echo (int) $cinterval;
            ?>
" <?php 
            echo selected($cinterval, $cutoff);
            ?>
><?php 
            echo $clabel;
            ?>
</option>
			<?php 
        }
        ?>
			</select>
			<span><?php 
        echo $tips->add_tip(__('Unpaid positive RSVPs cutoff time', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
		<div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_rsvps-rsvp_auto_reset-remove_attendance"><?php 
        _e('Remove attendance entirely', Eab_EventsHub::TEXT_DOMAIN);
        ?>
?</label>
			<input type="checkbox" id="eab_event-eab_rsvps-rsvp_auto_reset-remove_attendance" name="eab_rsvps[rsvp_auto_reset-remove_attendance]" value="1" <?php 
        print $remove_attendance;
        ?>
 />
			<span><?php 
        echo $tips->add_tip(__('By default, the plugin will reset the user attendance to "no". Select this option if you wish to remove their attendance records entirely instead.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
	</div>
</div>
<?php 
    }
    /**
     * Admin settings
     *
     */
    function show_settings()
    {
        if (!class_exists('WpmuDev_HelpTooltips')) {
            require_once dirname(__FILE__) . '/lib/class_wd_help_tooltips.php';
        }
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        ?>
		<div id="eab-settings-manual_payments" class="eab-metabox postbox">
				<h3 class="eab-hndle"><?php 
        _e('Manual Payment settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
				<div class="eab-inside">
					<div class="eab-settings-settings_item">
					    <label for="incsub_event-manual_payment_select" ><?php 
        _e('Select button text', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="40" name="event_default[manual_payment_select]" value="<?php 
        print $this->_data->get_option('manual_payment_select');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('This is the text that will appear on Select Manual Payment button.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

					<div class="eab-settings-settings_item">
					    <label for="incsub_event-manual_payment_pay" ><?php 
        _e('Pay button text', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
						<input type="text" size="40" name="event_default[manual_payment_pay]" value="<?php 
        print $this->_data->get_option('manual_payment_pay');
        ?>
" />
						<span><?php 
        echo $tips->add_tip(__('This is the text that will appear on Pay button. User needs to click this button after he made the payment.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
					</div>

					<div class="eab-settings-settings_item">
					    <label for="incsub_event-manual_payment_instructions" ><?php 
        _e('Instructions', Eab_EventsHub::TEXT_DOMAIN);
        ?>
&nbsp;:</label>
						<span><?php 
        echo $tips->add_tip(__('Write the procedure that the user needs to do for a manual payment here. Use MANUALPAYMENTBUTTON to insert the Pay Button to the desired location.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
						<?php 
        wp_editor($this->_data->get_option('manual_payment_instructions'), 'manualpaymentsinstructions', array('textarea_name' => 'event_default[manual_payment_instructions]', 'textarea_rows' => 5));
        ?>
					</div>

				</div>
		    </div>
		<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $positive_rsvp = $this->_data->get_option('eab_rsvps-email_me-positive_rsvp') ? 'checked="checked"' : '';
        $paid_rsvp = $this->_data->get_option('eab_rsvps-email_me-paid_rsvp') ? 'checked="checked"' : '';
        $notify_admin = $this->_data->get_option('eab_rsvps-email_me-notify_admin') ? 'checked="checked"' : '';
        $notify_author = $this->_data->get_option('eab_rsvps-email_me-notify_author') ? 'checked="checked"' : '';
        $subject = $this->_data->get_option('eab_rsvps-email_me-subject');
        $body = $this->_data->get_option('eab_rsvps-email_me-body');
        $codec = new Eab_Events_RsvpEmailMe_Codec();
        $macros = join('</code>, <code>', $codec->get_macros());
        $events = Eab_CollectionFactory::get_upcoming_events(eab_current_time(), array('posts_per_page' => 10));
        ?>
<div id="eab-settings-eab_rsvps_me" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('RSVP Notification Email settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
	    	<label><?php 
        _e('Send an update', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<label for="eab_event-eab_rsvps-me-positive_rsvp" style="display:block; line-height:1.8em">
				<input type="hidden" name="eab_rsvps_me[email-positive_rsvp]" value="" />
				<input type="checkbox" id="eab_event-eab_rsvps-me-positive_rsvp" name="eab_rsvps_me[email-positive_rsvp]" value="1" <?php 
        echo $positive_rsvp;
        ?>
 />
				<?php 
        _e('On all positive RSVPs', Eab_EventsHub::TEXT_DOMAIN);
        ?>
			</label>
			<label for="eab_event-eab_rsvps-me-paid_rsvp" style="display:block; line-height:1.8em">
				<input type="hidden" name="eab_rsvps_me[email-paid_rsvp]" value="" />
				<input type="checkbox" id="eab_event-eab_rsvps-me-paid_rsvp" name="eab_rsvps_me[email-paid_rsvp]" value="1" <?php 
        echo $paid_rsvp;
        ?>
 />
				<?php 
        _e('When user pays for a paid event', Eab_EventsHub::TEXT_DOMAIN);
        ?>
			</label>
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label><?php 
        _e('Notify', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<label for="eab_event-eab_rsvps-me-notify_admin" style="display:block; line-height:1.8em">
				<input type="hidden" name="eab_rsvps_me[email-notify_admin]" value="" />
				<input type="checkbox" id="eab_event-eab_rsvps-me-notify_admin" name="eab_rsvps_me[email-notify_admin]" value="1" <?php 
        echo $notify_admin;
        ?>
 />
				<?php 
        _e('Site administrator', Eab_EventsHub::TEXT_DOMAIN);
        ?>
			</label>
			<label for="eab_event-eab_rsvps-me-notify_author" style="display:block; line-height:1.8em">
				<input type="hidden" name="eab_rsvps_me[email-notify_author]" value="" />
				<input type="checkbox" id="eab_event-eab_rsvps-me-notify_author" name="eab_rsvps_me[email-notify_author]" value="1" <?php 
        echo $notify_author;
        ?>
 />
				<?php 
        _e('Event author', Eab_EventsHub::TEXT_DOMAIN);
        ?>
			</label>
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_rsvps-me-subject"><?php 
        _e('Email subject', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(sprintf(__('This is your email subject. You can use these macros: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros));
        ?>
</span>
			<input type="text" class="widefat" id="eab_event-eab_rsvps-me-subject" name="eab_rsvps_me[email-subject]" value="<?php 
        esc_attr_e($subject);
        ?>
" />
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_rsvps-me-body"><?php 
        _e('Email body', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(sprintf(__('This is your email body. You can use these macros: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros));
        ?>
</span>
			<?php 
        wp_editor($body, 'eab_rsvps-email_me-body', array('name' => 'eab_rsvps_me-email_me-body'));
        ?>
	    </div>
	    <div class="eab-settings-settings_item"><small><?php 
        printf(__('You can use these macros in your subject and body: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros);
        ?>
</small></div>
	<?php 
        if ($events) {
            ?>
	    <div class="eab-settings-settings_item">
	    	<input type="button" class="button" id="eab_event-eab_rsvps-me-preview" value="<?php 
            esc_attr_e(__('Preview', Eab_EventsHub::TEXT_DOMAIN));
            ?>
" />
	    	<?php 
            _e('using this event data:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
	    	<select id="eab_event-eab_rsvps-me-events">
	    	<?php 
            foreach ($events as $event) {
                ?>
	    		<option value="<?php 
                esc_attr_e($event->get_id());
                ?>
"><?php 
                echo $event->get_title();
                ?>
</option>
	    	<?php 
            }
            ?>
	    	</select>
	    	<div id="eab_event-eab_rsvp_me-email_preview_container" style="line-height: 1.2em"></div>
	    </div>
	<?php 
        }
        ?>
	</div>
</div>
<script type="text/javascript">
(function ($) {
$(function () {
	var $container = $("#eab_event-eab_rsvp_me-email_preview_container"),
		$subject = $("#eab_event-eab_rsvps-me-subject"),
		$events = $("#eab_event-eab_rsvps-me-events")
	;
	$("#eab_event-eab_rsvps-me-preview").on("click", function () {
		var body_string = (tinyMCE && tinyMCE.activeEditor
			? tinyMCE.activeEditor.getContent()
			: $("#eab_rsvps_me-email_me-body").val()
		);
		$container.html('<?php 
        echo esc_js(__("Please, hold on... ", Eab_EventsHub::TEXT_DOMAIN));
        ?>
');
		$.post(ajaxurl, {
			"action": "eab_rsvp_email_me-preview_email",
			"subject": $subject.val(),
			"body": body_string,
			"event_id": $events.val()
		}, function (data) {
			$container.html(data);
		}, 'html');
	});
})
})(jQuery);
</script>
		<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $_created = $this->_data->get_option('bp-activity_autoupdate-event_created');
        $event_created = 'any' == $_created ? 'checked="checked"' : false;
        $group_event_created = class_exists('Eab_BuddyPress_GroupEvents') && 'group' == $_created ? 'checked="checked"' : false;
        $pa_event_created = class_exists('Eab_Events_Pae') && 'pa' == $_created ? 'checked="checked"' : false;
        $skip_created = !$_created ? 'checked="checked"' : false;
        $created_group_post = class_exists('Eab_BuddyPress_GroupEvents') && $this->_data->get_option('bp-activity_autoupdate-created_group_post') ? 'checked="checked"' : false;
        $user_rsvp_yes = $this->_data->get_option('bp-activity_autoupdate-user_rsvp_yes') ? 'checked="checked"' : false;
        $user_rsvp_maybe = $this->_data->get_option('bp-activity_autoupdate-user_rsvp_maybe') ? 'checked="checked"' : false;
        $user_rsvp_no = $this->_data->get_option('bp-activity_autoupdate-user_rsvp_no') ? 'checked="checked"' : false;
        $user_rsvp_group_only = class_exists('Eab_BuddyPress_GroupEvents') && $this->_data->get_option('bp-activity_autoupdate-user_rsvp_group_only') ? 'checked="checked"' : false;
        $user_rsvp_group_post = class_exists('Eab_BuddyPress_GroupEvents') && $this->_data->get_option('bp-activity_autoupdate-user_rsvp_group_post') ? 'checked="checked"' : false;
        ?>
<div id="eab-settings-activity_autoupdate" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Activity auto-update settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item" style="line-height:1.8em">
			<label><?php 
        _e('Automatically update Activity feed when an Event is created:', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('An activity update posted each time an Event is created.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<input type="radio" id="eab_event-bp-activity_autoupdate-event_created" name="eab-bp-activity_autoupdate[event_created]" value="any" <?php 
        print $event_created;
        ?>
 />
			<label for="eab_event-bp-activity_autoupdate-event_created"><?php 
        _e('Any event', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
		<?php 
        if (class_exists('Eab_BuddyPress_GroupEvents')) {
            ?>
			<br />
			<input type="radio" id="eab_event-bp-activity_autoupdate-group_event_created" name="eab-bp-activity_autoupdate[event_created]" value="group" <?php 
            print $group_event_created;
            ?>
 />
			<label for="eab_event-bp-activity_autoupdate-group_event_created"><?php 
            _e('Group event', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
		<?php 
        }
        ?>
		<?php 
        if (class_exists('Eab_Events_Pae')) {
            ?>
			<br />
			<input type="radio" id="eab_event-bp-activity_autoupdate-pa_event_created" name="eab-bp-activity_autoupdate[event_created]" value="pa" <?php 
            print $pa_event_created;
            ?>
 />
			<label for="eab_event-bp-activity_autoupdate-pa_event_created"><?php 
            _e('Public announcement event', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
		<?php 
        }
        ?>
			<br />
			<input type="radio" id="eab_event-bp-activity_autoupdate-skip_created" name="eab-bp-activity_autoupdate[event_created]" value="any" <?php 
        print $skip_created;
        ?>
 />
			<label for="eab_event-bp-activity_autoupdate-skip_created"><?php 
        _e('Do not update activity', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<br />
			<input type="checkbox" id="eab_event-bp-activity_autoupdate-created_group_post" name="eab-bp-activity_autoupdate[created_group_post]" value="1" <?php 
        print $created_group_post;
        ?>
 />
			<label for="eab_event-bp-activity_autoupdate-created_group_post"><?php 
        _e('Always update corresponding group feeds on group event creation', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
		</div>
		<div class="eab-settings-settings_item" style="line-height:1.8em">
			<label><?php 
        _e('Automatically update Activity feed when user:'******'An activity update posted each time an user RSVPs.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<input type="checkbox" id="eab_event-bp-activity_autoupdate-user_rsvp_yes" name="eab-bp-activity_autoupdate[user_rsvp_yes]" value="1" <?php 
        print $user_rsvp_yes;
        ?>
 />
			<label for="eab_event-bp-activity_autoupdate-user_rsvp_yes"><?php 
        _e('... is coming', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<input type="checkbox" id="eab_event-bp-activity_autoupdate-user_rsvp_maybe" name="eab-bp-activity_autoupdate[user_rsvp_maybe]" value="1" <?php 
        print $user_rsvp_maybe;
        ?>
 />
			<label for="eab_event-bp-activity_autoupdate-user_rsvp_maybe"><?php 
        _e('... is maybe coming', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<input type="checkbox" id="eab_event-bp-activity_autoupdate-user_rsvp_no" name="eab-bp-activity_autoupdate[user_rsvp_no]" value="1" <?php 
        print $user_rsvp_no;
        ?>
 />
			<label for="eab_event-bp-activity_autoupdate-user_rsvp_no"><?php 
        _e('... is not coming', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
		<?php 
        if (class_exists('Eab_BuddyPress_GroupEvents')) {
            ?>
			<br />
			<br />
			<input type="checkbox" id="eab_event-bp-activity_autoupdate-user_rsvp_group_post" name="eab-bp-activity_autoupdate[user_rsvp_group_post]" value="1" <?php 
            print $user_rsvp_group_post;
            ?>
 />
			<label for="eab_event-bp-activity_autoupdate-user_rsvp_group_post"><?php 
            _e('Update group Activity feed', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
		<?php 
        }
        ?>
		</div>
	</div>
</div>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $category_id = $this->_data->get_option('payment-ppvp-category');
        $categories = get_terms('product_category', array('hide_empty' => false));
        ?>
<div id="eab-settings-mp_payments" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Payments via MarketPress Products settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
	    	<label for="eab_event-payment-ppvp-category"><?php 
        _e('Limit Products selection to this Product Category', Eab_EventsHub::TEXT_DOMAIN);
        ?>
: </label>
	    	<?php 
        if (!empty($categories)) {
            ?>
	    	<select name="eab_event-payment-ppvp-category" id="eab_event-payment-ppvp-category">
	    		<option value=""></option>
	    	<?php 
            foreach ($categories as $category) {
                ?>
	    		<option value="<?php 
                esc_attr_e($category->term_id);
                ?>
" <?php 
                selected($category_id, $category->term_id);
                ?>
 ><?php 
                esc_html_e($category->name);
                ?>
</option>
	    	<?php 
            }
            ?>
	    	</select>
	    	<?php 
        } else {
            ?>
	    		<em><?php 
            _e('No Product Categories', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</em>
	    	<?php 
        }
        ?>
			<span><?php 
        echo $tips->add_tip(__('Use this setting to limit the scope of your Products that can be used as Events payments.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
	</div>
</div>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $checked = $this->_data->get_option('bp-group_event-auto_join_groups') ? 'checked="checked"' : '';
        $private = $this->_data->get_option('bp-group_event-private_events') ? 'checked="checked"' : '';
        $user_groups_only = $this->_data->get_option('bp-group_event-user_groups_only') ? 'checked="checked"' : '';
        $user_groups_only_unless_superadmin = $this->_data->get_option('bp-group_event-user_groups_only-unless_superadmin') ? 'checked="checked"' : '';
        $eab_event_bp_group_event_email_grp_member = $this->_data->get_option('eab_event_bp_group_event_email_grp_member') ? 'checked="checked"' : '';
        ?>
<div id="eab-settings-group_events" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Group Events settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
	    	<label for="eab_event-bp-group_event-auto_join_groups"><?php 
        _e('Automatically join the group by RSVPing to events', Eab_EventsHub::TEXT_DOMAIN);
        ?>
?</label>
			<input type="checkbox" id="eab_event-bp-group_event-auto_join_groups" name="event_default[bp-group_event-auto_join_groups]" value="1" <?php 
        print $checked;
        ?>
 />
			<span><?php 
        echo $tips->add_tip(__('When your users RSVP positively to your group event, they will also automatically join the group the event belongs to.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
		<div class="eab-settings-settings_item">
	    	<label for="eab_event-bp-group_event-private_events"><?php 
        _e('Group events are private to groups', Eab_EventsHub::TEXT_DOMAIN);
        ?>
?</label>
			<input type="checkbox" id="eab_event-bp-group_event-private_events" name="event_default[bp-group_event-private_events]" value="1" <?php 
        print $private;
        ?>
 />
			<span><?php 
        echo $tips->add_tip(__('If you enable this option, users outside your groups will <b>not</b> be able to see your Group Events.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-bp-group_event-user_groups_only"><?php 
        _e('Show only groups that user belongs to', Eab_EventsHub::TEXT_DOMAIN);
        ?>
?</label>
			<input type="checkbox" id="eab_event-bp-group_event-user_groups_only" name="event_default[bp-group_event-user_groups_only]" value="1" <?php 
        print $user_groups_only;
        ?>
 />
			<span><?php 
        echo $tips->add_tip(__('If you enable this option, users will not be able to assign events outside the groups they already belong to.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
	    	<label for="eab_event-bp-group_event-user_groups_only-unless_superadmin"><?php 
        _e('... except for Super-admins', Eab_EventsHub::TEXT_DOMAIN);
        ?>
?</label>
			<input type="checkbox" id="eab_event-bp-group_event-user_groups_only-unless_superadmin" name="event_default[bp-group_event-user_groups_only-unless_superadmin]" value="1" <?php 
        print $user_groups_only_unless_superadmin;
        ?>
 />
			<span><?php 
        echo $tips->add_tip(__('If you enable this option, your super-admins will be able to assign events to any group.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-bp-group_event-private_events"><?php 
        _e('Send email to all group members when a event is created or edited', Eab_EventsHub::TEXT_DOMAIN);
        ?>
?</label>
			<input type="checkbox" id="eab_event_bp_group_event_email_grp_member" name="event_default[eab_event_bp_group_event_email_grp_member]" value="1" <?php 
        print $eab_event_bp_group_event_email_grp_member;
        ?>
 />
	    </div>
	</div>
</div>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $no_avatar = !$this->_data->get_option('guest_lists-sai-avatar_size') ? 'checked="checked"' : '';
        $avatar_small = 'small' == $this->_data->get_option('guest_lists-sai-avatar_size') ? 'checked="checked"' : '';
        $avatar_med = 'medium' == $this->_data->get_option('guest_lists-sai-avatar_size') ? 'checked="checked"' : '';
        $avatar_large = 'large' == $this->_data->get_option('guest_lists-sai-avatar_size') ? 'checked="checked"' : '';
        $no_name = !$this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $username = '******' == $this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $display_name = 'display_name' == $this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $firstname = 'firstname' == $this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $lastname = 'lastname' == $this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $fullname_first = 'fullname_first' == $this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $fullname_last = 'fullname_last' == $this->_data->get_option('guest_lists-sai-show_name') ? 'checked="checked"' : '';
        $show_in_admin = $this->_data->get_option('guest_lists-sai-show_in_admin') ? 'checked="checked"' : '';
        $show_in_export = $this->_data->get_option('guest_lists-sai-show_in_export') ? 'checked="checked"' : '';
        ?>
<div id="eab-settings-guest_lists" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Guest Lists Options', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item" style="line-height:1.8em">
			<label><?php 
        _e('Guest avatars', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<input type="radio" id="eab_event-guest_lists-sai-no_avatar" name="event_default[guest_lists-sai-avatar_size]" value="" <?php 
        print $no_avatar;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-no_avatar"><?php 
        _e('Do not show avatars', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Hide user avatars in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<input type="radio" id="eab_event-guest_lists-sai-small_avatar" name="event_default[guest_lists-sai-avatar_size]" value="small" <?php 
        print $avatar_small;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-small_avatar"><?php 
        _e('Show small avatars', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show small avatars in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<input type="radio" id="eab_event-guest_lists-sai-med_avatar" name="event_default[guest_lists-sai-avatar_size]" value="medium" <?php 
        print $avatar_med;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-med_avatar"><?php 
        _e('Show medium avatars', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show medium avatars in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<input type="radio" id="eab_event-guest_lists-sai-large_avatar" name="event_default[guest_lists-sai-avatar_size]" value="large" <?php 
        print $avatar_large;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-large_avatar"><?php 
        _e('Show large avatars', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show large avatars in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<p></p>
	    </div>
		<div class="eab-settings-settings_item" style="line-height:1.8em">
			<label><?php 
        _e('Guest names', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-no_name" name="event_default[guest_lists-sai-show_name]" value="" <?php 
        print $no_name;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-no_name"><?php 
        _e('Do not show name', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Hide names from RSVP lists', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    	<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-display_name" name="event_default[guest_lists-sai-show_name]" value="display_name" <?php 
        print $display_name;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-display_name"><?php 
        _e('Show display name', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show user display names in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    	<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-username" name="event_default[guest_lists-sai-show_name]" value="username" <?php 
        print $username;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-username"><?php 
        _e('Show username', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show usernames in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    	<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-firstname" name="event_default[guest_lists-sai-show_name]" value="firstname" <?php 
        print $firstname;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-firstname"><?php 
        _e('Show first name', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show user first names in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    	<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-lastname" name="event_default[guest_lists-sai-show_name]" value="lastname" <?php 
        print $lastname;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-lastname"><?php 
        _e('Show first name', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show user last names in RSVP listings', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    	<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-fullname_first" name="event_default[guest_lists-sai-show_name]" value="fullname_first" <?php 
        print $fullname_first;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-fullname_first"><?php 
        _e('Show full name, first name first', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show user full names in RSVP listings as Firstname Lastname', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    	<br />
			<input type="radio" id="eab_event-guest_lists-sai-show_name-fullname_last" name="event_default[guest_lists-sai-show_name]" value="fullname_last" <?php 
        print $fullname_last;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_name-fullname_last"><?php 
        _e('Show full name, last name first', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('Show user full names in RSVP listings as Lastname Firstname', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<p></p>
	    </div>
	    <div class="eab-settings-settings_item" style="line-height:1.8em">
			<label><?php 
        _e('Show prettified guest list names in...', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<br />
			<input type="hidden" name="event_default[guest_lists-sai-show_in_admin]" value="" />
			<input type="checkbox" id="eab_event-guest_lists-sai-show_in_admin" name="event_default[guest_lists-sai-show_in_admin]" value="1" <?php 
        print $show_in_admin;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_in_admin"><?php 
        _e('Events admin area', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('By default, the user names will be shown here', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<input type="hidden" name="event_default[guest_lists-sai-show_in_export]" value="" />
			<input type="checkbox" id="eab_event-guest_lists-sai-show_in_export" name="event_default[guest_lists-sai-show_in_export]" value="1" <?php 
        print $show_in_export;
        ?>
 />
	    	<label for="eab_event-guest_lists-sai-show_in_export"><?php 
        _e('Events export files', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('By default, the user names will be shown here', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
	    </div>
	</div>
</div>
<?php 
    }
    function show_settings()
    {
        $pages = get_pages();
        $integrate_with_my_events = $this->_options['integrate_with_my_events'] ? 'checked="checked"' : '';
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        ?>
<div id="eab-settings-fpe" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Front-page editing', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
			<label for="eab-events-fpe-use_slug">
				<?php 
        _e('I want to use this page as my Front Editor page', Eab_EventsHub::TEXT_DOMAIN);
        ?>
:
			</label>
			<select id="eab-events-fpe-use_slug" name="eab-events-fpe[id]">
				<option value=""><?php 
        _e('Use default value', Eab_EventsHub::TEXT_DOMAIN);
        ?>
&nbsp;</option>
			<?php 
        foreach ($pages as $page) {
            $selected = $this->_options['id'] == $page->ID ? 'selected="selected"' : '';
            echo "<option value='{$page->ID}' {$selected}>{$page->post_title}</option>";
        }
        ?>
			</select>
			<?php 
        echo $tips->add_tip(__("Don't forget to add this shortcode to your selected page: <code>[eab_event_editor]</code>", Eab_EventsHub::TEXT_DOMAIN));
        ?>
			<div><?php 
        _e('By default, Front-page editor will work with preconfigured stub URL. However, you can create your own page, add the Front-page editing shortcode (<code>[eab_event_editor]</code>) to the content and configure your Add/Edit links here to use this page instead.', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</div>
		</div>
<?php 
        if (Eab_AddonHandler::is_plugin_active('eab-buddypres-my_events')) {
            ?>
		<div class="eab-settings-settings_item">
			<label for="eab-events-fpe-integrate_with_my_events">
				<input type="hidden" name="eab-events-fpe[integrate_with_my_events]" value="" />
				<input type="checkbox" id="eab-events-fpe-integrate_with_my_events" name="eab-events-fpe[integrate_with_my_events]" value="1" <?php 
            echo $integrate_with_my_events;
            ?>
 />
				<?php 
            _e('Integrate with <em>My Events</em> add-on', Eab_EventsHub::TEXT_DOMAIN);
            ?>
			</label>
			<?php 
            echo $tips->add_tip(__("Enabling this option will add a new &quot;Add Event&quot; tab to &quot;My Events&quot;", Eab_EventsHub::TEXT_DOMAIN));
            ?>
		</div>
<?php 
        }
        ?>
	</div>
</div>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $api_key = $this->_data->get_option('gcal_importer-client_id');
        $api_secret = $this->_data->get_option('gcal_importer-client_secret');
        $is_authenticated = $this->_oauth->is_authenticated();
        $runs = array('3600' => __('Hour', Eab_EventsHub::TEXT_DOMAIN), '7200' => __('Two hours', Eab_EventsHub::TEXT_DOMAIN), '10800' => __('Three hours', Eab_EventsHub::TEXT_DOMAIN), '21600' => __('Six hours', Eab_EventsHub::TEXT_DOMAIN), '43200' => __('Twelve hours', Eab_EventsHub::TEXT_DOMAIN), '86400' => __('Day', Eab_EventsHub::TEXT_DOMAIN));
        $run_each = $this->_data->get_option('gcal_importer-run_each');
        $run_each = $run_each ? $run_each : 3600;
        $calendars_cache = $this->_get_cached_calendars();
        $sync_calendars = $this->_data->get_option('gcal_importer-sync_calendars', array());
        $user = wp_get_current_user();
        $calendar_author = $this->_data->get_option('gcal_importer-calendar_author', $user->ID);
        $raw_authors = get_users(array('who' => 'authors'));
        $possible_authors = array_combine(wp_list_pluck($raw_authors, 'ID'), wp_list_pluck($raw_authors, 'display_name'));
        ?>
<div id="eab-settings-gcal_importer" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Google Calendar import settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<p>
			<ol>
			    <li><a href="https://code.google.com/apis/console/" target="_blank"><?php 
        _e('Create a project in Google API Console', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</a></li>
			    <li><?php 
        _e('Under "Services" tab, turn "Calendar API" to ON', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</li>
			    <li><?php 
        printf(__('Under "API Access" click "Create oAuth Client Access." Fill in your details and use this as your "Authorized Redirect URIs": <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $this->_oauth->get_login_response_endpoint());
        ?>
</li>
			    <li><?php 
        _e('Copy your Client ID and Client secret values and paste them in the fields below', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</li>
			    <li><?php 
        _e('Save your plugin settings and click the "Authenticate" button', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</li>
			</ol>
		</p>
		<div class="eab-settings-settings_item" style="line-height:1.8em">
			<label for="incsub_event-gcal_importer-app_id" id="incsub_event_label-gcal_importer-app_id"><?php 
        _e('Client ID', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<input type="text" size="90" id="incsub_event-gcal_importer-app_id" name="gcal_importer[client_id]" value="<?php 
        print $api_key;
        ?>
" />
			<span><?php 
        echo $tips->add_tip(__('Enter your Client ID number here.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<label for="incsub_event-gcal_importer-app_id" id="incsub_event_label-gcal_importer-app_id"><?php 
        _e('Client secret', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<input type="text" size="85" id="incsub_event-gcal_importer-app_id" name="gcal_importer[client_secret]" value="<?php 
        print $api_secret;
        ?>
" />
			<span><?php 
        echo $tips->add_tip(__('Enter your Client secret number here.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<div class="gcal_importer-auth_actions">
		<?php 
        if ($is_authenticated && $api_key && $api_secret) {
            ?>
				<a href="#reset" class="button" id="gcal_import-reset"><?php 
            _e('Reset', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</a>
				<span><?php 
            echo $tips->add_tip(__('Remember to also revoke the offline access token <a href="https://accounts.google.com/IssuedAuthSubTokens" target="_blank">here</a>.', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</span>
		<?php 
        } else {
            if ($api_key && $api_secret) {
                ?>
				<a href="#authenticate" class="button" id="gcal_import-authenticate"><?php 
                _e('Authenticate', Eab_EventsHub::TEXT_DOMAIN);
                ?>
</a>
		<?php 
            } else {
                ?>
				<p><em><?php 
                _e('Enter your API info and save settings first.', Eab_EventsHub::TEXT_DOMAIN);
                ?>
</em></p>
		<?php 
            }
        }
        ?>
			</div>
		</div>
		<?php 
        if ($is_authenticated) {
            ?>
		<div class="eab-settings-settings_item">
			<label><?php 
            _e('I want to import events from these calendars:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
			<span><a href="#resync" id="gcal_import-resync" class="button"><?php 
            _e('Refresh calendars list', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</a></span>
			<span><?php 
            echo $tips->add_tip(__('Select calendars you wish to import.', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</span>
			<?php 
            if ($calendars_cache) {
                ?>
			<br />
			<select name="gcal_importer[sync_calendars][]" multiple="multiple">
			<?php 
                foreach ($calendars_cache as $id => $label) {
                    ?>
				<?php 
                    $selected = in_array($id, $sync_calendars) ? 'selected="selected"' : '';
                    ?>
				<option value="<?php 
                    esc_attr_e($id);
                    ?>
" <?php 
                    echo $selected;
                    ?>
><?php 
                    echo $label;
                    ?>
&nbsp;</option>
			<?php 
                }
                ?>
			</select>
			<?php 
            }
            // end if cache
            ?>
		</div>
		<div class="eab-settings-settings_item">
			<label><?php 
            _e('Run importer every:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
			<select name="gcal_importer[run_each]">
			<?php 
            foreach ($runs as $interval => $ilabel) {
                ?>
				<option value="<?php 
                echo (int) $interval;
                ?>
" <?php 
                echo selected($interval, $run_each);
                ?>
><?php 
                echo $ilabel;
                ?>
</option>
			<?php 
            }
            ?>
			</select>
		</div>
		<div class="eab-settings-settings_item">
			<label><?php 
            _e('Assign imported events to this user:'******'Select the user you wish to appear as your imported Events host.', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</span>
		</div>
		<div class="eab-settings-settings_item">
			<input type="hidden" name="gcal_importer[convert_times]" value="" />
			<input type="checkbox" id="incsub_event-gcal_importer-convert_times" name="gcal_importer[convert_times]" value="1" <?php 
            checked($this->_data->get_option('gcal_importer-convert_times'), 1);
            ?>
 />
			<label for="incsub_event-gcal_importer-convert_times"><?php 
            _e('Attempt to convert event times to local WordPress time', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
		</div>
		<?php 
        }
        // end if authenticated
        ?>
	</div>
</div>
<script type="text/javascript">
(function ($) {

function authenticate () {
	var googleLogin = window.open('https://www.google.com/accounts', "google_login", "scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,height=400,width=800");
	$.post(ajaxurl, {
		"action": "eab_gcal_import_authenticate",
		"url": window.location.href
	}, function (data) {
		var href = data.url;
		googleLogin.location = href;
		var gTimer = setInterval(function () {
			try {
				if (googleLogin.location.hostname == window.location.hostname) {
					// We're back!
					clearInterval(gTimer);
					googleLogin.close();
					window.location.reload();
				}
			} catch (e) {}
		}, 300);
	}, "json");
	return false;
}

$(function () {
	$("#gcal_import-authenticate").on("click", authenticate);
	$("#gcal_import-reset").on("click", function () {
		$.post(ajaxurl, {"action": "eab_gcal_import_reset"}, window.location.reload);
		return false;
	});
	$("#gcal_import-resync").on("click", function () {
		$.post(ajaxurl, {"action": "eab_gcal_import_resync_calendars"}, window.location.reload);
		return false;
	});
});
})(jQuery);
</script>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $api_key = $this->_data->get_option('fbe_importer-client_id');
        $api_secret = $this->_data->get_option('fbe_importer-client_secret');
        $is_authenticated = $this->_oauth->is_authenticated();
        $fb_user = false;
        $sync_user = $this->_data->get_option('fbe_importer-fb_user');
        if (!$sync_user && $is_authenticated) {
            $fb_user = $this->_oauth->get_fb_user();
            $sync_user = !empty($fb_user['id']) ? $fb_user['id'] : false;
        }
        $runs = array('3600' => __('Hour', Eab_EventsHub::TEXT_DOMAIN), '7200' => __('Two hours', Eab_EventsHub::TEXT_DOMAIN), '10800' => __('Three hours', Eab_EventsHub::TEXT_DOMAIN), '21600' => __('Six hours', Eab_EventsHub::TEXT_DOMAIN), '43200' => __('Twelve hours', Eab_EventsHub::TEXT_DOMAIN), '86400' => __('Day', Eab_EventsHub::TEXT_DOMAIN));
        $run_each = $this->_data->get_option('fbe_importer-run_each');
        $run_each = $run_each ? $run_each : 3600;
        $user = wp_get_current_user();
        $calendar_author = $this->_data->get_option('fbe_importer-calendar_author', $user->ID);
        $raw_authors = get_users(array('who' => 'authors'));
        $possible_authors = array_combine(wp_list_pluck($raw_authors, 'ID'), wp_list_pluck($raw_authors, 'display_name'));
        ?>
<div id="eab-settings-fbe_importer" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Facebook Events import settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item" style="line-height:1.8em">
			<label for="incsub_event-fbe_importer-client_id" id="incsub_event_label-fbe_importer-client_id"><?php 
        _e('App ID', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<input type="text" size="90" id="incsub_event-fbe_importer-client_id" name="fbe_importer[client_id]" value="<?php 
        print $api_key;
        ?>
" />
			<span><?php 
        echo $tips->add_tip(__('Enter your App ID number here.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<br />
			<label for="incsub_event-fbe_importer-client_id" id="incsub_event_label-fbe_importer-client_id"><?php 
        _e('App secret', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<input type="text" size="85" id="incsub_event-fbe_importer-client_id" name="fbe_importer[client_secret]" value="<?php 
        print $api_secret;
        ?>
" />
			<span><?php 
        echo $tips->add_tip(__('Enter your App secret number here.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<div class="fbe_importer-auth_actions">
		<?php 
        if ($is_authenticated && $api_key && $api_secret) {
            ?>
				<a href="#reset" class="button" id="fbe_import-reset"><?php 
            _e('Reset', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</a>
				<span><?php 
            echo $tips->add_tip(__('Remember to also revoke the app privileges <a href="http://www.facebook.com/settings?tab=applications" target="_blank">here</a>.', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</span>
		<?php 
        } else {
            if ($api_key && $api_secret) {
                ?>
				<a href="#authenticate" class="button" id="fbe_import-authenticate"><?php 
                _e('Authenticate', Eab_EventsHub::TEXT_DOMAIN);
                ?>
</a>
		<?php 
            } else {
                ?>
				<p><em><?php 
                _e('Enter your API info and save settings first.', Eab_EventsHub::TEXT_DOMAIN);
                ?>
</em></p>
		<?php 
            }
        }
        ?>
			</div>
		</div>
		<?php 
        if ($is_authenticated) {
            ?>
		<div class="eab-settings-settings_item">
			<label><?php 
            _e('Import events for this Facebook user ID:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
			<input type="text" id="incsub_event-fbe_importer-fb_user" name="fbe_importer[fb_user]" value="<?php 
            esc_attr_e($sync_user);
            ?>
" />
			<small><em><?php 
            _e('Don\'t change this field unless you are sure what you\'re doing', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</em></small>
		</div>
		<div class="eab-settings-settings_item">
			<label><?php 
            _e('Run importer every:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</label>
			<select name="fbe_importer[run_each]">
			<?php 
            foreach ($runs as $interval => $ilabel) {
                ?>
				<option value="<?php 
                echo (int) $interval;
                ?>
" <?php 
                echo selected($interval, $run_each);
                ?>
><?php 
                echo $ilabel;
                ?>
</option>
			<?php 
            }
            ?>
			</select>
		</div>
		<div class="eab-settings-settings_item">
			<label><?php 
            _e('Assign imported events to this user:'******'Select the user you wish to appear as your imported Events host.', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</span>
		</div>
		<?php 
            if ($fb_user) {
                ?>
		<div class="eab-settings-settings_item">
			<input type="submit" value="<?php 
                esc_attr_e(__('Save settings', Eab_EventsHub::TEXT_DOMAIN));
                ?>
" />
		</div>
		<?php 
            }
            // end if fb user
            ?>
		<?php 
        }
        // end if authenticated
        ?>
	</div>
</div>
<script type="text/javascript">
(function ($) {

function authenticate () {
	var loginWindow = window.open('https://facebook.com', "oauth_login", "scrollbars=no,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,height=400,width=800");
	$.post(ajaxurl, {
		"action": "eab_fbe_import_authenticate",
		"url": window.location.href
	}, function (data) {
		var href = data.url;
		loginWindow.location = href;
		var gTimer = setInterval(function () {
			try {
				if (loginWindow.location.hostname == window.location.hostname) {
					// We're back!
					clearInterval(gTimer);
					loginWindow.close();
					window.location.reload();
				}
			} catch (e) {}
		}, 300);
	}, "json");
	return false;
}

$(function () {
	$("#fbe_import-authenticate").on("click", authenticate);
	$("#fbe_import-reset").on("click", function () {
		$.post(ajaxurl, {"action": "eab_fbe_import_reset"}, window.location.reload);
		return false;
	});
	$("#fbe_import-resync").on("click", function () {
		$.post(ajaxurl, {"action": "eab_fbe_import_resync_calendars"}, window.location.reload);
		return false;
	});
});
})(jQuery);
</script>
<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $from = $this->_data->get_option('eab_cancelations-email-from');
        $from = $from ? $from : get_option('admin_email');
        $subject = trim($this->_data->get_option('eab_cancelations-email-subject'));
        $subject = !empty($subject) ? $subject : $this->_default_subject;
        $body = trim($this->_data->get_option('eab_cancelations-email-body'));
        $body = !empty($body) ? $body : $this->_default_message;
        $codec = new Eab_Macro_Codec();
        $macros = join('</code>, <code>', $codec->get_macros());
        $events = Eab_CollectionFactory::get_upcoming_events(eab_current_time(), array('posts_per_page' => 10));
        ?>
<div id="eab-settings-eab_cancelations" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Event cancellation settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item">
			<label for="eab_cancellations-hide_events"><?php 
        _e('Hide cancelled events', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<input type="hidden" name="eab_cancelations[hide_events]" value="" />
			<input type="checkbox" name="eab_cancelations[hide_events]" id="eab_cancellations-hide_events" value="1" <?php 
        checked(true, $this->_data->get_option('eab_cancelations-hide_events'));
        ?>
 />
		</div>
		<div class="eab-settings-settings_item">
			<label for="eab_cancellations-email_batch_limit"><?php 
        _e('Email batch limit', Eab_EventsHub::TEXT_DOMAIN);
        ?>
:</label>
			<span><?php 
        echo $tips->add_tip(__('This is the maximum number of emails that will be sent in one go. The rest will be scheduled for sending.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<input type="text" name="eab_cancelations[email_batch_limit]" id="eab_cancellations-email_batch_limit" value="<?php 
        echo (int) $this->_get_email_batch_limit();
        ?>
" />
		</div>
		<div class="eab-note">
			<?php 
        _e('This is the email that will be sent to your attendees on event cancellation.', Eab_EventsHub::TEXT_DOMAIN);
        ?>
		</div>
		<div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_cancelations-from"><?php 
        _e('From email address', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(__('This is the address the cancellation email will be sent from', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
			<input type="text" id="eab_event-eab_cancelations-from" name="eab_cancelations[email-from]" value="<?php 
        esc_attr_e($from);
        ?>
" />
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_cancelations-subject"><?php 
        _e('Email subject', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(sprintf(__('This is your email subject. You can use these macros: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros));
        ?>
</span>
			<input type="text" class="widefat" id="eab_event-eab_cancelations-subject" name="eab_cancelations[email-subject]" value="<?php 
        esc_attr_e($subject);
        ?>
" />
	    </div>
	    <div class="eab-settings-settings_item">
	    	<label for="eab_event-eab_cancelations-body"><?php 
        _e('Email body', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</label>
			<span><?php 
        echo $tips->add_tip(sprintf(__('This is your email body. You can use these macros: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros));
        ?>
</span>
			<?php 
        wp_editor($body, 'eab_cancelations-email-body', array('name' => 'eab_cancelations-email-body'));
        ?>
	    </div>
	    <div class="eab-settings-settings_item"><small><?php 
        printf(__('You can use these macros in your subject and body: <code>%s</code>', Eab_EventsHub::TEXT_DOMAIN), $macros);
        ?>
</small></div>
	<?php 
        if ($events) {
            ?>
	    <div class="eab-settings-settings_item">
	    	<input type="button" class="button" id="eab_event-eab_cancelations-preview" value="<?php 
            esc_attr_e(__('Preview', Eab_EventsHub::TEXT_DOMAIN));
            ?>
" />
	    	<?php 
            _e('using this event data:', Eab_EventsHub::TEXT_DOMAIN);
            ?>
	    	<select id="eab_event-eab_cancelations-events">
	    	<?php 
            foreach ($events as $event) {
                ?>
	    		<option value="<?php 
                esc_attr_e($event->get_id());
                ?>
"><?php 
                echo $event->get_title();
                ?>
</option>
	    	<?php 
            }
            ?>
	    	</select>
	    	<div id="eab_event-eab_cancelations-email_preview_container" style="line-height: 1.2em"></div>
	    </div>
	<?php 
        }
        ?>
	</div>
</div>
<script type="text/javascript">
(function ($) {
$(function () {
	var $container = $("#eab_event-eab_cancelations-email_preview_container"),
		$subject = $("#eab_event-eab_cancelations-subject"),
		$events = $("#eab_event-eab_cancelations-events")
	;
	$("#eab_event-eab_cancelations-preview").on("click", function () {
		var editor = tinyMCE.get("eab_cancelations-email-body")
			body_string = (tinyMCE && tinyMCE.activeEditor && tinyMCE.activeEditor.editorId == editor.editorId
			? tinyMCE.activeEditor.getContent()
			: $("#eab_cancelations-email-body").val()
		);
		$container.html('<?php 
        echo esc_js(__("Please, hold on... ", Eab_EventsHub::TEXT_DOMAIN));
        ?>
');
		$.post(ajaxurl, {
			"action": "eab_cancellation_email-preview_email",
			"subject": $subject.val(),
			"body": body_string,
			"event_id": $events.val()
		}, function (data) {
			$container.html(data);
		}, 'html');
	});
})
})(jQuery);
</script>
		<?php 
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $api_key = $this->_data->get_option('meetup_importer-api_key');
        $member_id = $this->_data->get_option('meetup_importer-user_id');
        ?>
<div id="eab-settings-meetup_importer" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('Meetup.com import settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
	    <div class="eab-settings-settings_item">
			<b><?php 
        _e('API settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</b>
			<div style="line-height:1.5em; padding-bottom:.5em;">
				<label for="eab-meetup_importer-api_key">
					<?php 
        _e('API key', Eab_EventsHub::TEXT_DOMAIN);
        ?>
					<input type="text" class="widefat" id="eab-meetup_importer-api_key" name="event_default[meetup_importer-api_key]" value="<?php 
        echo esc_attr($api_key);
        ?>
" />
				</label>
				<br />
				<label for="eab-meetup_importer-user_id">
					<?php 
        _e('Meetup.com member ID', Eab_EventsHub::TEXT_DOMAIN);
        ?>
					<input type="text" class="widefat" id="eab-meetup_importer-user_id" name="event_default[meetup_importer-user_id]" value="<?php 
        echo esc_attr($member_id);
        ?>
" />
				</label>
			</div>
	    </div>
		<div class="eab-settings-settings_item" id="eab-meetup_importer-actions">
		<?php 
        if (!empty($api_key) && !empty($member_id)) {
            ?>
	    	<button type="button" class="button" id="eab-meetup_importer-import_user_events"><?php 
            echo esc_html(__('Import my events', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</button>
	    	<button type="button" class="button" id="eab-meetup_importer-import_location_events"><?php 
            echo esc_html(__('Import events close to my current location', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</button>
	    	<button type="button" class="button" id="eab-meetup_importer-import_user_topics"><?php 
            echo esc_html(__('Import my topics as event categories', Eab_EventsHub::TEXT_DOMAIN));
            ?>
</button>
	    	<div id="eab-meetup_importer-status" style="display:none"></div>
	    <?php 
        } else {
            ?>
			<p class="note"><?php 
            _e('To start, fill up the API information above and save your settings', Eab_EventsHub::TEXT_DOMAIN);
            ?>
</p>
	    <?php 
        }
        ?>
	    </div>
	</div>
</div>
<script>
(function ($) {
$(function () {
	if (!navigator.geolocation) {
		$("#eab-meetup_importer-import_location_events").remove();
		return false;
	}
	var $target = $("#eab-meetup_importer-status");
	function write_status (msg) {
		$target.empty().html(msg).show();
	}
	// Import my events
	$("#eab-meetup_importer-import_user_events").on("click", function (e) {
		e.preventDefault();
		write_status("<?php 
        echo esc_js(__('Please, hold on...', Eab_EventsHub::TEXT_DOMAIN));
        ?>
");
		$.post(ajaxurl, {
			action: 'eab_meetup-import_user_events'
		}, function (data) {
			if (data && "msg" in data && data.msg) write_status(data.msg);
			else write_status("<?php 
        echo esc_js(__('Error', Eab_EventsHub::TEXT_DOMAIN));
        ?>
");
		}, 'json');
		return false;
	});
	// Geolocated import
	$("#eab-meetup_importer-import_location_events").on("click", function (e) {
		e.preventDefault();
		write_status("<?php 
        echo esc_js(__('Please, hold on...', Eab_EventsHub::TEXT_DOMAIN));
        ?>
");
		navigator.geolocation.getCurrentPosition(function (resp) {
			$.post(ajaxurl, {
				action: 'eab_meetup-import_nearby_events',
				lat: resp.coords.latitude,
				lng: resp.coords.longitude
			}, function (data) {
				if (data && "msg" in data && data.msg) write_status(data.msg);
				else write_status("<?php 
        echo esc_js(__('Error', Eab_EventsHub::TEXT_DOMAIN));
        ?>
");
			}, 'json')
		});
		return false;
	});
	// Import my topics
	$("#eab-meetup_importer-import_user_topics").on("click", function (e) {
		e.preventDefault();
		write_status("<?php 
        echo esc_js(__('Please, hold on...', Eab_EventsHub::TEXT_DOMAIN));
        ?>
");
		$.post(ajaxurl, {
			action: 'eab_meetup-import_user_topics'
		}, function (data) {
			if (data && "msg" in data && data.msg) write_status(data.msg);
			else write_status("<?php 
        echo esc_js(__('Error', Eab_EventsHub::TEXT_DOMAIN));
        ?>
");
		}, 'json');
		return false;
	});
});
})(jQuery);
</script>
<?php 
    }
<?php

$page_title = __('eNewsletter Settings', 'email-newsletter');
if (!$this->settings) {
    $page_title = __('eNewsletter plugin Installation', 'email-newsletter');
    $mode = "install";
}
$default_tab = isset($mode) ? 'tabs-2' : 'tabs-1';
global $email_newsletter;
if (!class_exists('WpmuDev_HelpTooltips')) {
    require_once $email_newsletter->plugin_dir . '/email-newsletter-files/class.wd_help_tooltips.php';
}
$tips = new WpmuDev_HelpTooltips();
$tips->set_icon_url($email_newsletter->plugin_url . '/email-newsletter-files/images/information.png');
//Display status message
if (isset($_GET['updated'])) {
    ?>
<div id="message" class="updated fade"><p><?php 
    echo urldecode($_GET['message']);
    ?>
</p></div><?php 
}
?>



    <div class="wrap">
        <h2><?php 
echo $page_title;
?>
</h2>
    public static function create_addon_settings()
    {
        if (!class_exists('WpmuDev_HelpTooltips')) {
            require_once dirname(__FILE__) . '/lib/class_wd_help_tooltips.php';
        }
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $all = self::get_all_plugins();
        $active = self::get_active_plugins();
        $sections = array();
        self::_display_status_message();
        $thead = "<table class='widefat' id='eab_addons_hub'>";
        $thead .= '<thead>';
        $tbody = '<thead>';
        $tbody .= "<tbody>";
        foreach ($all as $plugin) {
            $plugin_data = self::get_plugin_info($plugin);
            if (empty($plugin_data['Name'])) {
                continue;
            }
            // Require the name
            // Merge in the sections
            $types = array();
            if (!empty($plugin_data['Type'])) {
                $types = array_map('trim', array_values(explode(',', $plugin_data['Type'])));
                $sections = array_merge($sections, $types);
            }
            $is_active = in_array($plugin, $active);
            if ('yes' == $plugin_data['Deprecated']) {
                if (empty($plugin_data['Required Class'])) {
                    // No dependency, so hide the add-on if it is deactivated.
                    if (!$is_active) {
                        continue;
                    }
                } elseif (!class_exists($plugin_data['Required Class'])) {
                    // Only hide the deprecated add-on when required class is missing.
                    continue;
                }
            }
            $tbody .= '<tr' . (!empty($types) ? ' data-type="' . esc_attr(join(',', $types)) : '') . '" class="' . ($is_active ? 'active' : 'inactive') . '">';
            if (!(defined('EAB_PREVENT_SETTINGS_SECTIONS') && EAB_PREVENT_SETTINGS_SECTIONS)) {
                $tbody .= '<td>' . '<input type="checkbox" value="' . esc_attr($plugin) . '" />' . '</td>';
            }
            $tbody .= "<td width='30%'>";
            $tbody .= '<b id="' . esc_attr($plugin) . '">' . $plugin_data['Name'] . '</b>';
            $tbody .= "<br />";
            $tbody .= $is_active ? '<a href="#deactivate" class="eab_deactivate_plugin" eab:plugin_id="' . esc_attr($plugin) . '">' . __('Deactivate', Eab_EventsHub::TEXT_DOMAIN) . '</a>' : '<a href="#activate" class="eab_activate_plugin" eab:plugin_id="' . esc_attr($plugin) . '">' . __('Activate', Eab_EventsHub::TEXT_DOMAIN) . '</a>';
            $tbody .= "</td>";
            $tbody .= '<td>' . $plugin_data['Description'] . '<br />' . sprintf(__('Version %s', Eab_EventsHub::TEXT_DOMAIN), $plugin_data['Version']) . '&nbsp;|&nbsp;' . sprintf(__('by %s', Eab_EventsHub::TEXT_DOMAIN), '<a href="' . $plugin_data['Plugin URI'] . '">' . $plugin_data['Author'] . '</a>');
            if ($plugin_data['Detail']) {
                $tbody .= '&nbsp;' . $tips->add_tip($plugin_data['Detail']);
            }
            $tbody .= '</td>';
            $tbody .= "</tr>";
        }
        $tbody .= "</tbody>";
        $tbody .= "</table>";
        if (!(defined('EAB_PREVENT_SETTINGS_SECTIONS') && EAB_PREVENT_SETTINGS_SECTIONS)) {
            $sections = array_values(array_unique($sections));
            array_unshift($sections, '');
            $links = array();
            if (!empty($sections)) {
                foreach ($sections as $sect) {
                    $type = !empty($sect) ? "data-type='{$sect}'" : 'class="selected"';
                    $name = !empty($sect) ? $sect : __('All', Eab_EventsHub::TEXT_DOMAIN);
                    $links[] = "<a href='#filter' {$type}>{$name}</a>";
                }
            }
            $thead .= '<tr>';
            $thead .= '<td class="filters" colspan="3">';
            if (!empty($links)) {
                $thead .= '<div class="section type">' . '<b>' . __('Filter', Eab_EventsHub::TEXT_DOMAIN) . ':</b> ' . join(' | ', $links) . '</div>';
            }
            $thead .= '<div class="section show">' . '<b>' . __('Show', Eab_EventsHub::TEXT_DOMAIN) . ':</b> ' . join(' | ', array('<a href="#show-all" class="selected">' . __('All', Eab_EventsHub::TEXT_DOMAIN) . '</a>', '<a href="#show-active" data-type="active">' . __('Active', Eab_EventsHub::TEXT_DOMAIN) . '</a>', '<a href="#show-inactive" data-type="inactive">' . __('Inactive', Eab_EventsHub::TEXT_DOMAIN) . '</a>')) . '</div>';
            $thead .= '<div class="section check">' . '<b>' . __('Check', Eab_EventsHub::TEXT_DOMAIN) . ':</b> ' . join(' | ', array('<a href="#check-none">' . __('None', Eab_EventsHub::TEXT_DOMAIN) . '</a>', '<a href="#check-active" data-type="active">' . __('Active', Eab_EventsHub::TEXT_DOMAIN) . '</a>')) . '<div class="actions">' . '<button type="button" class="eab-activate_selected" data-nag="' . esc_attr(__('You are about to activate multiple add-ons. Are you sure you want to do this?', Eab_EventsHub::TEXT_DOMAIN)) . '">' . __('Activate selected', Eab_EventsHub::TEXT_DOMAIN) . '</button>' . '&nbsp;' . '<button type="button" class="eab-deactivate_selected" data-nag="' . esc_attr(__('You are about to deactivate multiple add-ons. Are you sure you want to do this?', Eab_EventsHub::TEXT_DOMAIN)) . '">' . __('Deactivate selected', Eab_EventsHub::TEXT_DOMAIN) . '</button>' . '</div>';
            '</div>';
            $thead .= '</td>';
            $thead .= '</tr>';
        }
        $thead .= '<tr>';
        $thead .= '<th></th><th width="30%">' . __('Name', Eab_EventsHub::TEXT_DOMAIN) . '</th>';
        $thead .= '<th>' . __('Description', Eab_EventsHub::TEXT_DOMAIN) . '</th>';
        $thead .= '</tr>';
        echo $thead . $tbody;
        echo <<<EOWdcpPluginJs
<script type="text/javascript">
(function (\$) {
\$(function () {

\tfunction replace_query_var (query_var, value) {
\t\tvar rx_query = query_var.match(/s\$/)
\t\t\t? '(' + query_var.replace(/s\$/, '') + '|' + query_var + ')'
\t\t\t: '(' + query_var + 's|' + query_var + ')'
\t\t;
\t\tvar rx = new RegExp('&' + rx_query + '=[^&]+');
\t\tif (window.location.search.match(rx)) {
\t\t\twindow.location.search = window.location.search.replace(rx, '&' + query_var + '=' + value);
\t\t} else {
\t\t\twindow.location.search += '&' + query_var + '=' + value;
\t\t}
\t}

\t\$(".eab_activate_plugin").click(function () {
\t\tvar me = \$(this);
\t\tvar plugin_id = me.attr("eab:plugin_id");
\t\t\$.post(ajaxurl, {"action": "eab_activate_plugin", "plugin": plugin_id}, function (data) {
\t\t\t//window.location = window.location;
\t\t\tif (data && "status" in data) {
\t\t\t\tvar status = parseInt(data.status, 10),
\t\t\t\t\tmsg = status ? 'success' : 'error'
\t\t\t\t;
\t\t\t\treturn replace_query_var('addon', msg);
\t\t\t}
\t\t\treturn replace_query_var('addon', 'unknown');
\t\t}, 'json');
\t\treturn false;
\t});
\t\$(".eab_deactivate_plugin").click(function () {
\t\tvar me = \$(this);
\t\tvar plugin_id = me.attr("eab:plugin_id");
\t\t\$.post(ajaxurl, {"action": "eab_deactivate_plugin", "plugin": plugin_id}, function (data) {
\t\t\t//window.location = window.location;
\t\t\tif (data && "status" in data) {
\t\t\t\tvar status = parseInt(data.status, 10),
\t\t\t\t\tmsg = status ? 'success' : 'error'
\t\t\t\t;
\t\t\t\treturn replace_query_var('addon', msg);
\t\t\t}
\t\t\treturn replace_query_var('addon', 'unknown');
\t\t}, 'json');
\t\treturn false;
\t});
\t\$("#eab_addons_hub .filters .section.type a").click(function (e) {
\t\te.preventDefault();
\t\tvar type = \$(this).attr("data-type"),
\t\t\tselector = '#eab_addons_hub tbody tr[data-type*="' + type + '"]'
\t\t;
\t\tif (!type) {
\t\t\t\$("#eab_addons_hub tbody tr").show();
\t\t} else {
\t\t\t\$("#eab_addons_hub tbody tr").hide();
\t\t\t\$(selector).show();
\t\t}
\t\t\$("#eab_addons_hub .filters .section.type a").removeClass('selected');
\t\t\$(this).addClass("selected");

\t\t\$("#eab_addons_hub .filters .section.show a")
\t\t\t.addClass('selected')
\t\t\t.filter('[data-type]').removeClass("selected")
\t\t;

\t\treturn false;
\t});
\t\$("#eab_addons_hub .filters .section.show a").click(function (e) {
\t\te.preventDefault();
\t\tvar type = \$(this).attr("data-type");

\t\t\$("#eab_addons_hub tbody tr").show();
\t\tif ('active' === type) \$("#eab_addons_hub tbody tr.inactive").hide();
\t\tif ('inactive' === type) \$("#eab_addons_hub tbody tr.active").hide();

\t\t\$("#eab_addons_hub .filters .section.show a").removeClass('selected');
\t\t\$(this).addClass("selected");

\t\t\$("#eab_addons_hub .filters .section.type a")
\t\t\t.addClass('selected')
\t\t\t.filter('[data-type]').removeClass("selected")
\t\t;

\t\treturn false;
\t});
\t\$("#eab_addons_hub .filters .section.check a").click(function (e) {
\t\te.preventDefault();
\t\tvar type = \$(this).attr("data-type");

\t\t\$("#eab_addons_hub tbody tr :checkbox").attr("checked", false);
\t\tif ('active' === type) \$("#eab_addons_hub tbody tr.active :checkbox").attr("checked", true);
\t\tif ('inactive' === type) \$("#eab_addons_hub tbody tr.inactive :checkbox").attr("checked", true);
\t\tif ('all' === type) \$("#eab_addons_hub tbody tr :checkbox").attr("checked", true);

\t\treturn false;
\t});
\t\$("#eab_addons_hub .filters .section.check .actions button").click(function (e) {
\t\te.preventDefault();

\t\tvar selection = \$("#eab_addons_hub tbody tr :checkbox:checked"),
\t\t\taction = \$(this).is(".eab-activate_selected") ? 'eab-activate-selected' : 'eab-deactivate-selected',
\t\t\tnag = \$(this).attr("data-nag"),
\t\t\tplugins = []
\t\t;
\t\tif (!selection.length) return false;
\t\tselection.each(function () {
\t\t\tplugins.push(\$(this).val());
\t\t})

\t\tif (!plugins.length) return false;
\t\tif (nag) {
\t\t\tif (!confirm(nag)) return false;
\t\t}
\t\t\$.post(ajaxurl, {action: action, plugins: plugins}, function (data) {
\t\t\t//window.location = window.location;
\t\t\tif (data && "status" in data) {
\t\t\t\tvar status = parseInt(data.status, 10),
\t\t\t\t\tmsg = status ? 'success' : 'error'
\t\t\t\t;
\t\t\t\treturn replace_query_var('addons', msg);
\t\t\t}
\t\t\treturn replace_query_var('addon', 'unknown');
\t\t}, 'json');

\t\treturn false;
\t});
});
})(jQuery);
</script>
EOWdcpPluginJs;
    }
    function show_settings()
    {
        $tips = new WpmuDev_HelpTooltips();
        $tips->set_icon_url(plugins_url('events-and-bookings/img/information.png'));
        $premium = $this->_data->get_option('bp-my_events-premium_events');
        $options = array('' => __('Do nothing special', Eab_EventsHub::TEXT_DOMAIN), 'hide' => __('Hide', Eab_EventsHub::TEXT_DOMAIN), 'nag' => __('Show nag notice', Eab_EventsHub::TEXT_DOMAIN));
        ?>
<div id="eab-settings-my_events" class="eab-metabox postbox">
	<h3 class="eab-hndle"><?php 
        _e('My Events settings', Eab_EventsHub::TEXT_DOMAIN);
        ?>
</h3>
	<div class="eab-inside">
		<div class="eab-settings-settings_item" style="line-height:1.8em">
	    	<label for="eab_event-bp-my_events-premium_events"><?php 
        _e('Non-paid premium events with positive RSPVs', Eab_EventsHub::TEXT_DOMAIN);
        ?>
:</label>
	    	<?php 
        foreach ($options as $value => $label) {
            ?>
	    		<br />
				<input type="radio" id="eab_event-bp-my_events-premium_events-<?php 
            echo esc_attr($value);
            ?>
" name="event_default[bp-my_events-premium_events]" value="<?php 
            echo esc_attr($value);
            ?>
" <?php 
            checked($value, $premium);
            ?>
 />
	    		<label for="eab_event-bp-my_events-premium_events-<?php 
            echo esc_attr($value);
            ?>
"><?php 
            echo esc_html($label);
            ?>
</label>
	    	<?php 
        }
        ?>
			<span><?php 
        echo $tips->add_tip(__('How to deal with non-paid premium events on user events list display.', Eab_EventsHub::TEXT_DOMAIN));
        ?>
</span>
	    </div>
	</div>
</div>
<?php 
    }