public static function admin_options()
    {
        if (current_user_can('list_users')) {
            ?>
			<a name="pro-api"></a>
			<div  class="postbox " id="em-opt-gateway-options">
			<div class="handlediv" title="<?php 
            esc_attr_e_emp('Click to toggle', 'dbem');
            ?>
"><br /></div><h3 class='hndle'><span><?php 
            _e('Payment Gateway Options', 'em-pro');
            ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
            em_options_radio_binary(__('Enable Quick Pay Buttons?', 'em-pro'), 'dbem_gateway_use_buttons', sprintf(__('Only works with gateways that do not require additional payment information to be submitted (e.g. PayPal and Offline payments). If enabled, the default booking form submit button is not used, and each gateway will have a button (or image, see <a href="%s">individual gateway settings</a>) which if clicked on will submit a booking for that gateway.', 'em-pro'), admin_url('edit.php?post_type=' . EM_POST_TYPE_EVENT . '&page=events-manager-gateways')));
            em_options_input_text(__('Gateway Label', 'em-pro'), 'dbem_gateway_label', __('If you are not using quick pay buttons a drop-down menu will be used, with this label.', 'em-pro'));
            ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
		<?php 
        }
    }
Example #2
0
function wpfc_em_admin_options()
{
    ?>
	<div  class="postbox " >
		<div class="handlediv" title="<?php 
    __('Click to toggle', 'dbem');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Full Calendar Options', 'dbem');
    ?>
 </span></h3>
		<div class="inside">
			<p  class="em-boxheader"><?php 
    echo sprintf(__('Looking for the rest of the FullCalendar Options? They\'ve moved <a href="%s">here</a>, the options below are for overriding specific bits relevant to Events Manager.', 'dbem'), admin_url('options-general.php?page=wp-fullcalendar'));
    ?>
</p>
			<table class='form-table'>
				<?php 
    global $events_placeholder_tip, $save_button;
    em_options_radio_binary(__('Override calendar on events page?', 'dbem'), 'dbem_emfc_override_calendar', __('If set to yes, the FullCalendar will be used instead of the standard calendar on the events page.', 'dbem'));
    em_options_radio_binary(__('Override calendar shortcode?', 'dbem'), 'dbem_emfc_override_shortcode', __('Overrides the default calendar shortcode. You can also use [events_fullcalendar] instead.', 'dbem'));
    em_options_input_text(__('Event title format', 'dbem'), 'dbem_emfc_full_calendar_event_format', __('HTML is not accepted.', 'dbem') . ' ' . $events_placeholder_tip, '#_EVENTNAME');
    em_options_textarea(__('Event tooltips format', 'dbem'), 'dbem_emfc_qtips_format', __('If you enable tips, this information will be shown, which can include HTML.', 'dbem') . ' ' . $events_placeholder_tip, '#_EVENTNAME');
    $positions_options = array();
    ?>
			</table>
			<?php 
    echo $save_button;
    ?>
		</div> <!-- . inside -->
		</div> <!-- .postbox -->
	<?php 
}
/**
 * Meta options box for email settings. Shared in both MS and Normal options page, hence it's own function 
 */
