Advertisement
Guest User

Event Editor

a guest
Feb 6th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  1. <?php
  2. /* WARNING! This file may change in the near future as we intend to add features to the event editor. If at all possible, try making customizations using CSS, jQuery, or using our hooks and filters. - 2012-02-14 */
  3. /*
  4. * To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
  5. * You also must keep the _wpnonce hidden field in this form too.
  6. */
  7. global $EM_Event, $EM_Notices, $bp;
  8.  
  9. //check that user can access this page
  10. if( is_object($EM_Event) && !$EM_Event->can_manage('edit_events','edit_others_events') ){
  11. ?>
  12. <div class="wrap"><h2><?php _e('Unauthorized Access','dbem'); ?></h2><p><?php echo sprintf(__('You do not have the rights to manage this %s.','dbem'),__('Event','dbem')); ?></p></div>
  13. <?php
  14. return false;
  15. }elseif( !is_object($EM_Event) ){
  16. $EM_Event = new EM_Event();
  17. }
  18. $required = '*';
  19.  
  20. echo $EM_Notices;
  21. //Success notice
  22. if( !empty($_REQUEST['success']) ){
  23. if(!get_option('dbem_events_form_reshow')) return false;
  24. }
  25. ?>
  26. <form enctype='multipart/form-data' id="event-form" method="post" action="<?php echo add_query_arg(array('success'=>null)); ?>">
  27. <div class="wrap">
  28. <?php do_action('em_front_event_form_header'); ?>
  29. <?php if(get_option('dbem_events_anonymous_submissions') && !is_user_logged_in()): ?>
  30. <h4 class="event-form-submitter"><?php _e ( 'Your Details', 'dbem' ); ?></h4>
  31. <div class="inside event-form-submitter">
  32. <p>
  33. <label><?php _e('Promoters Name', 'dbem'); ?></label>
  34. <input type="text" name="event_owner_name" id="event-owner-name" value="<?php echo esc_attr($EM_Event->event_owner_name); ?>" />
  35. </p>
  36. <p>
  37. <label><?php _e('Promoters Email', 'dbem'); ?></label>
  38. <input type="text" name="event_owner_email" id="event-owner-email" value="<?php echo esc_attr($EM_Event->event_owner_email); ?>" />
  39. </p>
  40. <?php do_action('em_font_event_form_guest'); ?>
  41. </div>
  42. <?php endif; ?>
  43.  
  44. <div class="inside event-form-details">
  45. <div class="event-extra-details">
  46. <?php if(get_option('dbem_categories_enabled')) { em_locate_template('forms/event/attributes-public.php',true); } ?>
  47. <?php if(get_option('dbem_categories_enabled')) { em_locate_template('forms/event/categories-public.php',true); } ?>
  48. </div>
  49. </div>
  50.  
  51. <h4 class="event-form-name"><?php _e ( 'Event Name', 'dbem' ); ?></h4>
  52. <div class="inside event-form-name">
  53. <input type="text" name="event_name" id="event-name" value="<?php echo htmlspecialchars($EM_Event->event_name,ENT_QUOTES); ?>" /><?php echo $required; ?>
  54. <br />
  55. <?php _e ( 'The event name. Example: Birthday party', 'dbem' )?>
  56. <?php em_locate_template('forms/event/group.php',true); ?>
  57. </div>
  58.  
  59. <h4 class="event-form-when"><?php _e ( 'When', 'dbem' ); ?></h4>
  60. <div class="inside event-form-when">
  61. <?php
  62. if( empty($EM_Event->event_id) && $EM_Event->can_manage('edit_recurring_events','edit_others_recurring_events') && get_option('dbem_recurrence_enabled') ){
  63. em_locate_template('forms/event/when-with-recurring.php',true);
  64. }elseif( $EM_Event->is_recurring() ){
  65. em_locate_template('forms/event/recurring-when.php',true);
  66. }else{
  67. em_locate_template('forms/event/when.php',true);
  68. }
  69. ?>
  70. </div>
  71.  
  72. <?php if( get_option('dbem_locations_enabled') ): ?>
  73. <h4 class="event-form-where"><?php _e ( 'Where', 'dbem' ); ?></h4>
  74. <div class="inside event-form-where">
  75. <?php em_locate_template('forms/event/location.php',true); ?>
  76. </div>
  77. <?php endif; ?>
  78.  
  79. <h4 class="event-form-details"><?php _e ( 'Details', 'dbem' ); ?></h4>
  80. <div class="inside event-form-details">
  81. <div class="event-editor">
  82. <?php if( get_option('dbem_events_form_editor') && function_exists('wp_editor') ): ?>
  83. <?php wp_editor($EM_Event->post_content, 'em-editor-content', array('textarea_name'=>'content') ); ?>
  84. <?php else: ?>
  85. <textarea name="content" rows="10" style="width:100%"><?php echo $EM_Event->post_content ?></textarea>
  86. <br />
  87. <?php _e ( 'Details about the event.', 'dbem' )?> <?php _e ( 'HTML allowed.', 'dbem' )?>
  88. <?php endif; ?>
  89. </div>
  90. <div class="event-extra-details">
  91. <?php if(get_option('dbem_categories_enabled')) { em_locate_template('forms/event/attributes-public.php',true); } ?>
  92. <?php if(get_option('dbem_categories_enabled')) { em_locate_template('forms/event/categories-public.php',true); } ?>
  93. </div>
  94. </div>
  95.  
  96. <?php if( $EM_Event->can_manage('upload_event_images','upload_event_images') ): ?>
  97. <h4><?php _e ( 'Event Image', 'dbem' ); ?></h4>
  98. <div class="inside event-form-image">
  99. <?php em_locate_template('forms/event/featured-image-public.php',true); ?>
  100. </div>
  101. <?php endif; ?>
  102.  
  103. <?php if( get_option('dbem_rsvp_enabled') && $EM_Event->can_manage('manage_bookings','manage_others_bookings') ) : ?>
  104. <!-- START Bookings -->
  105. <h4><?php _e('Bookings/Registration','dbem'); ?></h4>
  106. <div class="inside event-form-bookings">
  107. <?php em_locate_template('forms/event/bookings.php',true); ?>
  108. </div>
  109. <!-- END Bookings -->
  110. <?php endif; ?>
  111.  
  112. <?php do_action('em_front_event_form_footer'); ?>
  113. </div>
  114. <p class="submit">
  115. <input type="submit" name="events_update" value="<?php _e ( 'Submit Event', 'dbem' ); ?> &raquo;" />
  116. </p>
  117. <input type="hidden" name="event_id" value="<?php echo $EM_Event->event_id; ?>" />
  118. <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('wpnonce_event_save'); ?>" />
  119. <input type="hidden" name="action" value="event_save" />
  120. <?php if( !empty($_REQUEST['redirect_to']) ): ?>
  121. <input type="hidden" name="redirect_to" value="<?php echo $_REQUEST['redirect_to']; ?>" />
  122. <?php endif; ?>
  123. </form>
  124. <?php
  125. if( get_option('dbem_rsvp_enabled') && !(get_option('dbem_bookings_tickets_single') && count($EM_Tickets->tickets) == 1) ){
  126. em_locate_template('forms/tickets-form.php', true); //put here as it can't be in the add event form
  127. }
  128. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement