SHARE
TWEET

Event Submission Form with Tag

eventsmanager Apr 2nd, 2019 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Custom events-manager/templates/forms/event-editor.php
  3.  */
  4.  
  5. <?php
  6. /* 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 */
  7. /*
  8.  * To ensure compatability, it is recommended you maintain class, id and form name attributes, unless you now what you're doing.
  9.  * You also must keep the _wpnonce hidden field in this form too.
  10.  */
  11. global $EM_Event, $EM_Notices, $bp;
  12.  
  13. //check that user can access this page
  14. if( is_object($EM_Event) && !$EM_Event->can_manage('edit_events','edit_others_events') ){
  15.     ?>
  16.     <div class="wrap"><h2><?php esc_html_e('Unauthorized Access','events-manager'); ?></h2><p><?php echo sprintf(__('You do not have the rights to manage this %s.','events-manager'),__('Event','events-manager')); ?></p></div>
  17.     <?php
  18.     return false;
  19. }elseif( !is_object($EM_Event) ){
  20.     $EM_Event = new EM_Event();
  21. }
  22. $required = apply_filters('em_required_html','<i>*</i>');
  23.  
  24. echo $EM_Notices;
  25. //Success notice
  26. if( !empty($_REQUEST['success']) ){
  27.     if(!get_option('dbem_events_form_reshow')) return false;
  28. }
  29. ?> 
  30. <form enctype='multipart/form-data' id="event-form" class="em-event-admin-editor <?php if( $EM_Event->is_recurring() ) echo 'em-event-admin-recurring' ?>" method="post" action="<?php echo esc_url(add_query_arg(array('success'=>null))); ?>">
  31.     <div class="wrap">
  32.         <?php do_action('em_front_event_form_header', $EM_Event); ?>
  33.         <?php if(get_option('dbem_events_anonymous_submissions') && !is_user_logged_in()): ?>
  34.             <h3 class="event-form-submitter"><?php esc_html_e( 'Your Details', 'events-manager'); ?></h3>
  35.             <div class="inside event-form-submitter">
  36.                 <p>
  37.                     <label><?php esc_html_e('Name', 'events-manager'); ?></label>
  38.                     <input type="text" name="event_owner_name" id="event-owner-name" value="<?php echo esc_attr($EM_Event->event_owner_name); ?>" />
  39.                 </p>
  40.                 <p>
  41.                     <label><?php esc_html_e('Email', 'events-manager'); ?></label>
  42.                     <input type="text" name="event_owner_email" id="event-owner-email" value="<?php echo esc_attr($EM_Event->event_owner_email); ?>" />
  43.                 </p>
  44.                 <?php do_action('em_front_event_form_guest'); ?>
  45.                 <?php do_action('em_font_event_form_guest'); //deprecated ?>
  46.             </div>
  47.         <?php endif; ?>
  48.         <h3 class="event-form-name"><?php esc_html_e( 'Event Name', 'events-manager'); ?></h3>
  49.         <div class="inside event-form-name">
  50.             <input type="text" name="event_name" id="event-name" value="<?php echo esc_attr($EM_Event->event_name,ENT_QUOTES); ?>" /><?php echo $required; ?>
  51.             <br />
  52.             <?php esc_html_e('The event name. Example: Birthday party', 'events-manager'); ?>
  53.             <?php em_locate_template('forms/event/group.php',true); ?>
  54.         </div>
  55.                    
  56.         <h3 class="event-form-when"><?php esc_html_e( 'When', 'events-manager'); ?></h3>
  57.         <div class="inside event-form-when">
  58.         <?php
  59.             if( empty($EM_Event->event_id) && $EM_Event->can_manage('edit_recurring_events','edit_others_recurring_events') && get_option('dbem_recurrence_enabled') ){
  60.                 em_locate_template('forms/event/when-with-recurring.php',true);
  61.             }elseif( $EM_Event->is_recurring()  ){
  62.                 em_locate_template('forms/event/recurring-when.php',true);
  63.             }else{
  64.                 em_locate_template('forms/event/when.php',true);
  65.             }
  66.         ?>
  67.         </div>
  68.  
  69.         <?php if( get_option('dbem_locations_enabled') ): ?>
  70.         <h3 class="event-form-where"><?php esc_html_e( 'Where', 'events-manager'); ?></h3>
  71.         <div class="inside event-form-where">
  72.         <?php em_locate_template('forms/event/location.php',true); ?>
  73.         </div>
  74.         <?php endif; ?>
  75.        
  76.         <h3 class="event-form-details"><?php esc_html_e( 'Details', 'events-manager'); ?></h3>
  77.         <div class="inside event-form-details">
  78.             <div class="event-editor">
  79.                 <?php if( get_option('dbem_events_form_editor') && function_exists('wp_editor') ): ?>
  80.                     <?php wp_editor($EM_Event->post_content, 'em-editor-content', array('textarea_name'=>'content') ); ?>
  81.                 <?php else: ?>
  82.                     <textarea name="content" rows="10" style="width:100%"><?php echo $EM_Event->post_content ?></textarea>
  83.                     <br />
  84.                     <?php esc_html_e( 'Details about the event.', 'events-manager')?> <?php esc_html_e( 'HTML allowed.', 'events-manager')?>
  85.                 <?php endif; ?>
  86.             </div>
  87.             <div class="event-extra-details">
  88.                 <?php if(get_option('dbem_attributes_enabled')) { em_locate_template('forms/event/attributes-public.php',true); }  ?>
  89.                 <?php
  90.                     if(get_option('dbem_categories_enabled')) {
  91.                         em_locate_template('forms/event/categories-public.php',true);
  92.                     ?>
  93.                         <div class="event-categories">
  94.                            
  95.                             <label for="event_tags[]"><?php _e ( 'Tag:', 'events-manager'); ?></label>
  96.                            
  97.                             <select name="event_tags[]">
  98.                             <?php
  99.                                 $tags = get_categories( array('taxonomy' => EM_TAXONOMY_TAG, 'hide_empty' => false ) );
  100.                                
  101.                                 foreach($tags as $tag):
  102.                                
  103.                             ?>
  104.                             <option value="<?= $tag->name ?>" > <?= $tag->name ?> </option>
  105.                             <?php
  106.                                 endforeach;
  107.                             ?>
  108.                             </select>
  109.                            
  110.                            
  111.                            
  112.                         </div>
  113.                     <?php
  114.                            
  115.                        
  116.                         /* TAGS */
  117.                        
  118.                     }  
  119.                 ?>
  120.             </div>
  121.         </div>
  122.        
  123.         <?php if( $EM_Event->can_manage('upload_event_images','upload_event_images') ): ?>
  124.         <h3><?php esc_html_e( 'Event Image', 'events-manager'); ?></h3>
  125.         <div class="inside event-form-image">
  126.             <?php em_locate_template('forms/event/featured-image-public.php',true); ?>
  127.         </div>
  128.         <?php endif; ?>
  129.        
  130.         <?php if( get_option('dbem_rsvp_enabled') && $EM_Event->can_manage('manage_bookings','manage_others_bookings') ) : ?>
  131.         <!-- START Bookings -->
  132.         <h3><?php esc_html_e('Bookings/Registration','events-manager'); ?></h3>
  133.         <div class="inside event-form-bookings">               
  134.             <?php em_locate_template('forms/event/bookings.php',true); ?>
  135.         </div>
  136.         <!-- END Bookings -->
  137.         <?php endif; ?>
  138.        
  139.         <?php do_action('em_front_event_form_footer', $EM_Event); ?>
  140.     </div>
  141.     <p class="submit">
  142.         <?php if( empty($EM_Event->event_id) ): ?>
  143.         <input type='submit' class='button-primary' value='<?php echo esc_attr(sprintf( __('Submit %s','events-manager'), __('Event','events-manager') )); ?>' />
  144.         <?php else: ?>
  145.         <input type='submit' class='button-primary' value='<?php echo esc_attr(sprintf( __('Update %s','events-manager'), __('Event','events-manager') )); ?>' />
  146.         <?php endif; ?>
  147.     </p>
  148.     <input type="hidden" name="event_id" value="<?php echo $EM_Event->event_id; ?>" />
  149.     <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce('wpnonce_event_save'); ?>" />
  150.     <input type="hidden" name="action" value="event_save" />
  151.     <?php if( !empty($_REQUEST['redirect_to']) ): ?>
  152.     <input type="hidden" name="redirect_to" value="<?php echo esc_attr($_REQUEST['redirect_to']); ?>" />
  153.     <?php endif; ?>
  154. </form>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top