function em_admin_option_box_email()
{
    global $save_button;
    ?>
	<div  class="postbox " >
	<div class="handlediv" title="<?php 
    __('Click to toggle', 'dbem');
    ?>
"><br /></div><h3><span><?php 
    _e('Email Settings', 'dbem');
    ?>
</span></h3>
	<div class="inside em-email-form">
		<p class="em-email-settings-check">
			<?php 
    _e('Before you save your changes, you can quickly send yourself a test email by clicking this button.');
    ?>
			<input type="button" id="em-admin-check-email" class="secondary-button" value="<?php 
    _e('Test Email Settings', 'dbem');
    ?>
" />
			<input type="hidden" name="_check_email_nonce" value="<?php 
    echo wp_create_nonce('check_email');
    ?>
" />
			<span id="em-email-settings-check-status"></span>
		</p>
		<table class="form-table">
			<?php 
    em_options_input_text(__('Notification sender name', 'dbem'), 'dbem_mail_sender_name', __("Insert the display name of the notification sender.", 'dbem'));
    em_options_input_text(__('Notification sender address', 'dbem'), 'dbem_mail_sender_address', __("Insert the address of the notification sender.", 'dbem'));
    em_options_select(__('Mail sending method', 'dbem'), 'dbem_rsvp_mail_send_method', array('smtp' => 'SMTP', 'mail' => __('PHP mail function', 'dbem'), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail', 'wp_mail' => 'WP Mail'), __('Select the method to send email notification.', 'dbem'));
    em_options_radio_binary(__('Send HTML Emails?', 'dbem'), 'dbem_smtp_html', __('If set to yes, your emails will be sent in HTML format, otherwise plaintext.', 'dbem') . ' ' . __('Depending on server settings, some sending methods may ignore this settings.', 'dbem'));
    em_options_radio_binary(__('Add br tags to HTML emails?', 'dbem'), 'dbem_smtp_html_br', __('If HTML emails are enabled, br tags will automatically be added for new lines.', 'dbem'));
    ?>
			<tbody class="em-email-settings-smtp">
				<?php 
    em_options_input_text('Mail sending port', 'dbem_rsvp_mail_port', __("The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port", 'dbem'));
    em_options_radio_binary(__('Use SMTP authentication?', 'dbem'), 'dbem_rsvp_mail_SMTPAuth', __('SMTP authentication is often needed. If you use GMail, make sure to set this parameter to Yes', 'dbem'));
    em_options_input_text('SMTP host', 'dbem_smtp_host', __("The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'.", 'dbem'));
    em_options_input_text(__('SMTP username', 'dbem'), 'dbem_smtp_username', __("Insert the username to be used to access your SMTP server.", 'dbem'));
    em_options_input_password(__('SMTP password', 'dbem'), "dbem_smtp_password", __("Insert the password to be used to access your SMTP server", 'dbem'));
    ?>
			</tbody>
			<?php 
    echo $save_button;
    ?>
		</table>
		<script type="text/javascript" charset="utf-8">
			jQuery(document).ready(function($){
				$('#dbem_rsvp_mail_send_method_row select').change(function(){
					el = $(this);
					if( el.find(':selected').val() == 'smtp' ){
						$('.em-email-settings-smtp').show();
					}else{
						$('.em-email-settings-smtp').hide();
					}
				}).trigger('change');
				$('input#em-admin-check-email').click(function(e,el){
					var email_data = $('.em-email-form input').serialize();
					$.ajax({
						url: EM.ajaxurl,
						dataType: 'json',
						data: email_data+"&action=em_admin_test_email",
						success: function(data){
							if(data.result && data.message){
								$('#em-email-settings-check-status').css({'color':'green','display':'block'}).html(data.message);
							}else{
								var msg = (data.message) ? data.message:'Email not sent';
								$('#em-email-settings-check-status').css({'color':'red','display':'block'}).html(msg);
							}
						},
						error: function(){ $('#em-email-settings-check-status').css({'color':'red','display':'block'}).html('Server Error'); },
						beforeSend: function(){ $('input#em-admin-check-email').val('<?php 
    _e('Checking...', 'dbem');
    ?>
'); },
						complete: function(){ $('input#em-admin-check-email').val('<?php 
    _e('Test Email Settings', 'dbem');
    ?>
');  }
					});
				});
			});
		</script>
	</div> <!-- . inside -->
	</div> <!-- .postbox --> 
	<?php 
}
echo $gmap_is_active ? '' : "checked='checked'";
?>
 /><br />
					<em><?php 
_e('Check this option to enable Goggle Map integration.', 'events-manager');
?>
</em>
				</td>
				<?php 
em_options_input_text(__('Google Maps API Browser Key', 'events-manager'), 'dbem_google_maps_browser_key', sprintf(__('Google Maps require an API key, please see our %s page for instructions on obtaining one.', 'events-manager'), sprintf('<a href="http://wp-events-plugin.com/documentation/google-maps/api-key/">%s</a>', __('documentation', 'events-manager'))));
?>
				<?php 
em_options_input_text(__('Default map width', 'events-manager'), 'dbem_map_default_width', sprintf(__('Can be in form of pixels or a percentage such as %s or %s.', 'events-manager'), '<code>100%</code>', '<code>100px</code>'));
?>
				<?php 
em_options_input_text(__('Default map height', 'events-manager'), 'dbem_map_default_height', sprintf(__('Can be in form of pixels or a percentage such as %s or %s.', 'events-manager'), '<code>100%</code>', '<code>100px</code>'));
?>
			</tr>
			<tr class="em-header"><td colspan="2">
				<h4><?php 
_e('Global Map Format', 'events-manager');
?>
</h4>
				<p><?php 
echo sprintf(__('If you use the %s <a href="%s">shortcode</a>, you can display a map of all your locations and events, the settings below will be used.', 'events-manager'), '<code>[locations_map]</code>', 'http://wp-events-plugin.com/documentation/shortcodes/');
?>
</p>
			</td></tr>
			<?php 
em_options_textarea(__('Location balloon format', 'events-manager'), 'dbem_map_text_format', __('The format of the text appearing in the balloon describing the location.', 'events-manager') . ' ' . __('Event.', 'events-manager') . $locations_placeholder_tip);
?>
Example #5
0
function em_admin_options_page()
{
    //TODO place all options into an array
    $events_placeholders = '<a href="admin.php?page=events-manager-help#event-placeholders">' . __('Event Related Placeholders', 'dbem') . '</a>';
    $locations_placeholders = '<a href="admin.php?page=events-manager-help#location-placeholders">' . __('Location Related Placeholders', 'dbem') . '</a>';
    $bookings_placeholders = '<a href="admin.php?page=events-manager-help#booking-placeholders">' . __('Booking Related Placeholders', 'dbem') . '</a>';
    $events_placeholder_tip = " " . sprintf(__('This accepts %s and %s placeholders.', 'dbem'), $events_placeholders, $locations_placeholders);
    $locations_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $locations_placeholders);
    $bookings_placeholder_tip = " " . sprintf(__('This accepts %s, %s and %s placeholders.', 'dbem'), $bookings_placeholders, $events_placeholders, $locations_placeholders);
    $save_button = '<tr><th>&nbsp;</th><td><p class="submit" style="margin:0px; padding:0px; text-align:right;"><input type="submit" id="dbem_options_submit" name="Submit" value="' . __('Save Changes') . ' (' . __('All', 'dbem') . ')" /></p></ts></td></tr>';
    ?>
	
	<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function($){
			var close_text = '<?php 
    _e('Collapse All', 'dbem');
    ?>
';
			var open_text = '<?php 
    _e('Expand All', 'dbem');
    ?>
';
			var open_close = $('<a href="#" style="display:block; float:right; clear:right; margin:10px;">'+close_text+'</a>');
			$('#icon-options-general').after(open_close);
			open_close.click( function(e){
				e.preventDefault();
				if($(this).text() == close_text){
					$(".postbox").addClass('closed');
					$(this).text(open_text);
				}else{
					$(".postbox").removeClass('closed');
					$(this).text(close_text);
				} 
			});
			//For rewrite titles
			$('input:radio[name=dbem_disable_title_rewrites]').live('change',function(){
				checked_check = $('input:radio[name=dbem_disable_title_rewrites]:checked');
				if( checked_check.val() == 1 ){
					$('#dbem_title_html_row').show();
				}else{
					$('#dbem_title_html_row').hide();					
				}
			});
			$('input:radio[name=dbem_disable_title_rewrites]').trigger('change');
			
		});
	</script>
	<div class="wrap">
		<div id='icon-options-general' class='icon32'><br />
		</div>		
		<h2><?php 
    _e('Event Manager Options', 'dbem');
    ?>
</h2>
		
		<form id="dbem_options_form" method="post" action="">          

			<div class="metabox-holder">         
			<!-- // TODO Move style in css -->
			<div class='postbox-container' style='width: 99.5%'>
			<div id="" class="meta-box-sortables" >
		  
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('General options', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
	            <table class="form-table">
					<?php 
    em_options_radio_binary(__('Use dropdown for locations?'), 'dbem_use_select_for_locations', __('Select yes to select location from a drow-down menu; location selection will be faster, but you will lose the ability to insert locations with events', 'dbem'));
    em_options_radio_binary(__('Use recurrence?'), 'dbem_recurrence_enabled', __('Select yes to enable the recurrence features feature', 'dbem'));
    em_options_radio_binary(__('Use RSVP?'), 'dbem_rsvp_enabled', __('Select yes to enable the RSVP feature', 'dbem'));
    em_options_radio_binary(__('Use categories?'), 'dbem_categories_enabled', __('Select yes to enable the category features', 'dbem'));
    em_options_radio_binary(__('Use attributes?'), 'dbem_attributes_enabled', __('Select yes to enable the attributes feature', 'dbem'));
    /*default category*/
    $category_options = array();
    $category_options[0] = __('no default category', 'dbem');
    $EM_Categories = EM_Categories::get();
    foreach ($EM_Categories as $EM_Category) {
        $category_options[$EM_Category->id] = $EM_Category->name;
    }
    em_options_select(__('Default Category'), 'dbem_default_category', $category_options, __('This option allows you to select the default category when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
    /*default location*/
    $location_options = array();
    $location_options[0] = __('no default location', 'dbem');
    $EM_Locations = EM_Locations::get();
    foreach ($EM_Locations as $EM_Location) {
        $location_options[$EM_Location->id] = $EM_Location->name;
    }
    em_options_select(__('Default Location'), 'dbem_default_location', $location_options, __('This option allows you to select the default location when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
    em_options_textarea(__('Custom Placeholders', 'dbem'), 'dbem_placeholders_custom', sprintf(__("You can add custom placeholders here, one per line in this format <code>#_ATT{key}</code>. They will not appear on event pages unless you insert them into another template below, but you may want to store extra information about an event for other uses. <a href='%s'>More information on placeholders.</a>", 'dbem'), 'wp-events-plugin.com/documentation/the-em-templates-syntax/'));
    echo $save_button;
    ?>
				</table>
				    
			</div> <!-- . inside --> 
			</div> <!-- .postbox --> 
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Events page', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
                 <table class="form-table">         
				 	<?php 
    //Wordpress Pages
    global $em_disable_filter;
    //Using a flag here instead
    $em_disable_filter = true;
    $get_pages = get_pages();
    $events_page_options = array();
    $events_page_options[0] = __('[No Events Page]');
    //TODO Add the hierarchy style ddm, like when choosing page parents
    foreach ($get_pages as $page) {
        $events_page_options[$page->ID] = $page->post_title;
    }
    em_options_select(__('Events page'), 'dbem_events_page', $events_page_options, __('This option allows you to select which page to use as an events page', 'dbem'));
    $em_disable_filter = false;
    //Rest
    em_options_radio_binary(__('Show events page in lists?', 'dbem'), 'dbem_list_events_page', __('Check this option if you want the events page to appear together with other pages in pages lists.', 'dbem'));
    em_options_radio_binary(__('Display calendar in events page?', 'dbem'), 'dbem_display_calendar_in_events_page', __('This options allows to display the calendar in the events page, instead of the default list. It is recommended not to display both the calendar widget and a calendar page.', 'dbem') . ' ' . __('If you would like to show events that span over more than one day, see the Calendar section on this page.', 'dbem'));
    em_options_radio_binary(__('Disable title rewriting?', 'dbem'), 'dbem_disable_title_rewrites', __("Some wordpress themes don't follow best practices when generating navigation menus, and so the automatic title rewriting feature may cause problems, if your menus aren't working correctly on the event pages, try setting this to 'Yes', and provide an appropriate HTML title format below.", 'dbem'));
    em_options_input_text(__('Event Manager titles', 'dbem'), 'dbem_title_html', __("This only setting only matters if you selected 'Yes' to above. You will notice the events page titles aren't being rewritten, and you have a new title underneath the default page name. This is where you control the HTML of this title. Make sure you keep the #_PAGETITLE placeholder here, as that's what is rewritten by events manager. To control what's rewritten in this title, see settings further down for page titles.", 'dbem'));
    em_options_input_text(__('Event List Limits', 'dbem'), 'dbem_events_default_limit', __("This will control how many events are shown on one list by default.", 'dbem'));
    ?>
					<tr valign="top" id='dbem_events_default_orderby_row'>
				   		<th scope="row"><?php 
    _e('Default event list ordering', 'dbem');
    ?>
</th>
				   		<td>   
							<select name="dbem_events_default_orderby" >
								<?php 
    $orderby_options = apply_filters('em_settings_events_default_orderby_ddm', array('start_date,start_time,name' => __('Order by start date, start time, then event name', 'dbem'), 'name,start_date,start_time' => __('Order by name, start date, then start time', 'dbem'), 'name,end_date,end_time' => __('Order by name, end date, then end time', 'dbem'), 'end_date,end_time,name' => __('Order by end date, end time, then event name', 'dbem')));
    ?>
								<?php 
    foreach ($orderby_options as $key => $value) {
        ?>
   
				 				<option value='<?php 
        echo $key;
        ?>
' <?php 
        echo $key == get_option('dbem_events_default_orderby') ? "selected='selected'" : '';
        ?>
>
				 					<?php 
        echo $value;
        ?>
				 				</option>
								<?php 
    }
    ?>
							</select> 
							<select name="dbem_events_default_order" >
								<?php 
    $ascending = __('Ascending', 'dbem');
    $descending = __('Descending', 'dbem');
    $order_options = apply_filters('em_settings_events_default_order_ddm', array('ASC' => __('All Ascending', 'dbem'), 'DESC,ASC,ASC' => __("{$descending}, {$ascending}, {$ascending}", 'dbem'), 'DESC,DESC,ASC' => __("{$descending}, {$descending}, {$ascending}", 'dbem'), 'DESC' => __('All Descending', 'dbem'), 'ASC,DESC,ASC' => __("{$ascending}, {$descending}, {$ascending}", 'dbem'), 'ASC,DESC,DESC' => __("{$ascending}, {$descending}, {$descending}", 'dbem'), 'ASC,ASC,DESC' => __("{$ascending}, {$ascending}, {$descending}", 'dbem'), 'DESC,ASC,DESC' => __("{$descending}, {$ascending}, {$descending}", 'dbem')));
    ?>
								<?php 
    foreach ($order_options as $key => $value) {
        ?>
   
				 				<option value='<?php 
        echo $key;
        ?>
' <?php 
        echo $key == get_option('dbem_events_default_order') ? "selected='selected'" : '';
        ?>
>
				 					<?php 
        echo $value;
        ?>
				 				</option>
								<?php 
    }
    ?>
							</select>
							<br/>
							<em><?php 
    _e('When Events Manager displays lists of events the default behaviour is ordering by start date in ascending order. To change this, modify the values above.', 'dbem');
    ?>
</em>
						</td>
				   	</tr>
					<tr valign="top" id='dbem_events_display_time_limit'>
				   		<th scope="row"><?php 
    _e('Event list range limit', 'dbem');
    ?>
</th>
							<td>
								<select name="dbem_events_page_time_limit" >
									<?php 
    $limit_options = apply_filters('em_settings_events_page_time_limit_ddm', array('0' => __('no limit', 'dbem'), '1' => __('This month', 'dbem'), '2' => __('Next two months', 'dbem'), '3' => __('Next three months', 'dbem'), '6' => __('Next six months', 'dbem'), '12' => __('Next twelve months', 'dbem')));
    ?>
									<?php 
    foreach ($limit_options as $key => $value) {
        ?>
   
									<option value='<?php 
        echo $key;
        ?>
' <?php 
        echo $key == get_option('dbem_events_page_time_limit') ? "selected='selected'" : '';
        ?>
>
										<?php 
        echo $value;
        ?>
									</option>
									<?php 
    }
    ?>
								</select>
								<br />
								<em><?php 
    _e('Only show events starting within a certain time limit on the events page. Default is no time limit is applied.', 'dbem');
    ?>
</em>
							</td>
					</tr>					
					<?php 
    echo $save_button;
    ?>
				
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Events format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
				 	<?php 
    em_options_textarea(__('Default event list format header', 'dbem'), 'dbem_event_list_item_format_header', __('This content will appear just above your code for the default event list format. Default is blank', 'dbem'));
    em_options_textarea(__('Default event list format', 'dbem'), 'dbem_event_list_item_format', __('The format of any events in a list.', 'dbem') . $events_placeholder_tip);
    em_options_textarea(__('Default event list format footer', 'dbem'), 'dbem_event_list_item_format_footer', __('This content will appear just below your code for the default event list format. Default is blank', 'dbem'));
    em_options_input_text(__('Single event page title format', 'dbem'), 'dbem_event_page_title_format', __('The format of a single event page title.', 'dbem') . $events_placeholder_tip);
    em_options_textarea(__('Default single event format', 'dbem'), 'dbem_single_event_format', __('The format of a single event page.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('Events page title', 'dbem'), 'dbem_events_page_title', __('The title on the multiple events page.', 'dbem'));
    em_options_input_text(__('No events message', 'dbem'), 'dbem_no_events_message', __('The message displayed when no events are available.', 'dbem'));
    em_options_input_text(__('List events by date title', 'dbem'), 'dbem_list_date_title', __('If viewing a page for events on a specific date, this is the title that would show up. To insert date values, use <a href="http://www.php.net/manual/en/function.date.php">PHP time format characters</a>  with a <code>#</code> symbol before them, i.e. <code>#m</code>, <code>#M</code>, <code>#j</code>, etc.<br/>', 'dbem'));
    echo $save_button;
    ?>
				</table> 	
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			      
           	<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Calendar format', 'dbem');
    ?>
</span></h3>
			<div class="inside">
            	<table class="form-table">   
					<?php 
    em_options_input_text(__('Small calendar title', 'dbem'), 'dbem_small_calendar_event_title_format', __('The format of the title, corresponding to the text that appears when hovering on an eventful calendar day.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('Small calendar title separator', 'dbem'), 'dbem_small_calendar_event_title_separator', __('The separator appearing on the above title when more than one events are taking place on the same day.', 'dbem'));
    em_options_input_text(__('Full calendar events format', 'dbem'), 'dbem_full_calendar_event_format', __('The format of each event when displayed in the full calendar. Remember to include <code>li</code> tags before and after the event.', 'dbem') . $events_placeholder_tip);
    em_options_radio_binary(__('Show long events on calendar pages?', 'dbem'), 'dbem_full_calendar_long_events', __("If you are showing a calendar on the events page (see Events format section on this page), you have the option of showing events that span over days on each day it occurs.", 'dbem'));
    em_options_radio_binary(__('Show list on day with single event?', 'dbem'), 'dbem_display_calendar_day_single', __("By default, if a calendar day only has one event, it display a single event when clicking on the link of that calendar date. If you select Yes here, you will get always see a list of events.", 'dbem'));
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Locations format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
					<?php 
    em_options_input_text(__('Single location page title format', 'dbem'), 'dbem_location_page_title_format', __('The format of a single location page title.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(__('Default single location page format', 'dbem'), 'dbem_single_location_format', __('The format of a single location page.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(__('Default location balloon format', 'dbem'), 'dbem_location_baloon_format', __('The format of of the text appearing in the baloon describing the location in the map.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(__('Default location event list format', 'dbem'), 'dbem_location_event_list_item_format', __('The format of the events the list inserted in the location page through the <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> element.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(__('Default no events message', 'dbem'), 'dbem_location_no_events_message', __('The message to be displayed in the list generated by <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> when no events are available.', 'dbem'));
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('RSS feed format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
					<?php 
    em_options_input_text(__('RSS main title', 'dbem'), 'dbem_rss_main_title', __('The main title of your RSS events feed.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('RSS main description', 'dbem'), 'dbem_rss_main_description', __('The main description of your RSS events feed.', 'dbem'));
    em_options_input_text(__('RSS title format', 'dbem'), 'dbem_rss_title_format', __('The format of the title of each item in the events RSS feed.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('RSS description format', 'dbem'), 'dbem_rss_description_format', __('The format of the description of each item in the events RSS feed.', 'dbem') . $events_placeholder_tip);
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Maps and geotagging', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'> 
					<?php 
    $gmap_is_active = get_option('dbem_gmap_is_active');
    ?>
					<tr valign="top">
						<th scope="row"><?php 
    _e('Enable Google Maps integration?', 'dbem');
    ?>
</th>
						<td>
							<?php 
    _e('Yes');
    ?>
 <input id="dbem_gmap_is_active_yes" name="dbem_gmap_is_active" type="radio" value="1" <?php 
    echo $gmap_is_active ? "checked='checked'" : '';
    ?>
 />
							<?php 
    _e('No');
    ?>
 <input name="dbem_gmap_is_active" type="radio" value="0" <?php 
    echo $gmap_is_active ? '' : "checked='checked'";
    ?>
 /><br />
							<em><?php 
    _e('Check this option to enable Goggle Map integration.', 'dbem');
    ?>
</em>
						</td>
					</tr>
					<?php 
    em_options_textarea(__('Map text format', 'dbem'), 'dbem_map_text_format', __('The text format inside the map balloons.', 'dbem') . $events_placeholder_tip);
    echo $save_button;
    ?>
 
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('RSVP and bookings', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
    em_options_select(__('Default contact person', 'dbem'), 'dbem_default_contact_person', em_get_wp_users(), __('Select the default contact person. This user will be employed whenever a contact person is not explicitly specified for an event', 'dbem'));
    em_options_radio_binary(__('Approval Required?', 'dbem'), 'dbem_bookings_approval', __('Bookings will not be confirmed until the event administrator approves it.', 'dbem'));
    em_options_input_text(__('Email events admin?', 'dbem'), 'dbem_bookings_notify_admin', __("If you would like every event booking confirmation email sent to an administrator write their email here (leave blank to not send an email).", 'dbem'));
    em_options_radio_binary(__('Email contact person?', 'dbem'), 'dbem_bookings_contact_email', __('Check this option if you want the event contact to receive an email when someone books places. An email will be sent when a booking is first made (regardless if confirmed or pending)', 'dbem'));
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Contact person booking confirmed', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('An email will be sent to the event contact when a booking is first made.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Contact person email subject', 'dbem'), 'dbem_bookings_contact_email_subject', '');
    em_options_textarea(__('Contact person email', 'dbem'), 'dbem_bookings_contact_email_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Contact person booking cancelled', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('An email will be sent to the event contact if someone cancels their booking.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Contact person cancellation subject', 'dbem'), 'dbem_contactperson_email_cancelled_subject', '');
    em_options_textarea(__('Contact person cancellation email', 'dbem'), 'dbem_contactperson_email_cancelled_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Confirmed booking email', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This is sent when a person\'s booking is confirmed. This will be sent automatically if approvals are required and the booking is approved. If approvals are disabled, this is sent out when a user first submits their booking.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking confirmed email subject', 'dbem'), 'dbem_bookings_email_confirmed_subject', '');
    em_options_textarea(__('Booking confirmed email', 'dbem'), 'dbem_bookings_email_confirmed_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Pending booking email', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This will be sent to the person when they first submit their booking. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking pending email subject', 'dbem'), 'dbem_bookings_email_pending_subject', '');
    em_options_textarea(__('Booking pending email', 'dbem'), 'dbem_bookings_email_pending_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Rejected booking email', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This will be sent automatically when a booking is rejected. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking rejected email subject', 'dbem'), 'dbem_bookings_email_rejected_subject', __("The subject of the email sent to the person making a booking that is awaiting administrator approval. Not relevant if bookings don't require approval.", 'dbem') . $bookings_placeholder_tip);
    em_options_textarea(__('Booking rejected email', 'dbem'), 'dbem_bookings_email_rejected_body', __('The body of the email which will be sent to the person if the booking is rejected. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip);
    echo $save_button;
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Booking cancelled', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This will be sent when a user cancels their booking.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking cancelled email subject', 'dbem'), 'dbem_bookings_email_cancelled_subject', '');
    em_options_textarea(__('Booking cancelled email', 'dbem'), 'dbem_bookings_email_cancelled_body', '');
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
						
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Email Settings', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
    em_options_input_text(__('Notification sender name', 'dbem'), 'dbem_mail_sender_name', __("Insert the display name of the notification sender.", 'dbem'));
    em_options_input_text(__('Notification sender address', 'dbem'), 'dbem_mail_sender_address', __("Insert the address of the notification sender.", 'dbem'));
    em_options_input_text('Mail sending port', 'dbem_rsvp_mail_port', __("The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port", 'dbem'));
    em_options_select(__('Mail sending method', 'dbem'), 'dbem_rsvp_mail_send_method', array('smtp' => 'SMTP', 'mail' => __('PHP mail function', 'dbem'), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail', 'wp_mail' => 'WP Mail'), __('Select the method to send email notification.', 'dbem'));
    em_options_radio_binary(__('Use SMTP authentication?', 'dbem'), 'dbem_rsvp_mail_SMTPAuth', __('SMTP authentication is often needed. If you use GMail, make sure to set this parameter to Yes', 'dbem'));
    em_options_input_text('SMTP host', 'dbem_smtp_host', __("The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'.", 'dbem'));
    em_options_input_text(__('SMTP username', 'dbem'), 'dbem_smtp_username', __("Insert the username to be used to access your SMTP server.", 'dbem'));
    em_options_input_password(__('SMTP password', 'dbem'), "dbem_smtp_password", __("Insert the password to be used to access your SMTP server", 'dbem'));
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Images size', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
    em_options_input_text(__('Maximum width (px)', 'dbem'), 'dbem_image_max_width', __('The maximum allowed width for images uploades', 'dbem'));
    em_options_input_text(__('Maximum height (px)', 'dbem'), 'dbem_image_max_height', __("The maximum allowed height for images uploaded, in pixels", 'dbem'));
    em_options_input_text(__('Maximum size (bytes)', 'dbem'), 'dbem_image_max_size', __("The maximum allowed size for images uploaded, in pixels", 'dbem'));
    echo $save_button;
    ?>
				</table> 
			</div> <!-- . inside -->
			</div> <!-- .postbox -->

		<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Management Permission Options', 'dbem');
    ?>
 (Beta)</span></h3>
			<div class="inside">
	            <table class="form-table">
	            	<tr><td colspan="2">
	            		<strong><?php 
    _e('Warning: Changing these values may result in exposing previously hidden information to all users.');
    ?>
</strong><br />
	            		<em><?php 
    _e('Note that currently "users" are considered as wordpress contributor users upwards, as they can create and manage events (we\'re working on that). Wordpress administrators can control all events/locations/categories/etc. on Events Manager.', 'dbem');
    ?>
</em>
	            	</td></tr>
					<tr><th colspan="2"><strong><?php 
    _e('Event Permissions', 'dbem');
    ?>
</strong></th></tr>
					<?php 
    $location_privacy_options = array('0' => __('Every user can create and manage their own events. Users can\'t view or modify each others\' events and booking data', 'dbem'), '1' => __('Every user can create/edit/delete any event on this site. (not recommended)', 'dbem'));
    em_options_radio('dbem_permissions_events', $location_privacy_options);
    ?>
					<tr><th colspan="2"><strong><?php 
    _e('Location Permissions', 'dbem');
    ?>
</strong></th></tr>
					<?php 
    $location_privacy_options = array('0' => __('Every user can create and manage their own location.', 'dbem') . " " . __('In future releases of Events Manager, sharing locations with more than one user will be possible in this option, as well as connecting different user defined locations to prevent duplicate listings.', 'dbem'), '1' => __('Only event administrators can create and edit locations. User must choose from these available locations.', 'dbem'), '2' => __('Everyone can create/edit/delete all locations on this site. (not recommended)', 'dbem'));
    em_options_radio('dbem_permissions_locations', $location_privacy_options);
    ?>
					<tr><th colspan="2"><strong><?php 
    _e('Category Permissions', 'dbem');
    ?>
</strong></th></tr>
					<?php 
    $category_privacy_options = array('0' => __('Every user can create and manage their own category.', 'dbem'), '1' => __('Only event administrators can create and edit categories. User must choose from these available categories.', 'dbem'), '2' => __('Everyone can create/edit/delete all categories on the system. (not recommended)', 'dbem'));
    em_options_radio('dbem_permissions_categories', $category_privacy_options);
    ?>
				</table>
				    
			</div> <!-- . inside --> 
			</div> <!-- .postbox -->    
            
			<p class="submit">
				<input type="submit" id="dbem_options_submit" name="Submit" value="<?php 
    _e('Save Changes');
    ?>
" />
				<input type="hidden" name="em-submitted" value="1" />
			</p>  
			
			</div> <!-- .metabox-sortables -->
			</div> <!-- .postbox-container -->
			
			</div> <!-- .metabox-holder -->	
		</form>
	</div>
	<?php 
}
Example #6
0
em_options_input_text(__('Event approved subject', 'dbem'), 'dbem_event_approved_email_subject', __('If left blank, this email will not be sent.', 'dbem'));
em_options_textarea(__('Event approved email', 'dbem'), 'dbem_event_approved_email_body', '');
?>

			<tr class="em-subheader"><td colspan='2'>
				<h5><?php 
_e('Event Reapproved', 'dbem');
?>
</h5>
			    <?php 
echo __('When a user modifies a previously published event, it will be put back into pending review status and will not be publisehd until you re-approve it.', 'dbem') . $bookings_placeholder_tip;
?>

			</td></tr>
			<?php 
em_options_input_text(__('Event reapproved subject', 'dbem'), 'dbem_event_reapproved_email_subject', __('If left blank, this email will not be sent.', 'dbem'));
em_options_textarea(__('Event reapproved email', 'dbem'), 'dbem_event_reapproved_email_body', '');
?>

			</tbody>
			<?php 
echo $save_button;
?>

		</table>
	</div> <!-- . inside -->
	</div> <!-- .postbox -->
	
	<?php 
do_action('em_options_page_footer_emails');
?>
Example #7
0
			 				</option>
							<?php 
    }
    ?>

						</select>
						<br /><?php 
    echo __('When listing tags, this order is applied.', 'dbem');
    ?>

					</td>
			   	</tr>
				<?php 
    em_options_input_text(__('List Limits', 'dbem'), 'dbem_tags_default_limit', sprintf(__("This will control how many %s are shown on one list by default.", 'dbem'), __('tags', 'dbem')));
    em_options_input_text(__('Event List Limits', 'dbem'), 'dbem_tag_event_list_limit', sprintf(__("Controls how many events belonging to a tag are shown per page when using placeholders such as %s. Leave blank for no limit.", 'dbem'), '<code>#_TAGNEXTEVENTS</code>'));
    echo $save_button;
    ?>

            </table>					    
		</div> <!-- . inside --> 
		</div> <!-- .postbox -->
		<?php 
}
?>

		
		<div  class="postbox " id="em-opt-other-pages" >
		<div class="handlediv" title="<?php 
__('Click to toggle', 'dbem');
?>
Example #8
0
</h4>
			</td></tr>
            <?php 
em_options_radio_binary(__('Limit loading of our CSS files?', 'dbem'), 'dbem_css_limit', __('Enabling this will prevent us from loading our CSS file on every page, and will only load on specific pages generated by Events Manager.', 'dbem'));
?>

				<tbody id="dbem-css-limit-options">
				<tr class="em-subheader"><td colspan="2">
	            	<?php 
echo $performance_opt_page_instructions;
?>

				</td></tr>
				<?php 
em_options_input_text(__('Include on', 'dbem'), 'dbem_css_limit_include', __('Our CSS file will only be INCLUDED on all of these pages.', 'dbem'), 0);
em_options_input_text(__('Exclude on', 'dbem'), 'dbem_css_limit_exclude', __('Our CSS file will be EXCLUDED on all of these pages. Takes precedence over inclusion rules.', 'dbem'), 0);
?>

            	</tbody>
            	<?php 
?>

			<tr  class="em-header"><td  colspan="2">  
			    <h4><?php 
_e('Thumbnails', 'dbem');
?>
</h4>  
			</td></tr>  
			<?php 
em_options_radio_binary(__('Disable  WordPress Thumbnails?', 'dbem'), 'dbem_disable_thumbnails', __('If set to yes, full sized images will be used and HTML width and height attributes will be used to determine the size.', 'dbem') . ' ' . sprintf(__('Setting this to yes will also make your images crop efficiently with the %s feature in the %s plugin.', 'dbem'), '<a href="http://jetpack.me/support/photon/">Photon</a>', '<a href="https://wordpress.org/plugins/jetpack/">JetPack</a>'));
?>
Example #9
0
function em_admin_options_page()
{
    global $wpdb;
    //TODO place all options into an array
    $events_placeholders = '<a href="admin.php?page=events-manager-help#event-placeholders">' . __('Event Related Placeholders', 'dbem') . '</a>';
    $locations_placeholders = '<a href="admin.php?page=events-manager-help#location-placeholders">' . __('Location Related Placeholders', 'dbem') . '</a>';
    $bookings_placeholders = '<a href="admin.php?page=events-manager-help#booking-placeholders">' . __('Booking Related Placeholders', 'dbem') . '</a>';
    $categories_placeholders = '<a href="admin.php?page=events-manager-help#category-placeholders">' . __('Category Related Placeholders', 'dbem') . '</a>';
    $events_placeholder_tip = " " . sprintf(__('This accepts %s and %s placeholders.', 'dbem'), $events_placeholders, $locations_placeholders);
    $locations_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $locations_placeholders);
    $categories_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $categories_placeholders);
    $bookings_placeholder_tip = " " . sprintf(__('This accepts %s, %s and %s placeholders.', 'dbem'), $bookings_placeholders, $events_placeholders, $locations_placeholders);
    $save_button = '<tr><th>&nbsp;</th><td><p class="submit" style="margin:0px; padding:0px; text-align:right;"><input type="submit" id="dbem_options_submit" name="Submit" value="' . __('Save Changes') . ' (' . __('All', 'dbem') . ')" /></p></ts></td></tr>';
    //Do some multisite checking here for reuse
    $multisite_view = is_multisite() && is_super_admin() ? ' - (' . __('Only Network Admins see this', 'dbem') . ')' : '';
    ?>
	
	<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function($){
			var close_text = '<?php 
    _e('Collapse All', 'dbem');
    ?>
';
			var open_text = '<?php 
    _e('Expand All', 'dbem');
    ?>
';
			var open_close = $('<a href="#" style="display:block; float:right; clear:right; margin:10px;">'+close_text+'</a>');
			$('#icon-options-general').after(open_close);
			open_close.click( function(e){
				e.preventDefault();
				if($(this).text() == close_text){
					$(".postbox").addClass('closed');
					$(this).text(open_text);
				}else{
					$(".postbox").removeClass('closed');
					$(this).text(close_text);
				} 
			});
			//For rewrite titles
			$('input:radio[name=dbem_disable_title_rewrites]').live('change',function(){
				checked_check = $('input:radio[name=dbem_disable_title_rewrites]:checked');
				if( checked_check.val() == 1 ){
					$('#dbem_title_html_row').show();
				}else{
					$('#dbem_title_html_row').hide();					
				}
			});
			$('input:radio[name=dbem_disable_title_rewrites]').trigger('change');
			$(".postbox").addClass('closed'); //Let's start off closing everything for now.			
		});
	</script>
	<div class="wrap">
		<div id='icon-options-general' class='icon32'><br />
		</div>		
		<h2><?php 
    _e('Event Manager Options', 'dbem');
    ?>
</h2>
		<?php 
    /*
     * START MIGRATION BIT
     */
    if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'bookings_migrate') {
        require_once dirname(__FILE__) . '/../em-install.php';
        em_migrate_bookings();
    } elseif (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'bookings_migrate_delete') {
        require_once dirname(__FILE__) . '/../em-install.php';
        em_migrate_bookings_delete();
    }
    ?>
		<?php 
    if ($wpdb->get_var("SHOW TABLES LIKE '" . EM_PEOPLE_TABLE . "'") == EM_PEOPLE_TABLE) {
        ?>
			<?php 
        if ($wpdb->get_var('SELECT COUNT(*) FROM ' . EM_TICKETS_BOOKINGS_TABLE) > 0) {
            ?>
				<div class='updated'>
					<p>
					It looks like you've already tried reimporting some bookings into the new version (or new bookings have been made since you installed). 
					If everything looks correct, you can 
					<a href="admin.php?page=events-manager-options&amp;_wpnonce=<?php 
            echo wp_create_nonce('bookings_migrate_delete');
            ?>
&amp;action=bookings_migrate_delete">delete the unused tables</a>, 
					or you can also safely try 
					<a href="admin.php?page=events-manager-options&amp;_wpnonce=<?php 
            echo wp_create_nonce('bookings_migrate');
            ?>
&amp;action=bookings_migrate">re-importing again</a>.
					</p>
				</div>
			<?php 
        } else {
            ?>
				<div class='updated'>
					<p>It looks like you've upgraded from Events Manager version 3.0, meaning your old bookings won't work until you re-import them. 
					Events Manager 3.0 kept booking user info in a simple database table, whereas now people that make bookings get a subscriber account so 
					they can access private booking information. You have to choice to 
					<a href="admin.php?page=events-manager-options&amp;_wpnonce=<?php 
            echo wp_create_nonce('bookings_migrate');
            ?>
&amp;action=bookings_migrate">import all your old bookings</a> 
					and create wordpress accounts for bookers, or you can also start afresh and 
					<a href="admin.php?page=events-manager-options&amp;_wpnonce=<?php 
            echo wp_create_nonce('bookings_migrate_delete');
            ?>
&amp;action=bookings_migrate_delete">delete the old bookings</a>.
					</p>
				</div>
			<?php 
        }
        ?>
		<?php 
    }
    ?>
		<?php 
    /*
     *  END MIGRATION BIT
     */
    ?>
		<form id="dbem_options_form" method="post" action="">          

			<div class="metabox-holder">         
			<!-- // TODO Move style in css -->
			<div class='postbox-container' style='width: 99.5%'>
			<div id="" class="meta-box-sortables" >
		  
			<?php 
    if (is_multisite() && is_super_admin()) {
        ?>
			<div  class="postbox " >
				<div class="handlediv" title="<?php 
        __('Click to toggle');
        ?>
"><br /></div><h3 class='hndle'><span><?php 
        _e('Multi Site Options', 'dbem');
        ?>
 <?php 
        echo $multisite_view;
        ?>
</span></h3>
				<div class="inside">
		            <table class="form-table">
						<?php 
        em_options_radio_binary(__('Enable global tables mode?'), 'dbem_ms_global_table', __('Setting this to yes will make all events save in the main site event tables (EM must also be activated). This allows you to share events across different blogs, such as showing events in your network whilst allowing users to display and manage their events within their own blog. Bear in mind that activating this will mean old events created on the sub-blogs will not be accessible anymore, and if you switch back they will be but new events created during global events mode will only remain on the main site.', 'dbem'));
        em_options_radio_binary(__('Display global events on main blog?'), 'dbem_ms_global_events', __('Displays events from all sites on the network by default. You can still restrict events by blog using shortcodes and template tags coupled with the <code>blog</code> attribute. Requires global tables to be turned on.', 'dbem'));
        em_options_radio_binary(__('Link sub-site events directly to sub-site?'), 'dbem_ms_global_events_links', __('When displaying global events on the main site you have the option of users viewing the event details on the main site or being directed to the sub-site.', 'dbem'));
        echo $save_button;
        ?>
					</table>
					    
				</div> <!-- . inside --> 
			</div> <!-- .postbox --> 
			<?php 
    }
    ?>
		  
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('General options', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
	            <table class="form-table">
					<?php 
    em_options_radio_binary(__('Use dropdown for locations?'), 'dbem_use_select_for_locations', __('Select yes to select location from a drow-down menu; location selection will be faster, but you will lose the ability to insert locations with events', 'dbem'));
    em_options_radio_binary(__('Use recurrence?'), 'dbem_recurrence_enabled', __('Select yes to enable the recurrence features feature', 'dbem'));
    em_options_radio_binary(__('Enable bookings?'), 'dbem_rsvp_enabled', __('Select yes to allow bookings and tickets for events.', 'dbem'));
    em_options_radio_binary(__('Use categories?'), 'dbem_categories_enabled', __('Select yes to enable the category features', 'dbem'));
    em_options_radio_binary(__('Use event attributes?'), 'dbem_attributes_enabled', __('Select yes to enable the attributes feature', 'dbem'));
    /*default category*/
    $category_options = array();
    $category_options[0] = __('no default category', 'dbem');
    $EM_Categories = EM_Categories::get();
    foreach ($EM_Categories as $EM_Category) {
        $category_options[$EM_Category->id] = $EM_Category->name;
    }
    em_options_select(__('Default Category'), 'dbem_default_category', $category_options, __('This option allows you to select the default category when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
    /*default location*/
    $location_options = array();
    $location_options[0] = __('no default location', 'dbem');
    $EM_Locations = EM_Locations::get();
    foreach ($EM_Locations as $EM_Location) {
        $location_options[$EM_Location->id] = $EM_Location->name;
    }
    em_options_select(__('Default Location'), 'dbem_default_location', $location_options, __('This option allows you to select the default location when adding an event.', 'dbem') . " " . __('(not applicable with event ownership on presently, coming soon!)', 'dbem'));
    /*default location country*/
    em_options_select(__('Default Location Country'), 'dbem_location_default_country', em_get_countries(__('no default country', 'dbem')), __('If you select a default country, that will be pre-selected when creating a new location.', 'dbem'));
    em_options_textarea(__('Event Attributes', 'dbem'), 'dbem_placeholders_custom', sprintf(__("You can also add event attributes here, one per line in this format <code>#_ATT{key}</code>. They will not appear on event pages unless you insert them into another template below, but you may want to store extra information about an event for other uses. <a href='%s'>More information on placeholders.</a>", 'dbem'), 'wp-events-plugin.com/documentation/event-attributes/'));
    echo $save_button;
    ?>
				</table>
				    
			</div> <!-- . inside --> 
			</div> <!-- .postbox --> 
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Events page', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
                 <table class="form-table">         
				 	<?php 
    //Wordpress Pages
    global $em_disable_filter;
    //Using a flag here instead
    $em_disable_filter = true;
    $get_pages = get_pages();
    $events_page_options = array();
    $events_page_options[0] = __('[No Events Page]');
    //TODO Add the hierarchy style ddm, like when choosing page parents
    foreach ($get_pages as $page) {
        $events_page_options[$page->ID] = $page->post_title;
    }
    em_options_select(__('Events page'), 'dbem_events_page', $events_page_options, __('This option allows you to select which page to use as an events page', 'dbem'));
    $em_disable_filter = false;
    //Rest
    em_options_radio_binary(__('Show events page in lists?', 'dbem'), 'dbem_list_events_page', __('Check this option if you want the events page to appear together with other pages in pages lists.', 'dbem'));
    em_options_radio_binary(__('Display calendar in events page?', 'dbem'), 'dbem_display_calendar_in_events_page', __('This options allows to display the calendar in the events page, instead of the default list. It is recommended not to display both the calendar widget and a calendar page.', 'dbem') . ' ' . __('If you would like to show events that span over more than one day, see the Calendar section on this page.', 'dbem'));
    em_options_radio_binary(__('Disable title rewriting?', 'dbem'), 'dbem_disable_title_rewrites', __("Some wordpress themes don't follow best practices when generating navigation menus, and so the automatic title rewriting feature may cause problems, if your menus aren't working correctly on the event pages, try setting this to 'Yes', and provide an appropriate HTML title format below.", 'dbem'));
    em_options_input_text(__('Event Manager titles', 'dbem'), 'dbem_title_html', __("This only setting only matters if you selected 'Yes' to above. You will notice the events page titles aren't being rewritten, and you have a new title underneath the default page name. This is where you control the HTML of this title. Make sure you keep the #_PAGETITLE placeholder here, as that's what is rewritten by events manager. To control what's rewritten in this title, see settings further down for page titles.", 'dbem'));
    em_options_input_text(__('Event List Limits', 'dbem'), 'dbem_events_default_limit', __("This will control how many events are shown on one list by default.", 'dbem'));
    em_options_radio_binary(__('Are current events past events?', 'dbem'), 'dbem_events_current_are_past', __("By default, events that are have an end date later than today will be included in searches, set this to yes to consider events that started 'yesterday' as past.", 'dbem'));
    em_options_radio_binary(__('Show events search?', 'dbem'), 'dbem_events_page_search', __("If set to yes, a search form will appear just above your list of events.", 'dbem'));
    ?>
					<tr valign="top" id='dbem_events_default_orderby_row'>
				   		<th scope="row"><?php 
    _e('Default event list ordering', 'dbem');
    ?>
</th>
				   		<td>   
							<select name="dbem_events_default_orderby" >
								<?php 
    $orderby_options = apply_filters('em_settings_events_default_orderby_ddm', array('start_date,start_time,name' => __('Order by start date, start time, then event name', 'dbem'), 'name,start_date,start_time' => __('Order by name, start date, then start time', 'dbem'), 'name,end_date,end_time' => __('Order by name, end date, then end time', 'dbem'), 'end_date,end_time,name' => __('Order by end date, end time, then event name', 'dbem')));
    ?>
								<?php 
    foreach ($orderby_options as $key => $value) {
        ?>
   
				 				<option value='<?php 
        echo $key;
        ?>
' <?php 
        echo $key == get_option('dbem_events_default_orderby') ? "selected='selected'" : '';
        ?>
>
				 					<?php 
        echo $value;
        ?>
				 				</option>
								<?php 
    }
    ?>
							</select> 
							<select name="dbem_events_default_order" >
								<?php 
    $ascending = __('Ascending', 'dbem');
    $descending = __('Descending', 'dbem');
    $order_options = apply_filters('em_settings_events_default_order_ddm', array('ASC' => __('All Ascending', 'dbem'), 'DESC,ASC,ASC' => __("{$descending}, {$ascending}, {$ascending}", 'dbem'), 'DESC,DESC,ASC' => __("{$descending}, {$descending}, {$ascending}", 'dbem'), 'DESC' => __('All Descending', 'dbem'), 'ASC,DESC,ASC' => __("{$ascending}, {$descending}, {$ascending}", 'dbem'), 'ASC,DESC,DESC' => __("{$ascending}, {$descending}, {$descending}", 'dbem'), 'ASC,ASC,DESC' => __("{$ascending}, {$ascending}, {$descending}", 'dbem'), 'DESC,ASC,DESC' => __("{$descending}, {$ascending}, {$descending}", 'dbem')));
    ?>
								<?php 
    foreach ($order_options as $key => $value) {
        ?>
   
				 				<option value='<?php 
        echo $key;
        ?>
' <?php 
        echo $key == get_option('dbem_events_default_order') ? "selected='selected'" : '';
        ?>
>
				 					<?php 
        echo $value;
        ?>
				 				</option>
								<?php 
    }
    ?>
							</select>
							<br/>
							<em><?php 
    _e('When Events Manager displays lists of events the default behaviour is ordering by start date in ascending order. To change this, modify the values above.', 'dbem');
    ?>
</em>
						</td>
				   	</tr>				   	
					<tr valign="top" id='dbem_events_display_time_limit'>
				   		<th scope="row"><?php 
    _e('Event list scope', 'dbem');
    ?>
</th>
							<td>
								<select name="dbem_events_page_scope" >
									<?php 
    foreach (em_get_scopes() as $key => $value) {
        ?>
   
									<option value='<?php 
        echo $key;
        ?>
' <?php 
        echo $key == get_option('dbem_events_page_scope') ? "selected='selected'" : '';
        ?>
>
										<?php 
        echo $value;
        ?>
									</option>
									<?php 
    }
    ?>
								</select>
								<br />
								<em><?php 
    _e('Only show events starting within a certain time limit on the events page. Default is future events with no end time limit.', 'dbem');
    ?>
</em>
							</td>
					</tr>
					<?php 
    echo $save_button;
    ?>
				
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Events format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
				 	<tr><td><strong><?php 
    echo sprintf(__('%s Page', 'dbem'), __('Events', 'dbem'));
    ?>
</strong></td></tr>
					<?php 
    em_options_input_text(__('Events page title', 'dbem'), 'dbem_events_page_title', __('The title on the multiple events page.', 'dbem'));
    em_options_textarea(__('Default event list format header', 'dbem'), 'dbem_event_list_item_format_header', __('This content will appear just above your code for the default event list format. Default is blank', 'dbem'));
    em_options_textarea(__('Default event list format', 'dbem'), 'dbem_event_list_item_format', __('The format of any events in a list.', 'dbem') . $events_placeholder_tip);
    em_options_textarea(__('Default event list format footer', 'dbem'), 'dbem_event_list_item_format_footer', __('This content will appear just below your code for the default event list format. Default is blank', 'dbem'));
    em_options_input_text(__('No events message', 'dbem'), 'dbem_no_events_message', __('The message displayed when no events are available.', 'dbem'));
    em_options_input_text(__('List events by date title', 'dbem'), 'dbem_list_date_title', __('If viewing a page for events on a specific date, this is the title that would show up. To insert date values, use <a href="http://www.php.net/manual/en/function.date.php">PHP time format characters</a>  with a <code>#</code> symbol before them, i.e. <code>#m</code>, <code>#M</code>, <code>#j</code>, etc.<br/>', 'dbem'));
    ?>
				 	<tr><td><strong><?php 
    echo sprintf(__('Single %s Page', 'dbem'), __('Event', 'dbem'));
    ?>
</strong></td></tr>
				 	<?php 
    em_options_input_text(__('Single event page title format', 'dbem'), 'dbem_event_page_title_format', __('The format of a single event page title.', 'dbem') . $events_placeholder_tip);
    em_options_textarea(__('Default single event format', 'dbem'), 'dbem_single_event_format', __('The format of a single event page.', 'dbem') . $events_placeholder_tip);
    echo $save_button;
    ?>
				</table> 	
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			      
           	<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Calendar format', 'dbem');
    ?>
</span></h3>
			<div class="inside">
            	<table class="form-table">
					<?php 
    em_options_input_text(__('Small calendar title', 'dbem'), 'dbem_small_calendar_event_title_format', __('The format of the title, corresponding to the text that appears when hovering on an eventful calendar day.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('Small calendar title separator', 'dbem'), 'dbem_small_calendar_event_title_separator', __('The separator appearing on the above title when more than one events are taking place on the same day.', 'dbem'));
    em_options_input_text(__('Full calendar events format', 'dbem'), 'dbem_full_calendar_event_format', __('The format of each event when displayed in the full calendar. Remember to include <code>li</code> tags before and after the event.', 'dbem') . $events_placeholder_tip);
    em_options_radio_binary(__('Show long events on calendar pages?', 'dbem'), 'dbem_full_calendar_long_events', __("If you are showing a calendar on the events page (see Events format section on this page), you have the option of showing events that span over days on each day it occurs.", 'dbem'));
    em_options_radio_binary(__('Show list on day with single event?', 'dbem'), 'dbem_display_calendar_day_single', __("By default, if a calendar day only has one event, it display a single event when clicking on the link of that calendar date. If you select Yes here, you will get always see a list of events.", 'dbem'));
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Locations format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
				 	<tr><td><strong><?php 
    echo sprintf(__('%s Page', 'dbem'), __('Locations', 'dbem'));
    ?>
</strong></td></tr>
					<?php 
    em_options_input_text(sprintf(__('%s page title', 'dbem'), __('Locations', 'dbem')), 'dbem_locations_page_title', sprintf(__('The title on the multiple %s page.', 'dbem'), __('locations', 'dbem')));
    em_options_textarea(sprintf(__('%s list header format', 'dbem'), __('Locations', 'dbem')), 'dbem_location_list_item_format_header', sprintf(__('This content will appear just above your code for the %s list format below. Default is blank', 'dbem'), __('locations', 'dbem')));
    em_options_textarea(sprintf(__('%s list item format', 'dbem'), __('Locations', 'dbem')), 'dbem_location_list_item_format', sprintf(__('The format of a single %s in a list.', 'dbem'), __('locations', 'dbem')) . $locations_placeholder_tip);
    em_options_textarea(sprintf(__('%s list footer format', 'dbem'), __('Locations', 'dbem')), 'dbem_location_list_item_format_footer', sprintf(__('This content will appear just below your code for the %s list format above. Default is blank', 'dbem'), __('locations', 'dbem')));
    em_options_input_text(sprintf(__('No %s message', 'dbem'), __('Locations', 'dbem')), 'dbem_no_locations_message', sprintf(__('The message displayed when no %s are available.', 'dbem'), __('locations', 'dbem')));
    ?>
				 	<tr><td><strong><?php 
    echo sprintf(__('Single %s Page', 'dbem'), __('Location', 'dbem'));
    ?>
</strong></td></tr>
				 	<?php 
    em_options_input_text(sprintf(__('Single %s title format', 'dbem'), __('location', 'dbem')), 'dbem_location_page_title_format', __('The format of a single location page title.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(sprintf(__('Single %s page format', 'dbem'), __('location', 'dbem')), 'dbem_single_location_format', __('The format of a single location page.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(__('Default location balloon format', 'dbem'), 'dbem_location_baloon_format', __('The format of of the text appearing in the baloon describing the location a single location map.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(sprintf(__('Default %s list format', 'dbem'), __('events', 'dbem')), 'dbem_location_event_list_item_format', __('The format of the events the list inserted in the location page through the <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> element.', 'dbem') . $locations_placeholder_tip);
    em_options_textarea(sprintf(__('No %s message', 'dbem'), __('events', 'dbem')), 'dbem_location_no_events_message', __('The message to be displayed in the list generated by <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> when no events are available.', 'dbem'));
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Categories format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
				 	<tr><td><strong><?php 
    echo sprintf(__('%s Page', 'dbem'), __('Categories', 'dbem'));
    ?>
</strong></td></tr>
					<?php 
    em_options_input_text(sprintf(__('%s page title', 'dbem'), __('Categories', 'dbem')), 'dbem_categories_page_title', sprintf(__('The title on the multiple %s page.', 'dbem'), __('categories', 'dbem')));
    em_options_textarea(sprintf(__('%s list header format', 'dbem'), __('Categories', 'dbem')), 'dbem_categories_list_item_format_header', sprintf(__('This content will appear just above your code for the %s list format below. Default is blank', 'dbem'), __('categories', 'dbem')));
    em_options_textarea(sprintf(__('%s list item format', 'dbem'), __('Categories', 'dbem')), 'dbem_categories_list_item_format', sprintf(__('The format of a single %s in a list.', 'dbem'), __('categories', 'dbem')) . $categories_placeholder_tip);
    em_options_textarea(sprintf(__('%s list footer format', 'dbem'), __('Categories', 'dbem')), 'dbem_categories_list_item_format_footer', sprintf(__('This content will appear just below your code for the %s list format above. Default is blank', 'dbem'), __('categories', 'dbem')));
    em_options_input_text(sprintf(__('No %s message', 'dbem'), __('Categories', 'dbem')), 'dbem_no_categories_message', sprintf(__('The message displayed when no %s are available.', 'dbem'), __('categories', 'dbem')));
    ?>
				 	<tr><td><strong><?php 
    echo sprintf(__('Single %s Page', 'dbem'), __('Category', 'dbem'));
    ?>
</strong></td></tr>
				 	<?php 
    em_options_input_text(sprintf(__('Single %s title format', 'dbem'), __('category', 'dbem')), 'dbem_category_page_title_format', __('The format of a single category page title.', 'dbem') . $categories_placeholder_tip);
    em_options_textarea(sprintf(__('Single %s page format', 'dbem'), __('category', 'dbem')), 'dbem_category_page_format', __('The format of a single category page.', 'dbem') . $categories_placeholder_tip);
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('RSS feed format', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
            	<table class="form-table">
					<?php 
    em_options_input_text(__('RSS main title', 'dbem'), 'dbem_rss_main_title', __('The main title of your RSS events feed.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('RSS main description', 'dbem'), 'dbem_rss_main_description', __('The main description of your RSS events feed.', 'dbem'));
    em_options_input_text(__('RSS title format', 'dbem'), 'dbem_rss_title_format', __('The format of the title of each item in the events RSS feed.', 'dbem') . $events_placeholder_tip);
    em_options_input_text(__('RSS description format', 'dbem'), 'dbem_rss_description_format', __('The format of the description of each item in the events RSS feed.', 'dbem') . $events_placeholder_tip);
    echo $save_button;
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Maps and geotagging', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'> 
					<?php 
    $gmap_is_active = get_option('dbem_gmap_is_active');
    ?>
					<tr valign="top">
						<th scope="row"><?php 
    _e('Enable Google Maps integration?', 'dbem');
    ?>
</th>
						<td>
							<?php 
    _e('Yes');
    ?>
 <input id="dbem_gmap_is_active_yes" name="dbem_gmap_is_active" type="radio" value="1" <?php 
    echo $gmap_is_active ? "checked='checked'" : '';
    ?>
 />
							<?php 
    _e('No');
    ?>
 <input name="dbem_gmap_is_active" type="radio" value="0" <?php 
    echo $gmap_is_active ? '' : "checked='checked'";
    ?>
 /><br />
							<em><?php 
    _e('Check this option to enable Goggle Map integration.', 'dbem');
    ?>
</em>
						</td>
					</tr>
					<?php 
    em_options_textarea(__('Map text format', 'dbem'), 'dbem_map_text_format', __('The text format inside the map balloons.', 'dbem') . $events_placeholder_tip);
    echo $save_button;
    ?>
 
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Booking and Ticketing Options', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'> 
					<?php 
    em_options_radio_binary(__('Approval Required?', 'dbem'), 'dbem_bookings_approval', __('Bookings will not be confirmed until the event administrator approves it.', 'dbem'));
    em_options_select(__('Currency', 'dbem'), 'dbem_bookings_currency', em_get_currencies()->names, __('Choose your currency for displaying event pricing.', 'dbem'));
    em_options_radio_binary(__('Single ticket mode?', 'dbem'), 'dbem_bookings_tickets_single', __('In single ticket mode, users can only create one ticket per booking (and will not see options to add more tickets).', 'dbem'));
    em_options_radio_binary(__('Show unavailable tickets?', 'dbem'), 'dbem_bookings_tickets_show_unavailable', __('You can choose whether or not to show unavailable tickets to visitors.', 'dbem'));
    em_options_radio_binary(__('Reserved unconfirmed spaces?', 'dbem'), 'dbem_bookings_approval_reserved', __('By default, event spaces become unavailable once there are enough CONFIRMED bookings. To reserve spaces even if unnapproved, choose yes.', 'dbem'));
    em_options_radio_binary(__('Show multiple tickets if logged out?', 'dbem'), 'dbem_bookings_tickets_show_loggedout', __('If logged out, a user will be asked to register in order to book. However, we can show available tickets if you have more than one ticket.', 'dbem'));
    em_options_radio_binary(__('Allow overbooking when approving?', 'dbem'), 'dbem_bookings_approval_overbooking', __('If you get a lot of pending bookings and you decide to allow more bookings than spaces allow, setting this to yes will allow you to override the event space limit when manually approving.', 'dbem'));
    em_options_radio_binary(__('Allow guest bookings?', 'dbem'), 'dbem_bookings_anonymous', __('If enabled, guest visitors can supply an email address and a user account will automatically be created for them along with their booking. They will be also be able to log back in with that newly created account.', 'dbem'));
    echo $save_button;
    ?>
 
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
    __('Click to toggle');
    ?>
"><br /></div><h3 class='hndle'><span><?php 
    _e('Booking Email Templates', 'dbem');
    ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
    em_options_select(__('Default contact person', 'dbem'), 'dbem_default_contact_person', em_get_wp_users(), __('Select the default contact person. This user will be employed whenever a contact person is not explicitly specified for an event', 'dbem'));
    em_options_input_text(__('Email events admin?', 'dbem'), 'dbem_bookings_notify_admin', __("If you would like every event booking confirmation email sent to an administrator write their email here (leave blank to not send an email).", 'dbem'));
    em_options_radio_binary(__('Email contact person?', 'dbem'), 'dbem_bookings_contact_email', __('Check this option if you want the event contact to receive an email when someone books places. An email will be sent when a booking is first made (regardless if confirmed or pending)', 'dbem'));
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Contact person booking confirmed', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('An email will be sent to the event contact when a booking is first made.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Contact person email subject', 'dbem'), 'dbem_bookings_contact_email_subject', '');
    em_options_textarea(__('Contact person email', 'dbem'), 'dbem_bookings_contact_email_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Contact person booking cancelled', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('An email will be sent to the event contact if someone cancels their booking.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Contact person cancellation subject', 'dbem'), 'dbem_contactperson_email_cancelled_subject', '');
    em_options_textarea(__('Contact person cancellation email', 'dbem'), 'dbem_contactperson_email_cancelled_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Confirmed booking email', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This is sent when a person\'s booking is confirmed. This will be sent automatically if approvals are required and the booking is approved. If approvals are disabled, this is sent out when a user first submits their booking.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking confirmed email subject', 'dbem'), 'dbem_bookings_email_confirmed_subject', '');
    em_options_textarea(__('Booking confirmed email', 'dbem'), 'dbem_bookings_email_confirmed_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Pending booking email', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This will be sent to the person when they first submit their booking. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking pending email subject', 'dbem'), 'dbem_bookings_email_pending_subject', '');
    em_options_textarea(__('Booking pending email', 'dbem'), 'dbem_bookings_email_pending_body', '');
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Rejected booking email', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This will be sent automatically when a booking is rejected. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking rejected email subject', 'dbem'), 'dbem_bookings_email_rejected_subject', __("The subject of the email sent to the person making a booking that is awaiting administrator approval. Not relevant if bookings don't require approval.", 'dbem') . $bookings_placeholder_tip);
    em_options_textarea(__('Booking rejected email', 'dbem'), 'dbem_bookings_email_rejected_body', __('The body of the email which will be sent to the person if the booking is rejected. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip);
    echo $save_button;
    ?>
					<tr><td colspan='2'><h4><?php 
    _e('Booking cancelled', 'dbem');
    ?>
</h4></td></tr>
					<tr><td colspan='2'><?php 
    echo __('This will be sent when a user cancels their booking.', 'dbem') . $bookings_placeholder_tip;
    ?>
</td></tr>
					<?php 
    em_options_input_text(__('Booking cancelled email subject', 'dbem'), 'dbem_bookings_email_cancelled_subject', '');
    em_options_textarea(__('Booking cancelled email', 'dbem'), 'dbem_bookings_email_cancelled_body', '');
    ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<?php 
    if (!is_multisite() || is_multisite() && is_super_admin()) {
        ?>
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
        __('Click to toggle');
        ?>
"><br /></div><h3 class='hndle'><span><?php 
        _e('Email Settings', 'dbem');
        ?>
 <?php 
        echo $multisite_view;
        ?>
</span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
        em_options_input_text(__('Notification sender name', 'dbem'), 'dbem_mail_sender_name', __("Insert the display name of the notification sender.", 'dbem'));
        em_options_input_text(__('Notification sender address', 'dbem'), 'dbem_mail_sender_address', __("Insert the address of the notification sender.", 'dbem'));
        em_options_input_text('Mail sending port', 'dbem_rsvp_mail_port', __("The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port", 'dbem'));
        em_options_select(__('Mail sending method', 'dbem'), 'dbem_rsvp_mail_send_method', array('smtp' => 'SMTP', 'mail' => __('PHP mail function', 'dbem'), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail', 'wp_mail' => 'WP Mail'), __('Select the method to send email notification.', 'dbem'));
        em_options_radio_binary(__('Use SMTP authentication?', 'dbem'), 'dbem_rsvp_mail_SMTPAuth', __('SMTP authentication is often needed. If you use GMail, make sure to set this parameter to Yes', 'dbem'));
        em_options_input_text('SMTP host', 'dbem_smtp_host', __("The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'.", 'dbem'));
        em_options_input_text(__('SMTP username', 'dbem'), 'dbem_smtp_username', __("Insert the username to be used to access your SMTP server.", 'dbem'));
        em_options_input_password(__('SMTP password', 'dbem'), "dbem_smtp_password", __("Insert the password to be used to access your SMTP server", 'dbem'));
        echo $save_button;
        ?>
				</table>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox " >
			<div class="handlediv" title="<?php 
        __('Click to toggle');
        ?>
"><br /></div><h3 class='hndle'><span><?php 
        _e('Images size', 'dbem');
        ?>
 <?php 
        echo $multisite_view;
        ?>
 </span></h3>
			<div class="inside">
				<table class='form-table'>
					<?php 
        em_options_input_text(__('Maximum width (px)', 'dbem'), 'dbem_image_max_width', __('The maximum allowed width for images uploades', 'dbem'));
        em_options_input_text(__('Maximum height (px)', 'dbem'), 'dbem_image_max_height', __("The maximum allowed height for images uploaded, in pixels", 'dbem'));
        em_options_input_text(__('Maximum size (bytes)', 'dbem'), 'dbem_image_max_size', __("The maximum allowed size for images uploaded, in pixels", 'dbem'));
        echo $save_button;
        ?>
				</table> 
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
			
			<div  class="postbox" >
			<div class="handlediv" title="<?php 
        __('Click to toggle');
        ?>
"><br /></div><h3 class='hndle'><span><?php 
        _e('User Capabilities', 'dbem');
        ?>
 <?php 
        echo $multisite_view;
        ?>
</span></h3>
			<div class="inside">
	            <table class="form-table">
	            	<tr><td colspan="2">
	            		<strong><?php 
        _e('Warning: Changing these values may result in exposing previously hidden information to all users.');
        ?>
</strong><br />
	            	</td></tr>
					<?php 
        global $wp_roles;
        global $em_capabilities_array;
        ?>
	            	<tr><td colspan="2">
	            		<p><em><?php 
        _e('You can now give fine grained control with regards to what your users can do with events. Each user role can have perform different sets of actions.', 'dbem');
        ?>
</em></p>
			            <table class="em-caps-table" style="width:auto;" cellspacing="0" cellpadding="0">
							<thead>
								<tr>
									<td>&nbsp;</td>
									<?php 
        $odd = 0;
        $cap_docs = array('publish_events' => __('Users can publish events and skip any admin approval.', 'dbem'), 'edit_categories' => __('User can edit the global categories.', 'dbem'), 'delete_others_events' => __('User can delete other users events.', 'dbem'), 'delete_others_locations' => __('User can delete other users locations.', 'dbem'), 'edit_others_locations' => __('User can edit other users locations.', 'dbem'), 'manage_others_bookings' => __('User can manage other users individual bookings and event booking settings.', 'dbem'), 'edit_others_events' => __('User can edit other users events.', 'dbem'), 'delete_locations' => __('User can delete their own locations.', 'dbem'), 'delete_events' => __('User can delete their events.', 'dbem'), 'edit_locations' => __('User can edit their locations.', 'dbem'), 'manage_bookings' => __('User can use and manage bookings with their events.', 'dbem'), 'read_others_locations' => __('User can view other users locations, to make locations shared by all users allow all event user roles to view all locations.', 'dbem'), 'edit_recurrences' => __('User can create recurrent events.', 'dbem'), 'edit_events' => __('User can create and edit their events.', 'dbem'));
        foreach (array_keys($em_capabilities_array) as $capability) {
            ?>
<th class="<?php 
            echo $capability;
            ?>
 <?php 
            echo !is_int($odd / 2) ? 'odd' : '';
            ?>
">&nbsp;<a href="#" title="<?php 
            echo $cap_docs[$capability];
            ?>
">?</a></th><?php 
            $odd++;
        }
        ?>
								</tr>
							</thead>
							<tbody>
		            			<?php 
        foreach ($wp_roles->role_objects as $role) {
            ?>
			            		<tr>
			            			<td class="cap"><strong><?php 
            echo $role->name;
            ?>
</strong></td>
									<?php 
            $odd = 0;
            foreach (array_keys($em_capabilities_array) as $capability) {
                ?>
<td class="<?php 
                echo !is_int($odd / 2) ? 'odd' : '';
                ?>
"><input type="checkbox" name="em_capabilities[<?php 
                echo $role->name;
                ?>
][<?php 
                echo $capability;
                ?>
]" value="1" <?php 
                echo $role->has_cap($capability) ? 'checked="checked"' : '';
                ?>
 /></td><?php 
                $odd++;
            }
            ?>
			            		</tr>
					            <?php 
        }
        ?>
					        </tbody>
			            </table>
			        </td></tr>
			        <?php 
        echo $save_button;
        ?>
				</table>
			</div> <!-- . inside --> 
			</div> <!-- .postbox -->    
			<?php 
    }
    ?>

			<?php 
    /*
    <div  class="postbox " >
    <div class="handlediv" title="<?php __('Click to toggle'); ?>"><br /></div><h3 class='hndle'><span><?php _e ( 'Debug Modes', 'dbem' ); ?> </span></h3>
    <div class="inside">
    	<table class='form-table'>
    		<?php
    		em_options_radio_binary ( __( 'EM Debug Mode?', 'dbem' ), 'dbem_debug', __( 'Setting this to yes will display different content to admins for event pages and emails so you can see all the available placeholders and their values.', 'dbem' ) );
    		em_options_radio_binary ( __( 'WP Debug Mode?', 'dbem' ), 'dbem_wp_debug', __( 'This will turn WP_DEBUG mode on. Useful if you want to troubleshoot php errors without looking at your logs.', 'dbem' ) );
    		?>
    	</table>
    </div> <!-- . inside -->
    </div> <!-- .postbox -->
    */
    ?>
			
			<?php 
    do_action('em_options_page_footer');
    ?>

			<p class="submit">
				<input type="submit" id="dbem_options_submit" name="Submit" value="<?php 
    _e('Save Changes');
    ?>
" />
				<input type="hidden" name="em-submitted" value="1" />
			</p>  
			
			</div> <!-- .metabox-sortables -->
			</div> <!-- .postbox-container -->
			
			</div> <!-- .metabox-holder -->	
		</form>
	</div>
	<?php 
}
Example #10
0
</p>
				<p><?php 
_e('<strong>Warning : </strong> Various features afforded to users with an account will not be available, e.g. viewing bookings. Once you enable this and select a user, modifying these values will prevent older non-user bookings from displaying the correct information.', 'dbem');
?>
</p>
			</td></tr>
			<?php 
em_options_radio_binary(__('Enable No-User Booking Mode?', 'dbem'), 'dbem_bookings_registration_disable', __('This disables user registrations for bookings.', 'dbem'));
em_options_radio_binary(__('Allow bookings with registered emails?', 'dbem'), 'dbem_bookings_registration_disable_user_emails', __('By default, if a guest tries to book an event using the email of a user account on your site they will be asked to log in, selecting yes will bypass this security measure.', 'dbem') . '<br />' . __('<strong>Warning : </strong> By enabling this, registered users will not be able to see bookings they make as guests in their "My Bookings" page.', 'dbem'));
$current_user = array();
if (get_option('dbem_bookings_registration_user')) {
    $user = get_user_by('id', get_option('dbem_bookings_registration_user'));
    $current_user[$user->ID] = $user->display_name;
}
if (defined('EM_OPTIMIZE_SETTINGS_PAGE_USERS') && EM_OPTIMIZE_SETTINGS_PAGE_USERS) {
    em_options_input_text(__('Assign bookings to', 'dbem'), 'dbem_bookings_registration_user', __('Please add a User ID.', 'dbem') . ' ' . __('Choose a parent user to assign bookings to. People making their booking will be unaware of this and will never have access to those user details. This should be a subscriber user you do not use to log in with yourself.', 'dbem'));
} else {
    em_options_select(__('Assign bookings to', 'dbem'), 'dbem_bookings_registration_user', em_get_wp_users(array('role' => 'subscriber'), $current_user), __('Choose a parent user to assign bookings to. People making their booking will be unaware of this and will never have access to those user details. This should be a subscriber user you do not use to log in with yourself.', 'dbem'));
}
echo $save_button;
?>

		</table>
	</div> <!-- . inside -->
	</div> <!-- .postbox -->
	
	<?php 
do_action('em_options_page_footer_bookings');
?>

	
    public static function emails()
    {
        global $save_button;
        $bookings_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;page=events-manager-help#booking-placeholders">' . esc_html__emp('Booking Related Placeholders', 'dbem') . '</a>';
        $bookings_placeholder_tip = " " . sprintf(esc_html__emp('This accepts %s placeholders.', 'dbem'), $bookings_placeholders);
        ?>
		<div  class="postbox " id="em-opt-multiple-booking-emails" >
		<div class="handlediv" title="<?php 
        esc_attr_e_emp('Click to toggle', 'dbem');
        ?>
"><br /></div><h3><span><?php 
        _e('Multiple Booking Email Templates', 'em-pro');
        ?>
 </span></h3>
		<div class="inside">
		    <div class="em-boxheader">
                <p><?php 
        echo sprintf(__('When users make a booking in Multiple Bookings Mode or cancels their booking, these emails get sent to the attendee and administrator emails you assign in the %s section above.', 'em-pro'), '<code>' . esc_html__emp('Booking Email Templates', 'dbem') . '</code>');
        ?>
</p>
                <p><?php 
        _e('When administrators modify a set of multiple bookings rather than individual events, these templates will be used to notify the attendee.', 'em-pro');
        ?>
</p>
            </div>
			<table class='form-table'>
				<?php 
        $email_subject_tip = esc_html__emp('You can disable this email by leaving the subject blank.', 'dbem');
        em_options_radio_binary(__('Email event owners?', 'em-pro'), 'dbem_multiple_bookings_contact_email', sprintf(__('If enabled, additional emails will be sent to administrators and event owners for EVERY event booked based on the above %s settings.', 'em-pro'), '<code>' . esc_html__emp('Booking Email Templates', 'dbem') . '</code>'));
        ?>
				<tr class="em-header"><td colspan='2'><h4><?php 
        esc_html_e_emp('Event Admin/Owner Emails', 'dbem');
        ?>
</h4></td></tr>
				<tbody class="em-subsection">
    				<tr class="em-subheader"><td colspan='2'>
    					<h5><?php 
        esc_html_e_emp('Contact person booking confirmed', 'dbem');
        ?>
</h5>
    					<em><?php 
        esc_html_e_emp('An email will be sent to the event contact when a booking is first made.', 'dbem') . $bookings_placeholder_tip;
        ?>
</em>
    				</td></tr>
    				<?php 
        em_options_input_text(esc_html__emp('Contact person email subject', 'dbem'), 'dbem_multiple_bookings_contact_email_subject', $email_subject_tip);
        em_options_textarea(esc_html__emp('Contact person email', 'dbem'), 'dbem_multiple_bookings_contact_email_body', '');
        ?>
    				<tr class="em-subheader"><td colspan='2'>
    					<h5><?php 
        esc_html_e_emp('Contact person booking cancelled', 'dbem');
        ?>
</h5>
    					<em><?php 
        esc_html_e_emp('An email will be sent to the event contact if someone cancels their booking.', 'dbem') . $bookings_placeholder_tip;
        ?>
</em>
    				</td></tr>
    				<?php 
        em_options_input_text(esc_html__emp('Contact person cancellation subject', 'dbem'), 'dbem_multiple_bookings_contact_email_cancelled_subject', $email_subject_tip);
        em_options_textarea(esc_html__emp('Contact person cancellation email', 'dbem'), 'dbem_multiple_bookings_contact_email_cancelled_body', '');
        ?>
				</tbody>
				<tbody class="em-subsection">
    				<tr class="em-header"><td colspan='2'><h4><?php 
        esc_html_e_emp('Booked User Emails', 'dbem');
        ?>
</h4></td></tr>
    				<tr class="em-subheader"><td colspan='2'>
    					<h5><?php 
        esc_html_e_emp('Confirmed booking email', 'dbem');
        ?>
</h5>
    					<em><?php 
        esc_html_e_emp('This is sent when a person\'s booking is confirmed. This will be sent automatically if approvals are required and the booking is approved. If approvals are disabled, this is sent out when a user first submits their booking.', 'dbem') . $bookings_placeholder_tip;
        ?>
</em>
    				</td></tr>
    				<?php 
        em_options_input_text(esc_html__emp('Booking confirmed email subject', 'dbem'), 'dbem_multiple_bookings_email_confirmed_subject', $email_subject_tip);
        em_options_textarea(esc_html__emp('Booking confirmed email', 'dbem'), 'dbem_multiple_bookings_email_confirmed_body', '');
        ?>
    				<tr class="em-subheader"><td colspan='2'>
    					<h5><?php 
        esc_html_e_emp('Pending booking email', 'dbem');
        ?>
</h5>
    					<em><?php 
        esc_html_e_emp('This will be sent to the person when they first submit their booking. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip;
        ?>
</em>
    				</td></tr>
    				<?php 
        em_options_input_text(esc_html__emp('Booking pending email subject', 'dbem'), 'dbem_multiple_bookings_email_pending_subject', $email_subject_tip);
        em_options_textarea(esc_html__emp('Booking pending email', 'dbem'), 'dbem_multiple_bookings_email_pending_body', '');
        ?>
    				<tr class="em-subheader"><td colspan='2'>
    					<h5><?php 
        esc_html_e_emp('Rejected booking email', 'dbem');
        ?>
</h5>
    					<em><?php 
        esc_html_e_emp('This will be sent automatically when a booking is rejected. Not relevant if bookings don\'t require approval.', 'dbem') . $bookings_placeholder_tip;
        ?>
</em>
    				</td></tr>
    				<?php 
        em_options_input_text(esc_html__emp('Booking rejected email subject', 'dbem'), 'dbem_multiple_bookings_email_rejected_subject', $email_subject_tip);
        em_options_textarea(esc_html__emp('Booking rejected email', 'dbem'), 'dbem_multiple_bookings_email_rejected_body', '');
        ?>
    				<tr class="em-subheader"><td colspan='2'>
    					<h5><?php 
        esc_html_e_emp('Booking cancelled', 'dbem');
        ?>
</h5>
    					<em><?php 
        esc_html_e_emp('This will be sent when a user cancels their booking.', 'dbem') . $bookings_placeholder_tip;
        ?>
</em>
    				</td></tr>
    				<?php 
        em_options_input_text(esc_html__emp('Booking cancelled email subject', 'dbem'), 'dbem_multiple_bookings_email_cancelled_subject', $email_subject_tip);
        em_options_textarea(esc_html__emp('Booking cancelled email', 'dbem'), 'dbem_multiple_bookings_email_cancelled_body', '');
        ?>
    			</tbody>
				<?php 
        echo $save_button;
        ?>
			</table>
		</div> <!-- . inside -->
		</div> <!-- .postbox -->
		<?php 
    }
Example #12
0
/**
 * Displays network-related options in the network admin section
 * @uses em_options_save() to save settings 
 */
function em_ms_admin_options_page()
{
    global $wpdb, $EM_Notices;
    //Check for uninstall/reset request
    if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'uninstall') {
        em_admin_options_uninstall_page();
        return;
    }
    if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'reset') {
        em_admin_options_reset_page();
        return;
    }
    //TODO place all options into an array
    $events_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;events-manager-help#event-placeholders">' . __('Event Related Placeholders', 'dbem') . '</a>';
    $locations_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;events-manager-help#location-placeholders">' . __('Location Related Placeholders', 'dbem') . '</a>';
    $bookings_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;events-manager-help#booking-placeholders">' . __('Booking Related Placeholders', 'dbem') . '</a>';
    $categories_placeholders = '<a href="' . EM_ADMIN_URL . '&amp;events-manager-help#category-placeholders">' . __('Category Related Placeholders', 'dbem') . '</a>';
    $events_placeholder_tip = " " . sprintf(__('This accepts %s and %s placeholders.', 'dbem'), $events_placeholders, $locations_placeholders);
    $locations_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $locations_placeholders);
    $categories_placeholder_tip = " " . sprintf(__('This accepts %s placeholders.', 'dbem'), $categories_placeholders);
    $bookings_placeholder_tip = " " . sprintf(__('This accepts %s, %s and %s placeholders.', 'dbem'), $bookings_placeholders, $events_placeholders, $locations_placeholders);
    $save_button = '<tr><th>&nbsp;</th><td><p class="submit" style="margin:0px; padding:0px; text-align:right;"><input type="submit" id="dbem_options_submit" name="Submit" value="' . __('Save Changes', 'dbem') . ' (' . __('All', 'dbem') . ')" /></p></ts></td></tr>';
    //Do some multisite checking here for reuse
    ?>
	
	<script type="text/javascript" charset="utf-8">
		jQuery(document).ready(function($){
			var close_text = '<?php 
    _e('Collapse All', 'dbem');
    ?>
';
			var open_text = '<?php 
    _e('Expand All', 'dbem');
    ?>
';
			var open_close = $('<a href="#" style="display:block; float:right; clear:right; margin:10px;">'+open_text+'</a>');
			$('#em-options-title').before(open_close);
			open_close.click( function(e){
				e.preventDefault();
				if($(this).text() == close_text){
					$(".postbox").addClass('closed');
					$(this).text(open_text);
				}else{
					$(".postbox").removeClass('closed');
					$(this).text(close_text);
				} 
			});
			$(".postbox > h3").click(function(){ $(this).parent().toggleClass('closed'); });
			$(".postbox").addClass('closed');
			//MS Mode selection hiders 
			$('input[name="dbem_ms_global_table"]').change(function(){ //global
				if( $('input:radio[name="dbem_ms_global_table"]:checked').val() == 1 ){
					$("tbody.em-global-options").show();
					$('input:radio[name="dbem_ms_mainblog_locations"]:checked').trigger('change');
				}else{
					$("tbody.em-global-options").hide();					
				}
			}).first().trigger('change');
			//events
			$('input[name="dbem_ms_global_events"]').change(function(){
				if( $('input:radio[name="dbem_ms_global_events"]:checked').val() == 1 ){
					$("tr#dbem_ms_global_events_links_row").show();
					$('input:radio[name="dbem_ms_global_events_links"]:checked').trigger('change');
				}else{
					$("tr#dbem_ms_global_events_links_row, tr#dbem_ms_events_slug_row").hide();					
				}
			}).first().trigger('change');
			$('input[name="dbem_ms_global_events_links"]').change(function(){
				if( $('input:radio[name="dbem_ms_global_events_links"]:checked').val() == 1 ){
					$("tr#dbem_ms_events_slug_row").hide();	
				}else{				
					$("tr#dbem_ms_events_slug_row").show();
				}
			}).first().trigger('change');
			//locations
			$('input[name="dbem_ms_mainblog_locations"]').change(function(){
				if( $('input:radio[name="dbem_ms_mainblog_locations"]:checked').val() == 1 ){
					$("tbody.em-global-locations").hide();
				}else{
					$("tbody.em-global-locations").show();					
				}
			}).first().trigger('change');
			$('input[name="dbem_ms_global_locations"]').change(function(){
				if( $('input:radio[name="dbem_ms_global_locations"]:checked').val() == 1 ){
					$("tr#dbem_ms_global_locations_links_row").show();
					$('input:radio[name="dbem_ms_global_locations_links"]:checked').trigger('change');
				}else{
					$("tr#dbem_ms_global_locations_links_row, tr#dbem_ms_locations_slug_row").hide();					
				}
			}).first().trigger('change');
			$('input[name="dbem_ms_global_locations_links"]').change(function(){
				if( $('input:radio[name="dbem_ms_global_locations_links"]:checked').val() == 1 ){
					$("tr#dbem_ms_locations_slug_row").hide();	
				}else{
					$("tr#dbem_ms_locations_slug_row").show();				
				}
			});			
		});
	</script>
	<style type="text/css">.postbox h3 { cursor:pointer; }</style>
	<div class="wrap">		
		<div id='icon-options-general' class='icon32'><br /></div>
		<h2 class="nav-tab-wrapper">
			<a href="#" id="em-menu-general" class="nav-tab nav-tab-active"><?php 
    _e('General', 'dbem');
    ?>
</a>
		</h2>
		<h3 id="em-options-title"><?php 
    _e('Event Manager Options', 'dbem');
    ?>
</h3>
		<?php 
    echo $EM_Notices;
    ?>
		<form id="em-options-form" method="post" action="">
			<div class="metabox-holder">         
			<!-- // TODO Move style in css -->
			<div class='postbox-container' style='width: 99.5%'>
			<div id="">
		  
		  	<div class="em-menu-general em-menu-group">
				<div  class="postbox " >
					<div class="handlediv" title="<?php 
    __('Click to toggle', 'dbem');
    ?>
"><br /></div><h3><span><?php 
    _e('Multi Site Options', 'dbem');
    ?>
</span></h3>
					<div class="inside">
			            <table class="form-table">
							<?php 
    em_options_radio_binary(__('Enable global tables mode?', 'dbem'), 'dbem_ms_global_table', __('Setting this to yes will make all events save in the main site event tables (EM must also be activated). This allows you to share events across different blogs, such as showing events in your network whilst allowing users to display and manage their events within their own blog. Bear in mind that activating this will mean old events created on the sub-blogs will not be accessible anymore, and if you switch back they will be but new events created during global events mode will only remain on the main site.', 'dbem'));
    ?>
							<tbody class="em-global-options">
							<?php 
    global $current_site;
    $global_slug_tip = __('%s belonging to other sub-sites will have an extra slug preppended to it so that your main site can differentiate between its own %s and those belonging to other sites in your network.');
    $global_link_tip = __('When displaying global %s on the main site you have the option of users viewing the %s details on the main site or being directed to the sub-site.', 'dbem');
    $global_post_tip = __('Displays %s from all sites on the network by default. You can still restrict %s by blog using shortcodes and template tags coupled with the <code>blog</code> attribute. Requires global tables to be turned on.', 'dbem');
    $global_link_tip2 = __('You <strong>must</strong> have assigned a %s page in your <a href="%s">main blog settings</a> for this to work.');
    $options_page_link = get_admin_url($current_site->blog_id, 'edit.php?post_type=event&page=events-manager-options#pages');
    ?>
<tr><td><strong><?php 
    echo sprintf(__('%s Options', 'dbem'), __('Event', 'dbem'));
    ?>
</strong></td></tr><?php 
    em_options_radio_binary(sprintf(__('Display global events on main blog?', 'dbem'), __('events', 'dbem')), 'dbem_ms_global_events', sprintf($global_post_tip, __('events', 'dbem'), __('events', 'dbem')));
    em_options_radio_binary(sprintf(__('Link sub-site %s directly to sub-site?', 'dbem'), __('events', 'dbem')), 'dbem_ms_global_events_links', sprintf($global_link_tip, __('events', 'dbem'), __('event', 'dbem')) . sprintf($global_link_tip2, __('event', 'dbem'), $options_page_link));
    em_options_input_text(sprintf(__('Global %s slug', 'dbem'), __('event', 'dbem')), 'dbem_ms_events_slug', sprintf($global_slug_tip, __('Events', 'dbem'), __('events', 'dbem')) . __('Example:', 'dbem') . '<code>http://yoursite.com/events/<strong>event</strong>/subsite-event-slug/', EM_EVENT_SLUG);
    ?>
<tr><td><strong><?php 
    echo sprintf(__('%s Options', 'dbem'), __('Location', 'dbem'));
    ?>
</strong></td></tr><?php 
    em_options_radio_binary(sprintf(__('Locations on main blog?', 'dbem'), __('locations', 'dbem')), 'dbem_ms_mainblog_locations', __('If you would prefer all your locations to belong to your main blog, users in sub-sites will still be able to create locations, but the actual locations are created and reside in the main blog.', 'dbem'));
    ?>
							</tbody>
							<tbody class="em-global-options em-global-locations">
							<?php 
    em_options_radio_binary(sprintf(__('Display global %s on main blog?', 'dbem'), __('locations', 'dbem')), 'dbem_ms_global_locations', sprintf($global_post_tip, __('locations', 'dbem'), __('locations', 'dbem')));
    em_options_radio_binary(sprintf(__('Link sub-site %s directly to sub-site?', 'dbem'), __('locations', 'dbem')), 'dbem_ms_global_locations_links', sprintf($global_link_tip, __('locations', 'dbem'), __('location', 'dbem')) . sprintf($global_link_tip2, __('location', 'dbem'), $options_page_link));
    em_options_input_text(sprintf(__('Global %s slug', 'dbem'), __('event', 'dbem')), 'dbem_ms_locations_slug', sprintf($global_slug_tip, __('Locations', 'dbem'), __('locations', 'dbem')) . __('Example:', 'dbem') . '<code>http://yoursite.com/locations/<strong>location</strong>/subsite-location-slug/', EM_LOCATION_SLUG);
    ?>
							</tbody>
							<?php 
    echo $save_button;
    ?>
						</table>
						    
					</div> <!-- . inside --> 
				</div> <!-- .postbox --> 
				
				<?php 
    //including shared MS/non-MS boxes
    em_admin_option_box_caps();
    em_admin_option_box_image_sizes();
    em_admin_option_box_email();
    em_admin_option_box_uninstall();
    ?>
				
				<?php 
    do_action('em_ms_options_page_footer');
    ?>
			</div> <!-- .em-menu-general -->
			
		  	<div class="em-menu-pages em-menu-group" style="display:none;">				
		  	
			</div> <!-- .em-menu-pages -->

			<p class="submit">
				<input type="submit" id="dbem_options_submit" name="Submit" value="<?php 
    _e('Save Changes');
    ?>
" />
				<input type="hidden" name="em-submitted" value="1" />
				<input type="hidden" name="_wpnonce" value="<?php 
    echo wp_create_nonce('events-manager-options');
    ?>
" />
			</p>  
			
			</div> <!-- .metabox-sortables -->
			</div> <!-- .postbox-container -->
			
			</div> <!-- .metabox-holder -->	
		</form>
	</div>
	<?php 
}
        /**
         * Outputs custom Migs setting fields in the settings page 
         */
        function mysettings()
        {
            global $EM_options;
            ?>
		<table class="form-table">
		<tbody>
		  <?php 
            em_options_input_text(esc_html__('Success Message', 'em-pro'), 'em_' . $this->gateway . '_booking_feedback', esc_html__('The message that is shown to a user when a booking is successful whilst being redirected to Migs for payment.', 'em-pro'));
            ?>
		  <?php 
            em_options_input_text(esc_html__('Success Free Message', 'em-pro'), 'em_' . $this->gateway . '_booking_feedback_free', esc_html__('If some cases if you allow a free ticket (e.g. pay at gate) as well as paid tickets, this message will be shown and the user will not be redirected to Migs.', 'em-pro'));
            ?>
		  <?php 
            em_options_input_text(esc_html__('Thank You Message', 'em-pro'), 'em_' . $this->gateway . '_booking_feedback_completed', esc_html__('If you choose to return users to the default Events Manager thank you page after a user has paid on Migs, you can customize the thank you message here.', 'em-pro'));
            ?>
		</tbody>
		</table>
		
		<h3><?php 
            echo sprintf(__('%s Options', 'em-pro'), 'Migs');
            ?>
</h3>
		<p><strong><?php 
            _e('Important:', 'em-pro');
            ?>
</strong> <?php 
            echo __('In order to connect Migs with your site, you need to enable IPN on your account.');
            echo " " . sprintf(__('Your return url is %s', 'em-pro'), '<code>' . $this->get_payment_return_url() . '</code>');
            ?>
</p> 
		<p><?php 
            echo sprintf(__('Please visit the <a href="%s">documentation</a> for further instructions.', 'em-pro'), 'http://wp-events-plugin.com/documentation/');
            ?>
</p>
		<table class="form-table">
		<tbody>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Migs Merchant ID', 'em-pro');
            ?>
</th>
				  <td><input type="text" name="em_migs_em" value="<?php 
            esc_attr_e(get_option('em_' . $this->gateway . "_merchantID"));
            ?>
" />
				  <br />
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Migs Access Code', 'em-pro');
            ?>
</th>
				  <td><input type="text" name="em_migs_ac" value="<?php 
            esc_attr_e(get_option('em_' . $this->gateway . "_accessCode"));
            ?>
" />
				  <br />
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Migs Secure Hash', 'em-pro');
            ?>
</th>
				  <td><input type="text" name="em_migs_sh" value="<?php 
            esc_attr_e(get_option('em_' . $this->gateway . "_secureHash"));
            ?>
" />
				  <br />
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Migs Currency', 'em-pro');
            ?>
</th>
			  <td><?php 
            echo esc_html(get_option('dbem_bookings_currency', 'LKR'));
            ?>
<br /><i><?php 
            echo sprintf(__('Set your currency in the <a href="%s">settings</a> page.', 'em-pro'), EM_ADMIN_URL . '&amp;page=events-manager-options#bookings');
            ?>
</i></td>
		  </tr>
		  
		  <?php 
            em_options_radio_binary(__('Include Taxes In Itemized Prices', 'em-pro'), 'em_' . $this->gateway . '_inc_tax', __('If set to yes, taxes are not included in individual item prices and total tax is shown at the bottom. If set to no, taxes are included within the individual prices.', 'em-pro') . ' ' . __('We strongly recommend setting this to No.', 'em-pro') . ' <a href="http://wp-events-plugin.com/documentation/events-with-migs/migs-displaying-taxes/">' . __('Click here for more information.', 'em-pro')) . '</a>';
            ?>
		  
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Migs Language', 'em-pro');
            ?>
</th>
			  <td>
			  	<select name="em_migs_lc">
			  		<option value=""><?php 
            _e('Default', 'em-pro');
            ?>
</option>
				  <?php 
            $ccodes = em_get_countries();
            $migs_lc = get_option('em_' . $this->gateway . '_lc', 'US');
            foreach ($ccodes as $key => $value) {
                if ($migs_lc == $key) {
                    echo '<option value="' . $key . '" selected="selected">' . $value . '</option>';
                } else {
                    echo '<option value="' . $key . '">' . $value . '</option>';
                }
            }
            ?>
				  
				  </select>
				  <br />
				  <i><?php 
            _e('Migs allows you to select a default language users will see. This is also determined by Migs which detects the locale of the users browser. The default would be US.', 'em-pro');
            ?>
</i>
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Migs Mode', 'em-pro');
            ?>
</th>
			  <td>
				  <select name="em_migs_status">
					  <option value="live" <?php 
            if (get_option('em_' . $this->gateway . "_status") == 'live') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            _e('Live Site', 'em-pro');
            ?>
</option>
					  <option value="test" <?php 
            if (get_option('em_' . $this->gateway . "_status") == 'test') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            _e('Test Mode (Sandbox)', 'em-pro');
            ?>
</option>
				  </select>
				  <br />
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Return URL', 'em-pro');
            ?>
</th>
			  <td>
			  	<input type="text" name="em_migs_return" value="<?php 
            esc_attr_e(get_option('em_' . $this->gateway . "_return"));
            ?>
" style='width: 40em;' /><br />
			  	<em><?php 
            _e('Once a payment is completed, users will be offered a link to this URL which confirms to the user that a payment is made. If you would to customize the thank you page, create a new page and add the link here. For automatic redirect, you need to turn auto-return on in your Migs settings.', 'em-pro');
            ?>
</em>
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Cancel URL', 'em-pro');
            ?>
</th>
			  <td>
			  	<input type="text" name="em_migs_cancel_return" value="<?php 
            esc_attr_e(get_option('em_' . $this->gateway . "_cancel_return"));
            ?>
" style='width: 40em;' /><br />
			  	<em><?php 
            _e('Whilst paying on Migs, if a user cancels, they will be redirected to this page.', 'em-pro');
            ?>
</em>
			  </td>
		  </tr>
		  <!--<tr valign="top">
			  <th scope="row"><?php 
            //_e('Migs Page Logo', 'em-pro')
            ?>
</th>
			  <td>
			  	<input type="text" name="em_migs_format_logo" value="<?php 
            //esc_attr_e(get_option('em_'. $this->gateway . "_format_logo" ));
            ?>
" style='width: 40em;' /><br />
			  	<em><?php 
            //_e('Add your logo to the Migs payment page. It\'s highly recommended you link to a https:// address.', 'em-pro');
            ?>
</em>
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            //_e('Border Color', 'em-pro')
            ?>
</th>
			  <td>
			  	<input type="text" name="em_migs_format_border" value="<?php 
            //esc_attr_e(get_option('em_'. $this->gateway . "_format_border" ));
            ?>
" style='width: 40em;' /><br />
			  	<em><?php 
            //_e('Provide a hex value color to change the color from the default blue to another color (e.g. #CCAAAA).','em-pro');
            ?>
</em>
			  </td>
		  </tr>-->
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Delete Bookings Pending Payment', 'em-pro');
            ?>
</th>
			  <td>
			  	<input type="text" name="em_migs_booking_timeout" style="width:50px;" value="<?php 
            esc_attr_e(get_option('em_' . $this->gateway . "_booking_timeout"));
            ?>
" style='width: 40em;' /> <?php 
            _e('minutes', 'em-pro');
            ?>
<br />
			  	<em><?php 
            _e('Once a booking is started and the user is taken to Migs, Events Manager stores a booking record in the database to identify the incoming payment. These spaces may be considered reserved if you enable <em>Reserved unconfirmed spaces?</em> in your Events &gt; Settings page. If you would like these bookings to expire after x minutes, please enter a value above (note that bookings will be deleted, and any late payments will need to be refunded manually via Migs).', 'em-pro');
            ?>
</em>
			  </td>
		  </tr>
		  <tr valign="top">
			  <th scope="row"><?php 
            _e('Manually approve completed transactions?', 'em-pro');
            ?>
</th>
			  <td>
			  	<input type="checkbox" name="em_migs_manual_approval" value="1" <?php 
            echo get_option('em_' . $this->gateway . "_manual_approval") ? 'checked="checked"' : '';
            ?>
 /><br />
			  	<em><?php 
            _e('By default, when someone pays for a booking, it gets automatically approved once the payment is confirmed. If you would like to manually verify and approve bookings, tick this box.', 'em-pro');
            ?>
</em><br />
			  	<em><?php 
            echo sprintf(__('Approvals must also be required for all bookings in your <a href="%s">settings</a> for this to work properly.', 'em-pro'), EM_ADMIN_URL . '&amp;page=events-manager-options');
            ?>
</em>
			  </td>
		  </tr>
		</tbody>
		</table>
		<?php 
        }
Example #14
0
/**
 * Meta options box for email settings. Shared in both MS and Normal options page, hence it's own function 
 */
function em_admin_option_box_email()
{
    global $save_button;
    ?>
	<div  class="postbox " >
	<div class="handlediv" title="<?php 
    __('Click to toggle', 'dbem');
    ?>
"><br /></div><h3><span><?php 
    _e('Email Settings', 'dbem');
    ?>
</span></h3>
	<div class="inside">
		<table class='form-table'>
			<?php 
    em_options_input_text(__('Notification sender name', 'dbem'), 'dbem_mail_sender_name', __("Insert the display name of the notification sender.", 'dbem'));
    em_options_input_text(__('Notification sender address', 'dbem'), 'dbem_mail_sender_address', __("Insert the address of the notification sender.", 'dbem'));
    em_options_select(__('Mail sending method', 'dbem'), 'dbem_rsvp_mail_send_method', array('smtp' => 'SMTP', 'mail' => __('PHP mail function', 'dbem'), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail', 'wp_mail' => 'WP Mail'), __('Select the method to send email notification.', 'dbem'));
    em_options_radio_binary(__('Send HTML Emails?', 'dbem'), 'dbem_smtp_html', __('If set to yes, your emails will be sent in HTML format, otherwise plaintext.', 'dbem') . ' ' . __('Depending on server settings, some sending methods may ignore this settings.', 'dbem'));
    ?>
			<tbody class="em-email-settings-smtp">
				<?php 
    em_options_input_text('Mail sending port', 'dbem_rsvp_mail_port', __("The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port", 'dbem'));
    em_options_radio_binary(__('Use SMTP authentication?', 'dbem'), 'dbem_rsvp_mail_SMTPAuth', __('SMTP authentication is often needed. If you use GMail, make sure to set this parameter to Yes', 'dbem'));
    em_options_input_text('SMTP host', 'dbem_smtp_host', __("The SMTP host. Usually it corresponds to 'localhost'. If you use GMail, set this value to 'ssl://smtp.gmail.com:465'.", 'dbem'));
    em_options_input_text(__('SMTP username', 'dbem'), 'dbem_smtp_username', __("Insert the username to be used to access your SMTP server.", 'dbem'));
    em_options_input_password(__('SMTP password', 'dbem'), "dbem_smtp_password", __("Insert the password to be used to access your SMTP server", 'dbem'));
    ?>
			</tbody>
			<?php 
    echo $save_button;
    ?>
		</table>
		<script type="text/javascript" charset="utf-8">
			jQuery(document).ready(function($){
				$('#dbem_rsvp_mail_send_method_row select').change(function(){
					el = $(this);
					if( el.find(':selected').val() == 'smtp' ){
						$('.em-email-settings-smtp').show();
					}else{
						$('.em-email-settings-smtp').hide();
					}
				}).trigger('change');
			});
		</script>
	</div> <!-- . inside -->
	</div> <!-- .postbox --> 
	<?php 
}
    /**
     * Generates meta box for settings page 
     */
    public static function reminder_options()
    {
        global $save_button;
        ?>
		<div  class="postbox " id="em-opt-email-reminders" >
		<div class="handlediv" title="<?php 
        esc_attr_e_emp('Click to toggle', 'dbem');
        ?>
"><br /></div><h3><?php 
        _e('Event Email Reminders', 'em-pro');
        ?>
</h3>
		<div class="inside">
			<table class='form-table'>
				<tr class="em-boxheader"><td colspan='2'>
					<p>
						<?php 
        _e('Events Manager can send people that booked a place at your events a reminder email before it starts.', 'em-pro');
        ?>
						<?php 
        echo sprintf(__('We use <a href="%s">WP Cron</a> for scheduling checks for future events, which relies on site visits to trigger these tasks to run. If you have low levels of site traffic, this may not happen frequently enough, so you may want to consider forcing WP-Cron to run every few minutes. For more information, <a href="%s">read this tutorial</a> on setting up WP Cron.', 'em-pro'), 'http://codex.wordpress.org/Category:WP-Cron_Functions', 'http://code.tutsplus.com/articles/insights-into-wp-cron-an-introduction-to-scheduling-tasks-in-wordpress--wp-23119');
        ?>
					</p>
					<p><?php 
        _e('<strong>Important!</strong>, you should use SMTP as your email setup if you are sending automated emails in this way for optimal performance. Other methods are not suited to sending mass emails.', 'em-pro');
        ?>
				</td></tr>
				<?php 
        em_options_radio_binary(sprintf(_x('Enable %s?', 'Enable a feature in settings page', 'em-pro'), __('Event Email Reminders', 'em-pro')), 'dbem_cron_emails', '');
        em_options_input_text(__('Days before reminder', 'em-pro'), 'dbem_emp_emails_reminder_days', __('You can choose to send people attending your event x days before the event starts. Minimum is one day.', 'em-pro'), 1);
        em_options_radio_binary(__('Attach ical invite?', 'em-pro'), 'dbem_emp_emails_reminder_ical', __('If using SMTP in your email settings. You can automatically attach an ical file which some email clients (e.g. gmail) will render as an invitation they can add to their calendar.', 'em-pro'));
        $days = get_option('dbem_emp_emails_reminder_days', 1);
        ?>
				<tr>
					<th><?php 
        _e('WP Cron Time', 'em-pro');
        ?>
</th>
					<td>
						<input class="em-time-input em-time-start" type="text" name="dbem_emp_emails_reminder_time" value="<?php 
        echo get_option('dbem_emp_emails_reminder_time', '12:00 AM');
        ?>
" /><br />
						<em><?php 
        _e('Every day Events Manager automatically checks upcoming events in order to generate emails. You can choose at what time of day to run this check, if your site has a lot of traffic, it may help having this run at times of lower server loads.', 'em-pro');
        ?>
</em>
					</td>
				</tr>
				<?php 
        em_options_input_text(__('Reminder subject', 'em-pro'), 'dbem_emp_emails_reminder_subject', '');
        em_options_textarea(__('Approved email', 'em-pro'), 'dbem_emp_emails_reminder_body', '');
        ?>
				<?php 
        echo $save_button;
        ?>
			</table>
		</div> <!-- . inside -->
		</div> <!-- .postbox -->
	    <?php 
    }
    public static function admin_options()
    {
        global $save_button;
        $api = !self::check_api_key();
        if (is_super_admin()) {
            ?>
			<a name="pro-api"></a>
			<div  class="postbox " id="em-opt-pro-key" >
			<div class="handlediv" title="<?php 
            esc_attr_e_emp('Click to toggle', 'dbem');
            ?>
"><br /></div><h3 class='hndle'><span><?php 
            _e('Pro Membership Key', 'em-pro');
            ?>
 </span></h3>
			<div class="inside">
				<table class='form-table' <?php 
            echo $api ? 'style="background-color:#ffece8;"' : '';
            ?>
>
					<?php 
            em_options_input_text(__('Pro Member Key', 'em-pro'), 'dbem_pro_api_key', sprintf(__("Insert your Pro Member Key to access automatic updates you can get your membership key from <a href=\"%s\">here</a>.", 'em-pro'), 'http://eventsmanagerpro.com/account/'));
            ?>
					<?php 
            if (!self::check_api_key() && get_option('dbem_pro_api_key') != '') {
                ?>
						<?php 
                $response = get_site_transient('dbem_pro_api_key_check');
                if ($api) {
                    ?>
							<tr>
								<td colspan="2">
									<b>Returned Data:</b> 
									<?php 
                    print_r($response);
                    ?>
								</td>
							</tr>
							<?php 
                }
                ?>
					<?php 
            }
            ?>
				</table>
				<?php 
            echo $save_button;
            ?>
			</div> <!-- . inside -->
			</div> <!-- .postbox -->
		<?php 
        }
    }