Example #1
0
function eme_options_page() {
   global $plugin_page;
   if ($plugin_page == 'eme-options') {
      $tab = isset( $_GET['tab'] ) ? esc_attr($_GET['tab']) : 'general';
      eme_admin_tabs($tab);
   ?>
<div class="wrap">
<div id='icon-options-general' class='icon32'><br />
</div>
<h1><?php _e ( 'Event Manager Options', 'eme' ); ?></h1>
<?php admin_show_warnings();?>
<p> 
<?php printf(__( "Please also check <a href='%s'>your profile</a> for some per-user EME settings.", 'eme' ),admin_url('profile.php')); ?>
</p>
<form id="eme_options_form" method="post" action="options.php">
<input type='hidden' name='tab' value='<?php echo $tab;?>' />
<?php
   settings_fields ( 'eme-options' );
   switch ( $tab ) {
	      case 'general' :
?>

<h3><?php _e ( 'General options', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_radio_binary ( __ ( 'Use dropdown for locations?' ), 'eme_use_select_for_locations', __ ( 'Select yes to select location from a drop-down menu; location selection will be faster, but you will lose the ability to insert locations with events.','eme' )."<br />".__ ( 'When the qtranslate plugin is installed and activated, this setting will be ignored and always considered \'Yes\'.','eme' ) );
   eme_options_radio_binary ( __ ( 'Use recurrence?' ), 'eme_recurrence_enabled', __ ( 'Select yes to enable the possibility to create recurrent events.','eme' ) ); 
   eme_options_radio_binary ( __ ( 'Use RSVP?' ), 'eme_rsvp_enabled', __ ( 'Select yes to enable the RSVP feature so people can register for an event and book places.','eme' ) );
   eme_options_radio_binary ( __ ( 'Use categories?' ), 'eme_categories_enabled', __ ( 'Select yes to enable the category features.','eme' ) );
   eme_options_radio_binary ( __ ( 'Use attributes?' ), 'eme_attributes_enabled', __ ( 'Select yes to enable the attributes feature.','eme' ) );
   eme_options_radio_binary ( __ ( 'Enable Google Maps integration?' ), 'eme_gmap_is_active', __ ( 'Check this option to enable Google Map integration.','eme' ) );
   eme_options_radio_binary ( __ ( 'Enable map scroll-wheel zooming?' ), 'eme_gmap_zooming', __ ( 'Yes, enables map scroll-wheel zooming. No, enables scroll-wheel page scrolling over maps. (It will be necessary to refresh your web browser on a map page to see the effect of this change.)', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Always include JS in header?' ), 'eme_load_js_in_header', __ ( 'Some themes are badely designed and can have issues showing the google maps or advancing in the calendar. If so, try activating this option which will cause the javascript to always be included in the header of every page (off by default).','eme' ) );
   eme_options_radio_binary ( __ ( 'Use the client computer clock for the calendar', 'eme' ), 'eme_use_client_clock', __ ( 'Check this option if you want to use the clock of the client as base to calculate current day for the calendar.', 'eme' ) );
   eme_options_select ( __('Theme loop protection','eme'), 'eme_loop_protection', array ('simple' => __('Simple loop protection (default)','eme'), 'older' => __ ( 'Loop protection for older or misbehaving themes', 'eme' ), 'desperate' => __('Last attempt at loop protection (if all else fails)','eme')), __('Choose the level of loop protection against the_content filter you want. Depending on the theme you may need to change this.','eme') );
   eme_options_radio_binary ( __ ( 'Delete all EME data when upgrading or deactivating?', 'eme' ), 'eme_uninstall_drop_data', __ ( 'Check this option if you want to delete all EME data (database tables and options) when upgrading or deactivating the plugin.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Enable shortcodes in widgets', 'eme' ), 'eme_shortcodes_in_widgets', __ ( 'Check this option if you want to enable the use of shortcodes in widgets (affects shortcodes of any plugin used in widgets, so use with care).', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Enable placeholders in event notes', 'eme' ), 'eme_enable_notes_placeholders', __ ( 'Check this option if you want to enable the use of placeholders in the event notes. By default placeholders in notes are not being touched at all so as not to interfere with possible format settings for other shortcodes you can/want to use, so use with care.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Allow deprecated placeholders', 'eme' ), 'eme_deprecated', __ ( 'Check this option if you want to use some deprecated placeholders.', 'eme' ) .' '.__('For more information, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?p=51559'>".__('the documentation', 'eme').'</a>' );
   eme_options_radio_binary ( __ ( 'Re-enable legacy placeholder syntax', 'eme' ), 'eme_legacy', __ ( 'Check this option if you want to re-enable the use of the older placeholder syntax with square brackets. Be aware of the fact that the new placeholder syntax will not work then.', 'eme' ) .' '.__('For more information, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?p=51559'>".__('the documentation', 'eme').'</a>' );
   ?>
</table>

<?php
	      break;
	      case 'seo' :
?>

<h3><?php _e ( 'Permalink options', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_radio_binary ( __ ( 'Enable event permalinks if possible?','eme' ), 'eme_seo_permalink', __ ( 'If Yes, EME will render SEO permalinks if permalinks are activated.', 'eme' ) . "<br \><strong>" . __ ( 'It is necessary to click \'Save Changes\' on the  WordPress \'Settings/Permalinks\' page before you will see the effect of this change.','eme' )."</strong>");
   eme_options_input_text ( __('Events permalink prefix', 'eme' ), 'eme_permalink_events_prefix', __( 'The permalink prefix used for events and the calendar.','eme') );
   eme_options_input_text ( __('Locations permalink prefix', 'eme' ), 'eme_permalink_locations_prefix', __( 'The permalink prefix used for locations.','eme') );
   ?>
</table>

<?php
	      break;
	      case 'access' :
?>

<h3><?php _e ( 'Access rights', 'eme' ); ?></h3>
<p><?php _e ( 'Tip: Use a plugin like "User Role Editor" to add/edit capabilities and roles.', 'eme' ); ?></p>
<table class="form-table">
   <?php
   eme_options_select (__('Add event','eme'), 'eme_cap_add_event', eme_get_all_caps (), sprintf(__('Permission needed to add a new event. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_ADD_EVENT)) );
   eme_options_select (__('Author event','eme'), 'eme_cap_author_event', eme_get_all_caps (), sprintf(__('Permission needed to edit own events. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_AUTHOR_EVENT)) );
   eme_options_select (__('Publish event','eme'), 'eme_cap_publish_event', eme_get_all_caps (), sprintf(__('Permission needed to make an event public. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_PUBLISH_EVENT)) );
   eme_options_select (__('List events','eme'), 'eme_cap_list_events', eme_get_all_caps (), sprintf(__('Permission needed to just list all events, useful for CSV exports for bookings and such. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_LIST_EVENTS)) . "<br /><b>". __('All your event admins need this as well, otherwise the menu will not show.','eme')."</b>" );
   eme_options_select (__('Edit events','eme'), 'eme_cap_edit_events', eme_get_all_caps (), sprintf(__('Permission needed to edit all events. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_EDIT_EVENTS)) );
   eme_options_select (__('Add location','eme'), 'eme_cap_add_locations', eme_get_all_caps (), sprintf(__('Permission needed to add locations. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_ADD_LOCATION)) );
   eme_options_select (__('Author location','eme'), 'eme_cap_author_locations', eme_get_all_caps (), sprintf(__('Permission needed to edit own locations. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_AUTHOR_LOCATION)) );
   eme_options_select (__('Edit location','eme'), 'eme_cap_edit_locations', eme_get_all_caps (), sprintf(__('Permission needed to edit all locations. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_EDIT_LOCATIONS)) );
   eme_options_select (__('Edit categories','eme'), 'eme_cap_categories', eme_get_all_caps (), sprintf(__('Permission needed to edit all categories. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_CATEGORIES)) );
   eme_options_select (__('Edit templates','eme'), 'eme_cap_templates', eme_get_all_caps (), sprintf(__('Permission needed to edit all templates. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_TEMPLATES)) );
   eme_options_select (__('View people','eme'), 'eme_cap_people', eme_get_all_caps (), sprintf(__('Permission needed to view registered people info. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_PEOPLE)) );
   eme_options_select (__('Approve registrations','eme'), 'eme_cap_approve', eme_get_all_caps (), sprintf(__('Permission needed to approve pending registrations. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_APPROVE)) );
   eme_options_select (__('Edit registrations','eme'), 'eme_cap_registrations', eme_get_all_caps (), sprintf(__('Permission needed to edit approved registrations. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_REGISTRATIONS)) );
   eme_options_select (__('Send Mails','eme'), 'eme_cap_send_mails', eme_get_all_caps (), sprintf(__('Permission needed to send mails for own events. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_SEND_MAILS)) );
   eme_options_select (__('Send Other Mails','eme'), 'eme_cap_send_other_mails', eme_get_all_caps (), sprintf(__('Permission needed to send mails for any event. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_SEND_OTHER_MAILS)) );
   eme_options_select (__('Edit form fields','eme'), 'eme_cap_forms', eme_get_all_caps (), sprintf(__('Permission needed to edit form fields. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_FORMS)) );
   eme_options_select (__('Cleanup','eme'), 'eme_cap_cleanup', eme_get_all_caps (), sprintf(__('Permission needed to execute cleanup actions. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_CLEANUP)) );
   eme_options_select (__('Edit settings','eme'), 'eme_cap_settings', eme_get_all_caps (),sprintf(__('Permission needed to edit settings. Default: %s','eme'), eme_capNamesCB(DEFAULT_CAP_SETTINGS)) );
   ?>
</table>

<?php
	      break;
	      case 'events' :
?>

<h3><?php _e ( 'Events page', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_select ( __ ( 'Events page', 'eme' ), 'eme_events_page', eme_get_all_pages (), __ ( 'This option allows you to select which page to use as an events page.', 'eme' )."<br /><strong>".__ ( 'The content of this page (including shortcodes of any kind) will be ignored completely and dynamically replaced by events data.','eme' )."</strong>" );
   eme_options_radio_binary ( __ ( 'Show events page in lists?', 'eme' ), 'eme_list_events_page', __ ( 'Check this option if you want the events page to appear together with other pages in pages lists.', 'eme' )."<br /><strong>".__ ( 'This option should no longer be used, it will be deprecated. Using the [eme_events] shortcode in a self created page is recommended.', 'eme' )."</strong>" ); 
   eme_options_radio_binary ( __ ( 'Display calendar in events page?', 'eme' ), 'eme_display_calendar_in_events_page', __ ( 'This option 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.','eme' ) );
   eme_options_input_text ( __('Number of events to show in lists', 'eme' ), 'eme_event_list_number_items', __( 'The number of events to show in a list if no specific limit is specified (used in the shortcode eme_events, RSS feed, the placeholders #_NEXTEVENTS and #_PASTEVENTS, ...). Use 0 for no limit.','eme') );
   eme_options_select (__('State for new event','eme'), 'eme_event_initial_state', eme_status_array(), __ ('Initial state for a new event','eme') );
   ?>
</table>
<h3><?php _e ( 'Events format', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_radio_binary ( __ ( 'Remove leading zeros from minutes?', 'eme' ), 'eme_time_remove_leading_zeros', __ ( 'PHP date/time functions have no notation to show minutes without leading zeros. Checking this option will return e.g. 9 for 09 and empty for 00.', 'eme' ) ); 
   eme_options_textarea ( __ ( 'Default event list format header', 'eme' ), 'eme_event_list_item_format_header', sprintf(__('This content will appear just above your code for the default event list format. If you leave this empty, the value <code>%s</code> will be used.','eme'),eme_sanitize_html(DEFAULT_EVENT_LIST_HEADER_FORMAT)));
   eme_options_textarea ( __ ( 'Default categories event list format header', 'eme' ), 'eme_cat_event_list_item_format_header', sprintf(__('This content will appear just above your code for the event list format when showing events for a specific category. If you leave this empty, the value <code>%s</code> will be used.','eme'),eme_sanitize_html(DEFAULT_CAT_EVENT_LIST_HEADER_FORMAT)));
   eme_options_textarea ( __ ( 'Default event list format', 'eme' ), 'eme_event_list_item_format', __ ( 'The format of any events in a list.<br/>Insert one or more of the following placeholders: <code>#_EVENTNAME</code>, <code>#_LOCATIONNAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_NOTES</code>.<br/> Use <code>#_EXCERPT</code> to show <code>#_NOTES</code> until you place a <code>&lt;!&ndash;&ndash;more&ndash;&ndash;&gt;</code> marker.<br/> Use <code>#_LINKEDNAME</code> for the event name with a link to the given event page.<br/> Use <code>#_EVENTPAGEURL</code> to print the event page URL and make your own customised links.<br/> Use <code>#_LOCATIONPAGEURL</code> to print the location page URL and make your own customised links.<br/>Use <code>#_EDITEVENTLINK</code> to add a link to edit page for the event, which will appear only when a user is logged in.<br/>To insert date and time 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/> For the end time, put <code>#@</code> in front of the character, e.g. <code>#@h</code>, <code>#@i</code>, etc.<br/> You can also create a date format without prepending <code>#</code> by wrapping it in #_{} or #@_{} (e.g. <code>#_{d/m/Y}</code>). If there is no end date, the value is not shown.<br/>Use <code>#_12HSTARTTIME</code> and <code>#_12HENDTIME</code> for AM/PM start-time/end-time notation, idem <code>#_24HSTARTTIME</code> and <code>#_24HENDTIME</code>.<br/>Feel free to use HTML tags as <code>li</code>, <code>br</code> and so on.<br/>For custom attributes, you use <code>#_ATT{key}{alternative text}</code>, the second braces are optional and will appear if the attribute is not defined or left blank for that event. This key will appear as an option when adding attributes to your event.', 'eme' )."<br />".__('Use <code>#_PAST_FUTURE_CLASS</code> to return a class name indicating this event is future or past (<code>eme-future-event</code> or <code>eme-past-event</code>), use the returned value in e.g. the li-statement for each event in the list of events','eme') .'<br />'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=25'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Default event list format footer', 'eme' ), 'eme_event_list_item_format_footer', sprintf(__('This content will appear just below your code for the default event list format. If you leave this empty, the value <code>%s</code> will be used.','eme'),eme_sanitize_html(DEFAULT_EVENT_LIST_FOOTER_FORMAT)));
   eme_options_textarea ( __ ( 'Default categories event list format footer', 'eme' ), 'eme_cat_event_list_item_format_footer', sprintf(__('This content will appear just below your code for the default event list format when showing events for a specific category. If you leave this empty, the value <code>%s</code> will be used.','eme'),eme_sanitize_html(DEFAULT_CAT_EVENT_LIST_FOOTER_FORMAT)));
   eme_options_input_text ( __ ( 'Single event page title format', 'eme' ), 'eme_event_page_title_format', __ ( 'The format of a single event page title. Follow the previous formatting instructions.', 'eme' ) );
   eme_options_input_text ( __ ( 'Single event html title format', 'eme' ), 'eme_event_html_title_format', __ ( 'The format of a single event html page title. Follow the previous formatting instructions.', 'eme' ). __( ' The default is: ','eme'). eme_sanitize_html(DEFAULT_EVENT_HTML_TITLE_FORMAT));
   eme_options_textarea ( __ ( 'Default single event format', 'eme' ), 'eme_single_event_format', __ ( 'The format of a single event page.<br/>Follow the previous formatting instructions. <br/>Use <code>#_MAP</code> to insert a map.<br/>Use <code>#_CONTACTNAME</code>, <code>#_CONTACTEMAIL</code>, <code>#_CONTACTPHONE</code> to insert respectively the name, e-mail address and phone number of the designated contact person. <br/>Use <code>#_ADDBOOKINGFORM</code> to insert a form to allow the user to respond to your events reserving one or more places (RSVP).<br/> Use <code>#_REMOVEBOOKINGFORM</code> to insert a form where users, inserting their name and e-mail address, can remove their bookings.', 'eme' ).__('<br/>Use <code>#_ADDBOOKINGFORM_IF_NOT_REGISTERED</code> to insert the booking form only if the user has not registered yet. Similar use <code>#_REMOVEBOOKINGFORM_IF_REGISTERED</code> to insert the booking removal form only if the user has already registered before. These two codes only work for WP users.','eme').__('<br/> Use <code>#_DIRECTIONS</code> to insert a form so people can ask directions to the event.','eme').__('<br/> Use <code>#_CATEGORIES</code> to insert a comma-seperated list of categories an event is in.','eme').__('<br/> Use <code>#_ATTENDEES</code> to get a list of the names attending the event.','eme') .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=25'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Monthly period date format', 'eme' ), 'eme_show_period_monthly_dateformat', __ ( 'The format of the date-string used when you use showperiod=monthly as an option to &#91;the eme_events] shortcode, also used for monthly pagination. Use php date() compatible settings.', 'eme') . __( ' The default is: ','eme'). DEFAULT_SHOW_PERIOD_MONTHLY_DATEFORMAT );
   eme_options_input_text ( __ ( 'Yearly period date format', 'eme' ), 'eme_show_period_yearly_dateformat', __ ( 'The format of the date-string used when you use showperiod=yearly as an option to &#91;the eme_events] shortcode, also used for yearly pagination. Use php date() compatible settings.', 'eme') . __( ' The default is: ','eme'). DEFAULT_SHOW_PERIOD_YEARLY_DATEFORMAT );
   eme_options_input_text ( __ ( 'Events page title', 'eme' ), 'eme_events_page_title', __ ( 'The title on the multiple events page.', 'eme' ) );
   eme_options_input_text ( __ ( 'No events message', 'eme' ), 'eme_no_events_message', __ ( 'The message displayed when no events are available.', 'eme' ) );
   ?>
</table>
<h3><?php _e ( 'Events filtering format', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_textarea ( __ ( 'Default event list filtering format', 'eme' ), 'eme_filter_form_format', __ ( 'This defines the layout of the event list filtering form when using the shortcode <code>[eme_filterform]</code>. Use <code>#_FILTER_CATS</code>, <code>#_FILTER_LOCS</code>, <code>#_FILTER_TOWNS</code>, <code>#_FILTER_WEEKS</code>, <code>#_FILTER_MONTHS</code>.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=28'>".__('the documentation', 'eme').'</a>' );
   ?>
</table>

<?php
	      break;
	      case 'calendar' :
?>

<h3><?php _e ( 'Calendar options', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_radio_binary ( __ ( 'Hide past events?', 'eme' ), 'eme_cal_hide_past_events', __ ( 'Check this option if you want to hide past events in the calendar.', 'eme' ) ); 
   ?>
</table>
<h3><?php _e ( 'Calendar format', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_input_text ( __ ( 'Small calendar title', 'eme' ), 'eme_small_calendar_event_title_format', __ ( 'The format of the title, corresponding to the text that appears when hovering on an eventful calendar day.', 'eme' ) );
   eme_options_input_text ( __ ( 'Small calendar title separator', 'eme' ), 'eme_small_calendar_event_title_separator', __ ( 'The separator appearing on the above title when more than one event is taking place on the same day.', 'eme' ) );
   eme_options_input_text ( __ ( 'Full calendar events format', 'eme' ), 'eme_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.', 'eme' ) );
   ?>
</table>

<?php
	      break;
	      case 'locations' :
?>

<h3><?php _e ( 'Locations format', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_textarea ( __ ( 'Default location list format header', 'eme' ), 'eme_location_list_format_header', sprintf(__( 'This content will appear just above your code for the default location list format. If you leave this empty, the value <code>%s</code> will be used.<br/>Used by the shortcode <code>[eme_locations]</code>', 'eme'),eme_sanitize_html(DEFAULT_LOCATION_LIST_HEADER_FORMAT)));
   eme_options_textarea ( __ ( 'Default location list item format', 'eme' ), 'eme_location_list_format_item', sprintf(__ ( 'The format of a location in a location list. If you leave this empty, the value <code>%s</code> will be used.<br/>See the documentation for a list of available placeholders for locations.<br/>Used by the shortcode <code>[eme_locations]</code>', 'eme' ),eme_sanitize_html(DEFAULT_LOCATION_EVENT_LIST_ITEM_FORMAT)) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=26'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Default location list format footer', 'eme' ), 'eme_location_list_format_footer', sprintf(__( 'This content will appear just below your code for the default location list format. If you leave this empty, the value <code>%s</code> will be used.<br/>Used by the shortcode <code>[eme_locations]</code>', 'eme'),eme_sanitize_html(DEFAULT_LOCATION_LIST_FOOTER_FORMAT)));

   eme_options_input_text ( __ ( 'Single location page title format', 'eme' ), 'eme_location_page_title_format', __ ( 'The format of a single location page title.<br/>Follow the previous formatting instructions.', 'eme' ) );
   eme_options_input_text ( __ ( 'Single location html title format', 'eme' ), 'eme_location_html_title_format', __ ( 'The format of a single location html page title.<br/>Follow the previous formatting instructions.', 'eme' ). __( ' The default is: ','eme'). DEFAULT_LOCATION_HTML_TITLE_FORMAT);
   eme_options_textarea ( __ ( 'Default single location page format', 'eme' ), 'eme_single_location_format', __ ( 'The format of a single location page.<br/>Insert one or more of the following placeholders: <code>#_LOCATIONNAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code>.<br/> Use <code>#_MAP</code> to display a map of the event location, and <code>#_IMAGE</code> to display an image of the location.<br/> Use <code>#_NEXTEVENTS</code> to insert a list of the upcoming events, <code>#_PASTEVENTS</code> for a list of past events, <code>#_ALLEVENTS</code> for a list of all events taking place in this location.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=26'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Default location balloon format', 'eme' ), 'eme_location_baloon_format', __ ( 'The format of the text appearing in the balloon describing the location in the map.<br/>Insert one or more of the following placeholders: <code>#_LOCATIONNAME</code>, <code>#_ADDRESS</code>, <code>#_TOWN</code>, <code>#_DESCRIPTION</code>,<code>#_IMAGE</code>, <code>#_LOCATIONPAGEURL</code> or <code>#_DIRECTIONS</code>.', 'eme' ) );
   eme_options_textarea ( __ ( 'Default location event list format', 'eme' ), 'eme_location_event_list_item_format', __ ( 'The format of the events list inserted in the location page through the <code>#_NEXTEVENTS</code>, <code>#_PASTEVENTS</code> and <code>#_ALLEVENTS</code> element. <br/> Follow the events formatting instructions', 'eme' ) );
   eme_options_textarea ( __ ( 'Default no events message', 'eme' ), 'eme_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.', 'eme' ) );
   ?>
</table>

<?php
	      break;
	      case 'rss' :
?>

<h3><?php _e ( 'RSS and ICAL feed format', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_input_text ( __ ( 'RSS main title', 'eme' ), 'eme_rss_main_title', __ ( 'The main title of your RSS events feed.', 'eme' ) );
   eme_options_input_text ( __ ( 'RSS main description', 'eme' ), 'eme_rss_main_description', __ ( 'The main description of your RSS events feed.', 'eme' ) );
   eme_options_input_text ( __ ( 'RSS title format', 'eme' ), 'eme_rss_title_format', __ ( 'The format of the title of each item in the events RSS feed.', 'eme' ) );
   eme_options_textarea ( __ ( 'RSS description format', 'eme' ), 'eme_rss_description_format', __ ( 'The format of the description of each item in the events RSS feed. Follow the previous formatting instructions.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'RSS Pubdate usage', 'eme' ), 'eme_rss_show_pubdate', __ ( 'Show the event creation/modification date as PubDate info in the in the events RSS feed.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'RSS Pubdate is start date', 'eme' ), 'eme_rss_pubdate_startdate', __ ( 'If you select this, the pubDate field in RSS will be the event start date, not the modification date.', 'eme' ) );
   eme_options_input_text ( __ ( 'ICAL title format', 'eme' ), 'eme_ical_title_format', __ ( 'The format of the title of each item in the events ICAL feed.', 'eme' ) );
   eme_options_input_text ( __ ( 'ICAL description format', 'eme' ), 'eme_ical_description_format', __ ( 'The format of the description of each item in the events ICAL feed. Follow the previous formatting instructions.', 'eme' ) );
   ?>
</table>

<?php
	      break;
	      case 'rsvp' :
?>

<h3><?php _e ( 'RSVP: registrations and bookings', 'eme' ); ?></h3>
<table class='form-table'>
     <?php
   $indexed_users[-1]=__('Event author','eme');
   $indexed_users+=eme_get_indexed_users();
   eme_options_select ( __ ( 'Default contact person', 'eme' ), 'eme_default_contact_person', $indexed_users, __ ( 'Select the default contact person. This user will be employed whenever a contact person is not explicitly specified for an event', 'eme' ) );
   eme_options_radio_binary ( __ ( 'By default enable registrations for new events?', 'eme' ), 'eme_rsvp_reg_for_new_events', __ ( 'Check this option if you want to enable registrations by default for new events.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'By default require approval for registrations?', 'eme' ), 'eme_rsvp_require_approval', __ ( 'Check this option if you want by default that new registrations require approval.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'By default require WP membership to be able to register?', 'eme' ), 'eme_rsvp_registered_users_only', __ ( 'Check this option if you want by default that only WP registered users can book for an event.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Check required fields upon submit?', 'eme' ), 'eme_rsvp_check_required_fields', __ ( 'Check this option if you want to check on the server-side if all required fields have been completed upon RSVP form submit. Consider using a captcha if disabling this.', 'eme' ) );
   eme_options_input_text ( __ ( 'Default number of spaces', 'eme' ), 'eme_rsvp_default_number_spaces', __ ( 'The default number of spaces an event has.', 'eme' ) );
   eme_options_input_text ( __ ( 'Min number of spaces to book', 'eme' ), 'eme_rsvp_addbooking_min_spaces', __ ( 'The minimum number of spaces a person can book in one go (it can be 0, for e.g. just an attendee list).', 'eme' ) );
   eme_options_input_text ( __ ( 'Max number of spaces to book', 'eme' ), 'eme_rsvp_addbooking_max_spaces', __ ( 'The maximum number of spaces a person can book in one go.', 'eme' ) );
   $eme_rsvp_number_days=get_option('eme_rsvp_number_days');
   $eme_rsvp_number_hours=get_option('eme_rsvp_number_hours');
   $eme_rsvp_end_target=get_option('eme_rsvp_end_target');
   ?>
   <tr valign="top" id='eme_rsvp_number_row'>
      <th scope="row"><?php _e('By default allow RSVP until this many', 'eme') ?></th>
      <td>
      <input name="eme_rsvp_number_days" type="text" id="eme_rsvp_number_days" value="<?php echo eme_sanitize_html($eme_rsvp_number_days); ?>" size="4" /> <?php _e('days', 'eme') ?>
      <input name="eme_rsvp_number_hours" type="text" id="eme_rsvp_number_hours" value="<?php echo eme_sanitize_html($eme_rsvp_number_hours); ?>" size="4" /> <?php _e('hours', 'eme') ?>
      <?php
      $eme_rsvp_end_target_list = array('start'=>__('starts','eme'),'end'=>__('ends','eme'));
      _e ( 'before the event ','eme' );
      echo eme_ui_select($eme_rsvp_end_target,'eme_rsvp_end_target',$eme_rsvp_end_target_list);
      ?>
      </td>
   </tr>
   <?php
   eme_options_input_text ( __ ( 'RSVP cancel cutoff', 'eme' ), 'eme_cancel_rsvp_days', __ ( 'Allow RSVP cancellation until this many days before the event starts.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Use captcha for booking form?', 'eme' ), 'eme_captcha_for_booking', __ ( 'Check this option if you want to use a captcha on the booking form, to thwart spammers a bit.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Hide fully booked events?', 'eme' ), 'eme_rsvp_hide_full_events', __ ( 'Check this option if you want to hide events that are fully booked from the calendar and events listing in the front.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Hide RSVP ended events?', 'eme' ), 'eme_rsvp_hide_rsvp_ended_events', __ ( 'Check this option if you want to hide events which RSVP registration period has already ended.', 'eme' ) );
   eme_options_input_text ( __ ( 'Add booking form submit text', 'eme' ), 'eme_rsvp_addbooking_submit_string', __ ( "The string of the submit button on the add booking form", 'eme' ) );
   eme_options_input_text ( __ ( 'Delete booking form submit text', 'eme' ), 'eme_rsvp_delbooking_submit_string', __ ( "The string of the submit button on the delete booking form", 'eme' ) );
   eme_options_input_text ( __ ( 'Attendees list format', 'eme' ), 'eme_attendees_list_format', __ ( "The format for the attendees list when using the <code>#_ATTENDEES</code> placeholder.", 'eme' ). __('For all placeholders you can use here, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=48'>".__('the documentation', 'eme').'</a>' );
   eme_options_radio_binary ( __ ( 'Attendees list ignore pending', 'eme' ), 'eme_attendees_list_ignore_pending', __ ( "Whether or not to ignore pending bookings when using the <code>#_ATTENDEES</code> placeholder.", 'eme' ));
   eme_options_input_text ( __ ( 'Bookings list header format', 'eme' ), 'eme_bookings_list_header_format', __ ( "The header format for the bookings list when using the <code>#_BOOKINGS</code> placeholder.", 'eme' ). sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(DEFAULT_BOOKINGS_LIST_HEADER_FORMAT)));
   eme_options_input_text ( __ ( 'Bookings list format', 'eme' ), 'eme_bookings_list_format', __ ( "The format for the bookings list when using the <code>#_BOOKINGS</code> placeholder.", 'eme' ). __('For all placeholders you can use here, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=45'>".__('the documentation', 'eme').'</a>' .__('For more information about form fields, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=44'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Bookings list footer format', 'eme' ), 'eme_bookings_list_footer_format', __ ( "The footer format for the bookings list when using the <code>#_BOOKINGS</code> placeholder.", 'eme' ). sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(DEFAULT_BOOKINGS_LIST_FOOTER_FORMAT)));
   eme_options_radio_binary ( __ ( 'Bookings list ignore pending', 'eme' ), 'eme_bookings_list_ignore_pending', __ ( "Whether or not to ignore pending bookings when using the <code>#_BOOKINGS</code> placeholder.", 'eme' ));
   eme_options_textarea ( __ ( 'Booking recorded message', 'eme' ), 'eme_registration_recorded_ok_html', __ ( "The text (html allowed) shown to the user when the booking has been made successfully.", 'eme' ) );
   eme_options_radio_binary ( __ ( 'Show RSVP form again after booking?', 'eme' ), 'eme_rsvp_show_form_after_booking', __ ( "Uncheck this option if you don't want to show the RSVP booking form again after a successful booking.", 'eme' ) );
   ?>
</table>

<h3><?php _e ( 'RSVP: form format', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      eme_options_textarea (__('Form format','eme'),'eme_registration_form_format', __("The look and feel of the form for registrations. #_NAME, #_EMAIL and #_SEATS are obligated fields, if not present then the form will not be shown.",'eme')  .'<br/>'.__('For more information about form fields, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=44'>".__('the documentation', 'eme').'</a>');
      eme_options_textarea (__('Cancel form format','eme'),'eme_cancel_form_format', __("The look and feel of the cancel form for registrations. #_NAME and #_EMAIL are obligated fields, if not present then the form will not be shown.", 'eme').'<br/>'.__('For more information about form fields, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=5950'>".__('the documentation', 'eme').'</a>');
   ?>
</table>


<?php
	      break;
	      case 'mail' :
?>

<h3><?php _e ( 'RSVP: mail options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
   eme_options_radio_binary ( __ ( 'Enable the RSVP e-mail notifications?', 'eme' ), 'eme_rsvp_mail_notify_is_active', __ ( 'Check this option if you want to receive an email when someone books places for your events.', 'eme' ) );
   ?>
</table>
<table id="rsvp_mail_notify-data" class='form-table'>
   <?php
   eme_options_radio_binary ( __ ( 'Send HTML mails', 'eme' ), 'eme_rsvp_send_html', __ ( 'Check this option if you want to use html in the mails being sent.', 'eme' ) );
   eme_options_radio_binary ( __ ( 'Quick deny send mails', 'eme' ), 'eme_deny_mail_event_edit', __ ( 'Check this option if you want to sent mails when denying a registration while editing an event.', 'eme' ) );
   eme_options_input_text ( __ ( 'Contact person email subject format', 'eme' ), 'eme_contactperson_email_subject', __ ( 'The format of the email subject which will be sent to the contact person.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Contact person email format', 'eme' ), 'eme_contactperson_email_body', __ ( 'The format of the email which will be sent to the contact person.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Contact person cancelled email subject format', 'eme' ), 'eme_contactperson_cancelled_email_subject', __ ( 'The format of the email subject which will be sent to the contact person for a cancellation.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Contact person cancelled email format', 'eme' ), 'eme_contactperson_cancelled_email_body', __ ( 'The format of the email which will be sent to the contact person for a cancellation.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Contact person pending email subject format', 'eme' ), 'eme_contactperson_pending_email_subject', __ ( 'The format of the email subject which will be sent to the contact person if approval is needed.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Contact person pending email format', 'eme' ), 'eme_contactperson_pending_email_body', __ ( 'The format of the email which will be sent to the contact person if approval is needed.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Respondent email subject format', 'eme' ), 'eme_respondent_email_subject', __ ( 'The format of the email subject which will be sent to the respondent.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Respondent email format', 'eme' ), 'eme_respondent_email_body', __ ( 'The format of the email which will be sent to the respondent.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Registration pending email subject format', 'eme' ), 'eme_registration_pending_email_subject', __ ( 'The format of the email subject which will be sent to the respondent when the event requires registration approval.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Registration pending email format', 'eme' ), 'eme_registration_pending_email_body', __ ( 'The format of the email which will be sent to the respondent when the event requires registration approval.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Registration cancelled email subject format', 'eme' ), 'eme_registration_cancelled_email_subject', __ ( 'The format of the email subject which will be sent to the respondent when the respondent cancels the registrations for an event.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Registration cancelled email format', 'eme' ), 'eme_registration_cancelled_email_body', __ ( 'The format of the email which will be sent to the respondent when the respondent cancels the registrations for an event.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Registration denied email subject format', 'eme' ), 'eme_registration_denied_email_subject', __ ( 'The format of the email subject which will be sent to the respondent when the admin denies the registration request if the event requires registration approval.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Registration denied email format', 'eme' ), 'eme_registration_denied_email_body', __ ( 'The format of the email which will be sent to the respondent when the admin denies the registration request if the event requires registration approval.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Registration updated email subject format', 'eme' ), 'eme_registration_updated_email_subject', __ ( 'The format of the email subject which will be sent to the respondent when the admin updates the registration request.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Registration updated email format', 'eme' ), 'eme_registration_updated_email_body', __ ( 'The format of the email which will be sent to the respondent when the admin updates the registration request.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_input_text ( __ ( 'Notification sender name', 'eme' ), 'eme_mail_sender_name', __ ( "Insert the display name of the notification sender.", 'eme' ) );
   eme_options_input_text ( __ ( 'Notification sender address', 'eme' ), 'eme_mail_sender_address', __ ( "Insert the address of the notification sender. It must correspond with your Gmail account user if you use Gmail to send mails.", 'eme' ), "email" );
   eme_options_input_text ( __ ( 'Notification BCC address', 'eme' ), 'eme_mail_bcc_address', __ ( "Insert an address that will be added in Bcc to all outgoing mails. Can be left empty.", 'eme' ), "email" );
   eme_options_select ( __ ( 'Mail sending method', 'eme' ), 'eme_rsvp_mail_send_method', array ('smtp' => 'SMTP', 'mail' => __ ( 'PHP mail function', 'eme' ), 'sendmail' => 'Sendmail', 'qmail' => 'Qmail', 'wp_mail' => 'WP Mail' ), __ ( 'Select the method to send email notification.', 'eme' ) );
   eme_options_input_text (__( 'SMTP host','eme'), 'eme_smtp_host', __ ( "The SMTP host. Usually it corresponds to 'localhost'. If you use Gmail, set this value to 'ssl://smtp.gmail.com:465'.", 'eme' ) );
   eme_options_input_text ( __('Mail sending port','eme'), 'eme_smtp_port', __ ( "The port through which you e-mail notifications will be sent. Make sure the firewall doesn't block this port", 'eme' ) );
   eme_options_radio_binary ( __ ( 'Use SMTP authentication?', 'eme' ), 'eme_rsvp_mail_SMTPAuth', __ ( 'SMTP authentication is often needed. If you use Gmail, make sure to set this parameter to Yes', 'eme' ) );
   eme_options_input_text ( __ ( 'SMTP username', 'eme' ), 'eme_smtp_username', __ ( "Insert the username to be used to access your SMTP server.", 'eme' ) );
   eme_options_input_password ( __ ( 'SMTP password', 'eme' ), 'eme_smtp_password', __ ( "Insert the password to be used to access your SMTP server", 'eme' ) );
   eme_options_radio_binary ( __ ( 'Debug SMTP?', 'eme' ), 'eme_smtp_debug', __ ( 'Check this option if you have issues sending mail via SMTP. Only do this for debugging purposes and deactivate it afterwards!', 'eme' ) );
   ?>
   </div>
</table>

<?php
	      break;
	      case 'payments' :
            $events_page_link = eme_get_events_page(true, false);
?>

<h3><?php _e ( 'RSVP: price options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
   eme_options_select ( __ ( 'Default currency', 'eme' ), 'eme_default_currency', eme_currency_array(), __ ( 'Select the default currency for payments.', 'eme' ) );
   eme_options_input_text ( __ ( 'Default price', 'eme' ), 'eme_default_price', __ ( 'The default price for an event.', 'eme' ) );
   eme_options_textarea ( __ ( 'Payment form header format', 'eme' ), 'eme_payment_form_header_format', __ ( 'The format of the text shown above the payment buttons. If left empty, a standard text will be shown.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Payment form footer format', 'eme' ), 'eme_payment_form_footer_format', __ ( 'The format of the text shown below the payment buttons. Default: empty.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=27'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Multibooking payment form header format', 'eme' ), 'eme_multipayment_form_header_format', __ ( 'The format of the text shown above the payment buttons in the multibooking form. If left empty, a standard text will be shown.', 'eme' ).'<br/>'.__('Although the same placeholders as for the regular payment form header format can be used, it is advised to only use multibooking related placeholders.', 'eme') );
   eme_options_textarea ( __ ( 'Multibooking payment form footer format', 'eme' ), 'eme_multipayment_form_footer_format', __ ( 'The format of the text shown below the payment buttons in the multibooking form. Default: empty.', 'eme' ).'<br/>'.__('Although the same placeholders as for the regular payment form header format can be used, it is advised to only use multibooking related placeholders.', 'eme') );
   eme_options_radio_binary ( __ ( 'Show custom payment return page', 'eme' ), 'eme_payment_show_custom_return_page', __ ( 'Check this option if you want to define a custom page format for the sucess or failure of the payment.', 'eme' ) );
   eme_options_textarea ( __ ( 'Payment succes return page format', 'eme' ), 'eme_payment_succes_format', __ ( 'The format of the return page when the payment is succesfull.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=25'>".__('the documentation', 'eme').'</a>' );
   eme_options_textarea ( __ ( 'Payment failure return page format', 'eme' ), 'eme_payment_fail_format', __ ( 'The format of the return page when the payment failed or has been canceled.', 'eme' ) .'<br/>'.__('For all possible placeholders, see ', 'eme')."<a target='_blank' href='http://www.e-dynamics.be/wordpress/?cat=25'>".__('the documentation', 'eme').'</a>' );
   eme_options_radio_binary ( __ ( 'Add booking id to return page info', 'eme' ), 'eme_payment_add_bookingid_to_return', __ ( 'Check this option if you want to add the booking id to the return page. This will allow you to also use booking placeholders next to the regular event placeholders, but beware that other people can change the url and see other booking info then!', 'eme' ) );
   ?>
</table>

<h3><?php _e ( 'RSVP: paypal options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      $notification_link = add_query_arg(array('eme_eventAction'=>'paypal_notification'),$events_page_link);
      eme_options_select ( __('PayPal live or test','eme'), 'eme_paypal_url', array (PAYPAL_SANDBOX_URL => __('Paypal Sandbox (for testing)','eme'), PAYPAL_LIVE_URL => __ ( 'Paypal Live', 'eme' )), __('Choose wether you want to test paypal in a paypal sandbox or go live and really use paypal.','eme') );
      eme_options_input_text (__('PayPal business info','eme'),'eme_paypal_business', __("Paypal business ID or email.",'eme'));
      eme_options_radio_binary ( __ ( 'Use paypal encryption?','eme' ), 'eme_paypal_s_encrypt', __ ( 'Select yes to encrypt the paypal button using certificates.','eme' ) );
      eme_options_radio_binary ( __ ( 'Ignore paypal tax setting?','eme' ), 'eme_paypal_no_tax', __ ( 'Select yes to ignore the tax setting in your paypal profile.','eme' ) );
      eme_options_input_text (__('Paypal public cert','eme'),'eme_paypal_s_paypalcert', __("Path to paypal public certificate file.",'eme'));
      eme_options_input_text (__('Own public cert','eme'),'eme_paypal_s_pubcert', __("Path to own public certificate file.",'eme'));
      eme_options_input_text (__('Own private key','eme'),'eme_paypal_s_privkey', __("Path to own private key file.",'eme'));
      eme_options_input_text (__('Certificate ID','eme'),'eme_paypal_s_certid', __("Certificate ID of your cert at paypal.",'eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_paypal_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_paypal_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_paypal_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_paypal_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_paypal_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_paypal_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      echo "<tr><td colspan='2'>".__('Info: the url for payment notifications is: ','eme').$notification_link.'</td></tr>';
   ?>
</table>

<h3><?php _e ( 'RSVP: 2Checkout options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      $notification_link = add_query_arg(array('eme_eventAction'=>'2co_notification'),$events_page_link);

      eme_options_select ( __('2Checkout live or test','eme'), 'eme_2co_demo', array (2 => __('2Checkout Sandbox (for testing)','eme'), 1 => __('2Checkout Test (the "demo" mode)','eme'), 0 => __ ( '2Checkout Live', 'eme' )), __('Choose wether you want to test 2Checkout in a sandbox or go live and really use 2Checkout.','eme') );
      eme_options_input_text (__('2Checkout Account number','eme'),'eme_2co_business', __("2Checkout Account number.",'eme'));
      eme_options_input_password (__('2Checkout Secret','eme'),'eme_2co_secret', __("2Checkout secret.",'eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_2co_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_2co_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_2co_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_2co_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_2co_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_2co_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      echo "<tr><td colspan='2'>".__('Info: the url for payment notifications is: ','eme').$notification_link.'</td></tr>';
   ?>
</table>

<h3><?php _e ( 'RSVP: Webmoney options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      $notification_link = add_query_arg(array('eme_eventAction'=>'webmoney_notification'),$events_page_link);

      eme_options_select ( __('Webmoney live or test','eme'), 'eme_webmoney_demo', array (1 => __('Webmoney Sandbox (for testing)','eme'), 0 => __ ( 'Webmoney Live', 'eme' )), __('Choose wether you want to test Webmoney in a sandbox or go live and really use Webmoney.','eme') );
      eme_options_input_text (__('Webmoney Purse','eme'),'eme_webmoney_purse', __("Webmoney Purse.",'eme'));
      eme_options_input_password (__('Webmoney Secret','eme'),'eme_webmoney_secret', __("Webmoney secret.",'eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_webmoney_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_webmoney_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_webmoney_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_webmoney_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_webmoney_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_webmoney_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      echo "<tr><td colspan='2'>".__('Info: the url for payment notifications is: ','eme').$notification_link.'</td></tr>';
   ?>
</table>

<h3><?php _e ( 'RSVP: First Data options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      $notification_link = add_query_arg(array('eme_eventAction'=>'fdgg_notification'),$events_page_link);

      eme_options_select ( __('First Data live or test','eme'), 'eme_fdgg_url', array (FDGG_SANDBOX_URL => __('First Data Sandbox (for testing)','eme'), FDGG_LIVE_URL => __ ( 'First Data Live', 'eme' )), __('Choose wether you want to test First Data in a sandbox or go live and really use First Datal.','eme') );
      eme_options_input_text (__('First Data Store Name','eme'),'eme_fdgg_store_name', __("First Data Store Name.",'eme'));
      eme_options_input_password (__('First Data Shared Secret','eme'),'eme_fdgg_shared_secret', __("First Data Shared Secret.",'eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_fdgg_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_fdgg_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_fdgg_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_fdgg_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_fdgg_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_fdgg_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      echo "<tr><td colspan='2'>".__('Info: the url for payment notifications is: ','eme').$notification_link.'</td></tr>';
   ?>
</table>

<h3><?php _e ( 'RSVP: Mollie options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      $notification_link = add_query_arg(array('eme_eventAction'=>'mollie_notification'),$events_page_link);

      eme_options_input_text (__('Mollie API key','eme'),'eme_mollie_api_key', __('Mollie API key','eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_mollie_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_mollie_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_mollie_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_mollie_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_mollie_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_mollie_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      echo "<tr><td colspan='2'>".__('Info: the url for payment notifications is: ','eme').$notification_link.'</td></tr>';
   ?>
</table>

<h3><?php _e ( 'RSVP: Sage Pay options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      eme_options_select ( __('Sage Pay live or test','eme'), 'eme_sagepay_demo', array (1 => __('Sage Pay Sandbox (for testing)','eme'), 0 => __ ( 'Sage Pay Live', 'eme' )), __('Choose wether you want to test Sage Pay in a sandbox or go live and really use Sage Pay.','eme') );
      eme_options_input_text (__('Sage Pay Vendor Name','eme'),'eme_sagepay_vendor_name', __("Sage Pay Vendor Name",'eme'));
      eme_options_input_password (__('Sage Pay Test Password','eme'),'eme_sagepay_test_pwd', __("Sage Pay password for testing purposes",'eme'));
      eme_options_input_password (__('Sage Pay Live Password','eme'),'eme_sagepay_live_pwd', __("Sage Pay password when using Sage Pay for real",'eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_sagepay_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_sagepay_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_sagepay_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_sagepay_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_sagepay_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_sagepay_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      echo "<tr><td colspan='2'>".__('Info: for Sage Pay to work, your PHP installation must have the mcrypt module installed and activated. Search the internet for which extra PHP package to install and/or which line in php.ini to change.','eme').'</td></tr>';
   ?>
</table>

<h3><?php _e ( 'RSVP: Worldpay options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
      eme_options_select ( __('Worldpay live or test','eme'), 'eme_worldpay_demo', array (1 => __('Worldpay Sandbox (for testing)','eme'), 0 => __ ( 'Worldpay Live', 'eme' )), __('Choose wether you want to test Worldpay in a sandbox or go live and really use Worldpay.','eme') );
      eme_options_input_text (__('Worldpay installation ID','eme'),'eme_worldpay_instid', __("Worldpay installation ID",'eme'));
      eme_options_input_text (__('Worldpay MD5 secret','eme'),'eme_worldpay_md5_secret', __("Worldpay MD5 secret used when submitting payments",'eme'));
      eme_options_input_text (__('Worldpay MD5 parameters','eme'),'eme_worldpay_md5_parameters', __("Worldpay parameters used to generate the MD5 signature, separated by ':'. Only use these 4 in the order of your choice: instId,cartId,currency and/or amount",'eme'));
      eme_options_input_password (__('Worldpay Test Password','eme'),'eme_worldpay_test_pwd', __("Worldpay password for payment notifications when testing",'eme'));
      eme_options_input_password (__('Worldpay Live Password','eme'),'eme_worldpay_live_pwd', __("Worldpay password for payment notifications when using Worldpay for real",'eme'));
      eme_options_input_text (__('Extra charge','eme'),'eme_worldpay_cost', __("Extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Extra charge 2','eme'),'eme_worldpay_cost2', __("Second extra charge added when paying for an event. Can either be an absolute number or a percentage. E.g. 2 or 5%",'eme'));
      eme_options_input_text (__('Payment button label','eme'),'eme_worldpay_button_label', __('The text shown inside the payment button','eme'));
      eme_options_input_text (__('Payment button image','eme'),'eme_worldpay_button_img_url', __('The url to an image for the payment button that replaces the standard submit button with the label mentioned above.','eme'));
      eme_options_input_text (__('Text above payment button','eme'),'eme_worldpay_button_above', __('The text shown just above the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
      eme_options_input_text (__('Text below payment button','eme'),'eme_worldpay_button_below', __('The text shown just below the payment button, you can use #_EXTRACHARGE and #_CURRENCY to indicate the extra charge calculated if wanted','eme'));
   ?>
</table>

<?php
	      break;
	      case 'other' :
?>

<h3><?php _e ( 'CSV separator', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
   eme_options_input_text ( __('CSV separator','eme'), 'eme_csv_separator', __('Set the separator used in CSV exports.','eme').sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(EME_DEFAULT_CSV_SEPARATOR)) );
   ?>
</table>

<h3><?php _e ( 'Images size', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
   eme_options_select ( __('Thumbnail size','eme'), 'eme_thumbnail_size', eme_thumbnail_sizes(), __('Choose the default thumbnail size to be shown when using placeholders involving thumbnails like e.g. #_EVENTIMAGETHUMB, #_LOCATIONIMAGETHUMB, ...','eme') );
   ?>
</table>

<h3><?php _e ( 'Map options', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
   eme_options_input_text ( __('Global map zoom factor','eme'), 'eme_global_zoom_factor', __('The zoom factor used for the global map (max: 14).','eme').sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(DEFAULT_GLOBAL_ZOOM_FACTOR)) );
   eme_options_input_text ( __('Individual map zoom factor','eme'), 'eme_indiv_zoom_factor', __('The zoom factor used when showing a single map (max: 14).','eme').sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(DEFAULT_INDIV_ZOOM_FACTOR))  );
   eme_options_select ( __('Global map type','eme'), 'eme_global_maptype', array('ROADMAP' => __('Road map view','eme'),'SATELLITE' => __('Google Earth satellite images','eme'),'HYBRID' => __('Hybrid: a mixture of normal and satellite views','eme'), 'TERRAIN' => __('Terrain: a physical map based on terrain information')), __('The map type used for the global map (max: 14).','eme').sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(DEFAULT_GLOBAL_MAPTYPE)) );
   eme_options_select ( __('Individual map type','eme'), 'eme_indiv_maptype', array('ROADMAP' => __('Road map view','eme'),'SATELLITE' => __('Google Earth satellite images','eme'),'HYBRID' => __('Hybrid: a mixture of normal and satellite views','eme'), 'TERRAIN' => __('Terrain: a physical map based on terrain information')), __('The map type used when showing a single map (max: 14).','eme').sprintf(__(" The default is '%s'",'eme'),eme_sanitize_html(DEFAULT_INDIV_MAPTYPE))  );
   ?>
</table>

<h3><?php _e ( 'Extra html headers', 'eme' ); ?></h3>
<table class="form-table">
   <?php
   eme_options_textarea ( __ ( 'Extra html header', 'eme' ), 'eme_html_header', __ ( 'Here you can define extra html headers, no placeholders can be used, no html will be stripped. Can be used to add custom javascript, ...', 'eme' ) );
   eme_options_textarea ( __ ( 'Extra html footer', 'eme' ), 'eme_html_footer', __ ( 'Here you can define extra html footer, no placeholders can be used, no html will be stripped. Can be used to add custom javascript, ...', 'eme' ) );
   eme_options_textarea ( __ ( 'Extra event html headers', 'eme' ), 'eme_event_html_headers_format', __ ( 'Here you can define extra html headers when viewing a single event, typically used to add meta tags for facebook or SEO. All event placeholders can be used, but will be stripped from resulting html.', 'eme' ) );
   eme_options_textarea ( __ ( 'Extra location html headers', 'eme' ), 'eme_location_html_headers_format', __ ( 'Here you can define extra html headers when viewing a single location, typically used to add meta tags for facebook or SEO. All location placeholders can be used, but will be stripped from resulting html.', 'eme' ) );
   ?>
</table>

<h3><?php _e ( 'Facebook info', 'eme' ); ?></h3>
<table class='form-table'>
   <?php
   eme_options_input_text ( __ ( 'Facebook app id', 'eme' ), 'eme_fb_app_id', __ ( 'Provide facebook app id. This is needed to be able to import info from a facebook event when creating a new event.', 'eme' ) );
   ?>
</table>
<?php
	      break;
         }
?>


<p class="submit"><input type="submit" class="button-primary" id="eme_options_submit" name="Submit" value="<?php _e ( 'Save Changes' )?>" /></p>
</form>
</div>
<?php
   }
}
Example #2
0
function eme_event_form($event, $title, $element)
{
    admin_show_warnings();
    global $plugin_page, $eme_timezone;
    $event_status_array = eme_status_array();
    $saved_bydays = array();
    $currency_array = eme_currency_array();
    // let's determine if it is a new event, handy
    // or, in case of validation errors, $event can already contain info, but no $element (=event id)
    // so we create a new event and copy over the info into $event for the elements that do not exist
    if (!$element) {
        $is_new_event = 1;
        $new_event = eme_new_event();
        $event = array_replace_recursive($new_event, $event);
    } else {
        $is_new_event = 0;
    }
    $show_recurrent_form = 0;
    if (isset($_GET['eme_admin_action']) && $_GET['eme_admin_action'] == "edit_recurrence") {
        $pref = "recurrence";
        $form_destination = "admin.php?page=events-manager&amp;eme_admin_action=update_recurrence&amp;recurrence_id=" . $element;
        $saved_bydays = explode(",", $event['recurrence_byday']);
        $show_recurrent_form = 1;
    } else {
        $pref = "event";
        // even for new events, after the 'save' button is clicked, we want to go to the list of events
        // so we use page=events-manager too, not page=eme-new_event
        if ($is_new_event) {
            $form_destination = "admin.php?page=events-manager&amp;eme_admin_action=insert_event";
        } else {
            $form_destination = "admin.php?page=events-manager&amp;eme_admin_action=update_event&amp;event_id=" . $element;
        }
        if (isset($event['recurrence_id']) && $event['recurrence_id']) {
            # editing a single event of an recurrence: don't show the recurrence form
            $show_recurrent_form = 0;
        } else {
            # for single non-recurrent events: we show the form, so we can make it recurrent if we want to
            # but for that, we need to set the recurrence fields, otherwise we get warnings
            $show_recurrent_form = 1;
            $event['recurrence_id'] = 0;
            $event['recurrence_freq'] = '';
            $event['recurrence_start_date'] = $event['event_start_date'];
            $event['recurrence_end_date'] = $event['event_end_date'];
            $event['recurrence_interval'] = '';
            $event['recurrence_byweekno'] = '';
            $event['recurrence_byday'] = '';
            $event['recurrence_specific_days'] = '';
        }
    }
    if (!isset($event['recurrence_start_date'])) {
        $event['recurrence_start_date'] = $event['event_start_date'];
    }
    if (!isset($event['recurrence_end_date'])) {
        $event['recurrence_end_date'] = $event['event_end_date'];
    }
    $freq_options = array("daily" => __('Daily', 'eme'), "weekly" => __('Weekly', 'eme'), "monthly" => __('Monthly', 'eme'), "specific" => __('Specific days', 'eme'));
    $days_names = array(1 => __('Mon'), 2 => __('Tue'), 3 => __('Wed'), 4 => __('Thu'), 5 => __('Fri'), 6 => __('Sat'), 7 => __('Sun'));
    $weekno_options = array("1" => __('first', 'eme'), '2' => __('second', 'eme'), '3' => __('third', 'eme'), '4' => __('fourth', 'eme'), '5' => __('fifth', 'eme'), '-1' => __('last', 'eme'), "0" => __('Start day'));
    $event_RSVP_checked = $event['event_rsvp'] ? "checked='checked'" : "";
    $event_number_spaces = $event['event_seats'];
    $registration_wp_users_only = $event['registration_wp_users_only'] ? "checked='checked'" : "";
    $registration_requires_approval = $event['registration_requires_approval'] ? "checked='checked'" : "";
    $use_paypal_checked = $event['use_paypal'] ? "checked='checked'" : "";
    $use_2co_checked = $event['use_2co'] ? "checked='checked'" : "";
    $use_webmoney_checked = $event['use_webmoney'] ? "checked='checked'" : "";
    $use_fdgg_checked = $event['use_fdgg'] ? "checked='checked'" : "";
    $use_mollie_checked = $event['use_mollie'] ? "checked='checked'" : "";
    $use_sagepay_checked = $event['use_sagepay'] ? "checked='checked'" : "";
    // all properties
    $eme_prop_auto_approve_checked = $event['event_properties']['auto_approve'] ? "checked='checked'" : "";
    $eme_prop_ignore_pending_checked = $event['event_properties']['ignore_pending'] ? "checked='checked'" : "";
    $eme_prop_take_attendance = $event['event_properties']['take_attendance'] ? "checked='checked'" : "";
    $eme_prop_all_day_checked = $event['event_properties']['all_day'] ? "checked='checked'" : "";
    $eme_prop_use_worldpay = $event['event_properties']['use_worldpay'] ? "checked='checked'" : "";
    $eme_date_obj = new ExpressiveDate(null, $eme_timezone);
    // the next javascript will fill in the values for localised-start-date, ... form fields and jquery datepick will fill in also to "to_submit" form fields
    ?>

<script type="text/javascript">
   jQuery(document).ready( function() {
   var dateFormat = jQuery("#localised-start-date").datepick( "option", "dateFormat" );

   var loc_start_date = jQuery.datepick.newDate(<?php 
    echo $eme_date_obj->setTimestampFromString($event['event_start_date'] . " " . $eme_timezone)->format('Y,n,j');
    ?>
);
   jQuery("#localised-start-date").datepick("setDate", jQuery.datepick.formatDate(dateFormat, loc_start_date));

   var loc_end_date = jQuery.datepick.newDate(<?php 
    echo $eme_date_obj->setTimestampFromString($event['event_end_date'] . " " . $eme_timezone)->format('Y,n,j');
    ?>
);
   jQuery("#localised-end-date").datepick("setDate", jQuery.datepick.formatDate(dateFormat, loc_end_date));
   <?php 
    if ($pref == "recurrence" && $event['recurrence_freq'] == 'specific') {
        ?>
      var mydates = [];
      <?php 
        foreach (explode(',', $event['recurrence_specific_days']) as $specific_day) {
            ?>
	      mydates.push(jQuery.datepick.newDate(<?php 
            echo $eme_date_obj->setTimestampFromString($specific_day)->format('Y,n,j');
            ?>
));
      <?php 
        }
        ?>
      jQuery("#localised-rec-start-date").datepick("setDate", mydates);
   <?php 
    } else {
        ?>
      var rec_start_date = jQuery.datepick.newDate(<?php 
        echo $eme_date_obj->setTimestampFromString($event['recurrence_start_date'] . " " . $eme_timezone)->format('Y,n,j');
        ?>
);
      jQuery("#localised-rec-start-date").datepick("setDate", jQuery.datepick.formatDate(dateFormat, rec_start_date));
   <?php 
    }
    ?>
      var rec_end_date = jQuery.datepick.newDate(<?php 
    echo $eme_date_obj->setTimestampFromString($event['recurrence_end_date'] . " " . $eme_timezone)->format('Y,n,j');
    ?>
);
   jQuery("#localised-rec-end-date").datepick("setDate", jQuery.datepick.formatDate(dateFormat, rec_end_date));
 });
</script>

   <form id="eventForm" name="eventForm" method="post" enctype="multipart/form-data" action="<?php 
    echo $form_destination;
    ?>
">
      <div class="wrap">
         <div id="icon-events" class="icon32"><br /></div>
         <h1><?php 
    echo eme_trans_sanitize_html($title);
    ?>
</h1>
         <?php 
    if ($event['recurrence_id']) {
        ?>
         <p id='recurrence_warning'>
            <?php 
        if (isset($_GET['eme_admin_action']) && $_GET['eme_admin_action'] == 'edit_recurrence') {
            _e('WARNING: This is a recurrence.', 'eme');
            ?>
            <br />
            <?php 
            _e('Modifying these data all the events linked to this recurrence will be rescheduled', 'eme');
        } else {
            _e('WARNING: This is a recurring event.', 'eme');
            _e('If you change these data and save, this will become an independent event.', 'eme');
        }
        ?>
         </p>
         <?php 
    }
    ?>
         <div id="poststuff" class="metabox-holder has-right-sidebar">
            <!-- SIDEBAR -->
            <div id="side-info-column" class='inner-sidebar'>
               <div id='side-sortables' class="meta-box-sortables">
                  <?php 
    if (current_user_can(get_option('eme_cap_author_event'))) {
        ?>
                  <!-- status postbox -->
                  <div class="postbox ">
                     <div class="handlediv" title="Click to toggle."><br />
                     </div>
                     <h3 class='hndle'><span>
                        <?php 
        _e('Event Status', 'eme');
        ?>
                        </span></h3>
                     <div class="inside">
                        <p><?php 
        _e('Status', 'eme');
        ?>
                        <select id="event_status" name="event_status">
                        <?php 
        foreach ($event_status_array as $key => $value) {
            if ($event['event_status'] && $event['event_status'] == $key) {
                $selected = "selected='selected'";
            } else {
                $selected = "";
            }
            echo "<option value='{$key}' {$selected}>{$value}</option>";
        }
        ?>
                        </select><br />
                        <?php 
        _e('Private events are only visible for logged in users, draft events are not visible from the front end.', 'eme');
        ?>
                        </p>
                     </div>
                  </div>
                  <?php 
    }
    ?>
                  <?php 
    if (get_option('eme_recurrence_enabled') && $show_recurrent_form) {
        ?>
                  <!-- recurrence postbox -->
                  <div class="postbox ">
                     <div class="handlediv" title="Click to toggle."><br />
                     </div>
                     <h3 class='hndle'><span>
                        <?php 
        _e("Recurrence", 'eme');
        ?>
                        </span></h3>
                     <div class="inside">
                        <?php 
        $recurrence_YES = "";
        if ($event['recurrence_id']) {
            $recurrence_YES = "checked='checked' disabled='disabled'";
        }
        ?>
                        <p>
                           <input id="event-recurrence" type="checkbox" name="repeated_event"
                              value="1" <?php 
        echo $recurrence_YES;
        ?>
 />
                        </p>
                        <div id="event_recurrence_pattern">
                           <p>Frequency:
                              <select id="recurrence-frequency" name="recurrence_freq">
                                 <?php 
        eme_option_items($freq_options, $event['recurrence_freq']);
        ?>
                              </select>
                           </p>
			   <div id="recurrence-intervals">
                           <p>
                              <?php 
        _e('Every', 'eme');
        ?>
                              <input id="recurrence-interval" name='recurrence_interval'
                                size='2' value='<?php 
        if (isset($event['recurrence_interval'])) {
            echo $event['recurrence_interval'];
        }
        ?>
' />
                              <span class='interval-desc' id="interval-daily-singular">
                              <?php 
        _e('day', 'eme');
        ?>
                              </span> <span class='interval-desc' id="interval-daily-plural">
                              <?php 
        _e('days', 'eme');
        ?>
                              </span> <span class='interval-desc' id="interval-weekly-singular">
                              <?php 
        _e('week', 'eme');
        ?>
                              </span> <span class='interval-desc' id="interval-weekly-plural">
                              <?php 
        _e('weeks', 'eme');
        ?>
                              </span> <span class='interval-desc' id="interval-monthly-singular">
                              <?php 
        _e('month', 'eme');
        ?>
                              </span> <span class='interval-desc' id="interval-monthly-plural">
                              <?php 
        _e('months', 'eme');
        ?>
                              </span> </p>
                           <p class="alternate-selector" id="weekly-selector">
                              <?php 
        eme_checkbox_items('recurrence_bydays[]', $days_names, $saved_bydays);
        ?>
                              <br />
                              <?php 
        _e('If you leave this empty, the recurrence start date will be used as a reference.', 'eme');
        ?>
                           </p>
                           <p class="alternate-selector" id="monthly-selector">
                              <?php 
        _e('Every', 'eme');
        ?>
                              <select id="monthly-modifier" name="recurrence_byweekno">
                                 <?php 
        eme_option_items($weekno_options, $event['recurrence_byweekno']);
        ?>
                              </select>
                              <select id="recurrence-weekday" name="recurrence_byday">
                                 <?php 
        eme_option_items($days_names, $event['recurrence_byday']);
        ?>
                              </select>
                              <?php 
        _e('Day of month', 'eme');
        ?>
                              <br />
                              <?php 
        _e('If you use "Start day" as day of the month, the recurrence start date will be used as a reference.', 'eme');
        ?>
                              &nbsp;
                           </p>
                           </div>
                        </div>
                        <p id="recurrence-tip">
                           <?php 
        _e('Check if your event happens more than once.', 'eme');
        ?>
                        </p>
                        <p id="recurrence-tip-2">
                           <?php 
        _e('The event start and end date only define the duration of an event in case of a recurrence.', 'eme');
        ?>
                        </p>
                     </div>
                  </div>
                  <?php 
    }
    ?>

                  <?php 
    if ($event['event_author']) {
        ?>
                  <!-- owner postbox -->
                  <div class="postbox ">
                     <div class="handlediv" title="Click to toggle."><br />
                     </div>
                     <h3 class='hndle'><span>
                        <?php 
        _e('Author', 'eme');
        ?>
                        </span></h3>
                     <div class="inside">
                        <p><?php 
        _e('Author of this event: ', 'eme');
        ?>
                           <?php 
        $owner_user_info = get_userdata($event['event_author']);
        echo eme_sanitize_html($owner_user_info->display_name);
        ?>
                        </p>
                     </div>
                  </div>
                  <?php 
    }
    ?>
                  <div class="postbox ">
                     <div class="handlediv" title="Click to toggle."><br />
                     </div>
                     <h3 class='hndle'><span>
                        <?php 
    _e('Contact Person', 'eme');
    ?>
                        </span></h3>
                     <div class="inside">
                        <p><?php 
    _e('Contact', 'eme');
    ?>
                           <?php 
    wp_dropdown_users(array('name' => 'event_contactperson_id', 'show_option_none' => __("Event author", 'eme'), 'selected' => $event['event_contactperson_id']));
    // if it is not a new event and there's no contact person defined, then the event author becomes contact person
    // So let's display a warning what this means if there's no author (like when submitting via the frontend submission form)
    if (!$is_new_event && $event['event_contactperson_id'] < 1 && $event['event_author'] < 1) {
        print "<br />" . __('Since the author is undefined for this event, any reference to the contact person (like when using #_CONTACTPERSON when sending mails), will use the admin user info.', 'eme');
    }
    ?>
                        </p>
                     </div>
                  </div>
                  <?php 
    if (get_option('eme_rsvp_enabled')) {
        ?>
                  <div class="postbox ">
                     <div class="handlediv" title="Click to toggle."><br />
                     </div>
                     <h3 class='hndle'><span><?php 
        _e('RSVP', 'eme');
        ?>
</span></h3>
                     <div class="inside">
                        <p>
                           <input id="rsvp-checkbox" name='event_rsvp' value='1' type='checkbox' <?php 
        echo $event_RSVP_checked;
        ?>
 />
                           <?php 
        _e('Enable registration for this event', 'eme');
        ?>
                        </p>
                        <div id='rsvp-data'>
                           <p>
                              <input id="approval_required-checkbox" name='registration_requires_approval' value='1' type='checkbox' <?php 
        echo $registration_requires_approval;
        ?>
 />
                              <?php 
        _e('Require approval for registration', 'eme');
        ?>
                           <br />
                              <input id="eme_prop_auto_approve" name='eme_prop_auto_approve' value='1' type='checkbox' <?php 
        echo $eme_prop_auto_approve_checked;
        ?>
 />
                              <?php 
        _e('Auto-approve registration upon payment', 'eme');
        ?>
                           <br />
                              <input id="eme_prop_ignore_pending" name='eme_prop_ignore_pending' value='1' type='checkbox' <?php 
        echo $eme_prop_ignore_pending_checked;
        ?>
 />
                              <?php 
        _e('Consider pending registrations as available seats for new bookings', 'eme');
        ?>
                           <br />
                              <input id="wp_member_required-checkbox" name='registration_wp_users_only' value='1' type='checkbox' <?php 
        echo $registration_wp_users_only;
        ?>
 />
                              <?php 
        _e('Require WP membership for registration', 'eme');
        ?>
                           <br />
                              <input id="eme_prop_take_attendance" name='eme_prop_take_attendance' value='1' type='checkbox' <?php 
        echo $eme_prop_take_attendance;
        ?>
 />
                              <?php 
        _e('Only take attendance (0 or 1 seat) for this event', 'eme');
        ?>
                           <br /><table>
                              <tr>
                              <td><?php 
        _e('Spaces', 'eme');
        ?>
 :</td>
                              <td><input id="seats-input" type="text" name="event_seats" maxlength='125' title="<?php 
        _e('For multiseat events, seperate the values by \'||\'', 'eme');
        ?>
" value="<?php 
        echo $event_number_spaces;
        ?>
" /></td>
                              </tr>
                              <tr>
                              <td><?php 
        _e('Price: ', 'eme');
        ?>
</td>
                              <td><input id="price" type="text" name="price" maxlength='125' title="<?php 
        _e('For multiprice events, seperate the values by \'||\'', 'eme');
        ?>
" value="<?php 
        echo $event['price'];
        ?>
" /></td>
                              </tr>
                              <tr>
                              <td><?php 
        _e('Currency: ', 'eme');
        ?>
</td>
                              <td><select id="currency" name="currency">
                              <?php 
        foreach ($currency_array as $key => $value) {
            if ($event['currency'] && $event['currency'] == $key) {
                $selected = "selected='selected'";
            } elseif (!$event['currency'] && $key == get_option('eme_default_currency')) {
                $selected = "selected='selected'";
            } else {
                $selected = "";
            }
            echo "<option value='{$key}' {$selected}>{$value}</option>";
        }
        ?>
                              </select></td>
                              </tr>
                              <tr>
                              <td><?php 
        _e('Max number of spaces to book', 'eme');
        ?>
</td>
                              <td><input id="eme_prop_max_allowed" type="text" name="eme_prop_max_allowed" maxlength='125' title="<?php 
        echo __('The maximum number of spaces a person can book in one go.', 'eme') . ' ' . __('(is multi-compatible)', 'eme');
        ?>
" value="<?php 
        echo $event['event_properties']['max_allowed'];
        ?>
" /></td>
                              </tr>
                              <tr>
                              <td><?php 
        _e('Min number of spaces to book', 'eme');
        ?>
</td>
                              <td><input id="eme_prop_min_allowed" type="text" name="eme_prop_min_allowed" maxlength='125' title="<?php 
        echo __('The minimum number of spaces a person can book in one go (it can be 0, for e.g. just an attendee list).', 'eme') . ' ' . __('(is multi-compatible)', 'eme');
        ?>
" value="<?php 
        echo $event['event_properties']['min_allowed'];
        ?>
" /></td>
                              </tr></table>
                           <br />
                              <?php 
        _e('Allow RSVP until ', 'eme');
        ?>
                           <br />
                              <input id="rsvp_number_days" type="text" name="rsvp_number_days" maxlength='2' size='2' value="<?php 
        echo $event['rsvp_number_days'];
        ?>
" />
                              <?php 
        _e('days', 'eme');
        ?>
                              <input id="rsvp_number_hours" type="text" name="rsvp_number_hours" maxlength='2' size='2' value="<?php 
        echo $event['rsvp_number_hours'];
        ?>
" />
                              <?php 
        _e('hours', 'eme');
        ?>
                           <br />
                              <?php 
        _e('before the event ', 'eme');
        $eme_rsvp_end_target_list = array('start' => __('starts', 'eme'), 'end' => __('ends', 'eme'));
        echo eme_ui_select($event['event_properties']['rsvp_end_target'], 'eme_prop_rsvp_end_target', $eme_rsvp_end_target_list);
        ?>
                           <br />
                           <br />
                              <?php 
        _e('Payment methods', 'eme');
        ?>
<br />
                              <input id="paypal-checkbox" name='use_paypal' value='1' type='checkbox' <?php 
        echo $use_paypal_checked;
        ?>
 /><?php 
        _e('Paypal', 'eme');
        ?>
<br />
                              <input id="2co-checkbox" name='use_2co' value='1' type='checkbox' <?php 
        echo $use_2co_checked;
        ?>
 /><?php 
        _e('2Checkout', 'eme');
        ?>
<br />
                              <input id="webmoney-checkbox" name='use_webmoney' value='1' type='checkbox' <?php 
        echo $use_webmoney_checked;
        ?>
 /><?php 
        _e('Webmoney', 'eme');
        ?>
<br />
                              <input id="fdgg-checkbox" name='use_fdgg' value='1' type='checkbox' <?php 
        echo $use_fdgg_checked;
        ?>
 /><?php 
        _e('First Data', 'eme');
        ?>
<br />
                              <input id="mollie-checkbox" name='use_mollie' value='1' type='checkbox' <?php 
        echo $use_mollie_checked;
        ?>
 /><?php 
        _e('Mollie', 'eme');
        ?>
<br />
                              <input id="sagepay-checkbox" name='use_sagepay' value='1' type='checkbox' <?php 
        echo $use_sagepay_checked;
        ?>
 /><?php 
        _e('Sage Pay', 'eme');
        ?>
<br />
                              <input id="eme_prop_use_worldpay" name='eme_prop_use_worldpay' value='1' type='checkbox' <?php 
        echo $eme_prop_use_worldpay;
        ?>
 /><?php 
        _e('Worldpay', 'eme');
        ?>
<br />
                           </p>
                           <?php 
        if ($event['event_rsvp'] && $pref != "recurrence") {
            // show the compact bookings table only when not editing a recurrence
            eme_bookings_compact_table($event['event_id']);
        }
        ?>
                        </div>
                     </div>
                  </div>
                  <?php 
    }
    ?>
                  <?php 
    if (get_option('eme_categories_enabled')) {
        ?>
                  <div class="postbox ">
                     <div class="handlediv" title="Click to toggle."><br />
                     </div>
                     <h3 class='hndle'><span>
                        <?php 
        _e('Category', 'eme');
        ?>
                        </span></h3>
                     <div class="inside">
                     <?php 
        $categories = eme_get_categories();
        foreach ($categories as $category) {
            if ($event['event_category_ids'] && in_array($category['category_id'], explode(",", $event['event_category_ids']))) {
                $selected = "checked='checked'";
            } else {
                $selected = "";
            }
            ?>
            <input type="checkbox" name="event_category_ids[]" value="<?php 
            echo $category['category_id'];
            ?>
" <?php 
            echo $selected;
            ?>
 /><?php 
            echo eme_trans_sanitize_html($category['category_name']);
            ?>
<br />
                     <?php 
        }
        ?>
                     </div>
                  </div> 
                  <?php 
    }
    ?>
               </div>
            </div>
            <!-- END OF SIDEBAR -->
            <div id="post-body">
               <div id="post-body-content" class="meta-box-sortables">
               <?php 
    if ($plugin_page === 'eme-new_event' && get_option("eme_fb_app_id")) {
        ?>
                  <div id="fb-root"></div>
                  <script>
                    window.fbAsyncInit = function() {
                      // init the FB JS SDK
                      FB.init({
                        appId      : '<?php 
        echo get_option("eme_fb_app_id");
        ?>
',// App ID from the app dashboard
                        channelUrl : '<?php 
        echo plugins_url("eme_fb_channel.php", __FILE__);
        ?>
', // Channel file for x-domain comms
                        status     : true,  // Check Facebook Login status
                        xfbml      : true   // Look for social plugins on the page
                      });

                      // Additional initialization code such as adding Event Listeners goes here
                     FB.Event.subscribe('auth.authResponseChange', function(response) {
                        if (response.status === 'connected') {
                           jQuery('#fb-import-box').show();
                         } else if (response.status === 'not_authorized') {
                           jQuery('#fb-import-box').hide();
                         } else {
                           jQuery('#fb-import-box').hide();
                         }
                        });
                     };


                     // Load the SDK asynchronously
                     (function(d, s, id){
                       var js, fjs = d.getElementsByTagName(s)[0];
                       if (d.getElementById(id)) {return;}
                       js = d.createElement(s); js.id = id;
                       js.src = "//connect.facebook.net/en_US/all.js";
                       fjs.parentNode.insertBefore(js, fjs);
                     }(document, 'script', 'facebook-jssdk'));

                  </script>
                  <fb:login-button id="fb-login-button" width="200" autologoutlink="true" scope="user_events" max-rows="1"></fb:login-button>
                  <br />
                  <br />
                  <div id='fb-import-box' style='display:none'>
                     Facebook event url : <input type='text' id='fb-event-url' class='widefat' /> 
                     <br />
                     <br />
                     <input type='button' class='button' value='Import' id='import-fb-event-btn' />
                     <br />
                     <br />
                  </div>
               <?php 
    }
    ?>

               <?php 
    $screens = array('events_page_eme-new_event', 'toplevel_page_events-manager');
    foreach ($screens as $screen) {
        if ($event['event_page_title_format'] == "" && $event['event_properties']['event_page_title_format_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_page_title_format', 'eme_closed');
        }
        if ($event['event_single_event_format'] == "" && $event['event_properties']['event_single_event_format_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_single_event_format', 'eme_closed');
        }
        if ($event['event_contactperson_email_body'] == "" && $event['event_properties']['event_contactperson_email_body_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_contactperson_email_body', 'eme_closed');
        }
        if ($event['event_registration_recorded_ok_html'] == "" && $event['event_properties']['event_registration_recorded_ok_html_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_registration_recorded_ok_html', 'eme_closed');
        }
        if ($event['event_respondent_email_body'] == "" && $event['event_properties']['event_respondent_email_body_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_respondent_email_body', 'eme_closed');
        }
        if ($event['event_registration_pending_email_body'] == "" && $event['event_properties']['event_registration_pending_email_body_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_registration_pending_email_body', 'eme_closed');
        }
        if ($event['event_registration_updated_email_body'] == "" && $event['event_properties']['event_registration_updated_email_body_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_registration_updated_email_body', 'eme_closed');
        }
        if ($event['event_registration_cancelled_email_body'] == "" && $event['event_properties']['event_registration_cancelled_email_body_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_registration_cancelled_email_body', 'eme_closed');
        }
        if ($event['event_registration_denied_email_body'] == "" && $event['event_properties']['event_registration_denied_email_body_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_registration_denied_email_body', 'eme_closed');
        }
        if ($event['event_registration_form_format'] == "" && $event['event_properties']['event_registration_form_format_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_registration_form_format', 'eme_closed');
        }
        if ($event['event_cancel_form_format'] == "" && $event['event_properties']['event_cancel_form_format_tpl'] == 0) {
            add_filter('postbox_classes_' . $screen . '_div_event_cancel_form_format', 'eme_closed');
        }
    }
    // we can only give one parameter to do_meta_boxes, but we don't want to list the templates each time
    // so temporary we store the array in the $event var and unset it afterwards
    $templates_array = eme_get_templates_array_by_id();
    // the first element is something empty or a "no templates" string, but we need to keep the array indexes
    // so we concatenate using "+", not array_merge
    if (is_array($templates_array) && count($templates_array) > 0) {
        $templates_array = array(0 => '') + $templates_array;
    } else {
        $templates_array = array(0 => __('No templates defined yet!', 'eme'));
    }
    $event['templates_array'] = $templates_array;
    if ($is_new_event) {
        // we add the meta boxes only on the page we're currently at, so for duplicate event it is the same as for edit event
        // see the eme_admin_event_boxes function
        if (isset($_GET['eme_admin_action']) && $_GET['eme_admin_action'] == 'duplicate_event') {
            do_meta_boxes('toplevel_page_events-manager', "post", $event);
        } else {
            do_meta_boxes('events_page_eme-new_event', "post", $event);
        }
    } else {
        do_meta_boxes('toplevel_page_events-manager', "post", $event);
    }
    unset($event['templates_array']);
    ?>
               </div>
               <p class="submit">
                  <?php 
    if ($is_new_event) {
        ?>
                     <input type="submit" class="button-primary" id="event_update_button" name="event_update_button" value="<?php 
        _e('Save');
        ?>
 &raquo;" />
                  <?php 
    } else {
        $delete_button_text = __('Are you sure you want to delete this event?', 'eme');
        $deleteRecurrence_button_text = __('Are you sure you want to delete this recurrence?', 'eme');
        ?>
                     <?php 
        if ($pref == "recurrence") {
            ?>
                     <input type="submit" class="button-primary" id="event_update_button" name="event_update_button" value="<?php 
            _e('Update');
            ?>
 &raquo;" />
                     <?php 
        } else {
            ?>
                     <input type="submit" class="button-primary" id="event_update_button" name="event_update_button" value="<?php 
            _e('Update');
            ?>
 &raquo;" />
                     <?php 
        }
        ?>
                     <input type="submit" class="button-primary" id="event_delete_button" name="event_delete_button" value="<?php 
        _e('Delete Event', 'eme');
        ?>
 &raquo;" onclick="return areyousure('<?php 
        echo $delete_button_text;
        ?>
');" />
                     <?php 
        if ($event['recurrence_id']) {
            ?>
                     <input type="submit" class="button-primary" id="event_deleteRecurrence_button" name="event_deleteRecurrence_button" value="<?php 
            _e('Delete Recurrence', 'eme');
            ?>
 &raquo;" onclick="return areyousure('<?php 
            echo $deleteRecurrence_button_text;
            ?>
');" />
                     <?php 
        }
        ?>
 
                  <?php 
    }
    ?>
               </p>
            </div>
         </div>
      </div>
      <?php 
    wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
    ?>
      <?php 
    wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
    ?>
   </form>
<?php 
}