public static function location_meta_box_attributes()
 {
     global $EM_Location;
     //get original location for attributes
     $location = EM_ML::get_original_location($EM_Location);
     EM_ML_IO::location_merge_original_attributes($EM_Location, $location);
     em_locate_template('forms/location/attributes.php', true);
 }
Exemple #2
0
 /**
  * Hooks into em_event_get_post and writes the original event translation data into the current event, to avoid validation errors and correct data saving.
  * @param boolean $result
  * @param EM_Event $EM_Event
  * @return boolean
  */
 public static function event_get_post_meta($result, $EM_Event)
 {
     //check if this is a master event, if not then we need to get the relevant master event info and populate this object with it so it passes validation and saves correctly.
     if (!EM_ML::is_original($EM_Event)) {
         //get original event object
         $event = EM_ML::get_original_event($EM_Event);
         EM_ML_IO::event_merge_original_meta($EM_Event, $event);
         if ($EM_Event->location_id == 0) {
             $_POST['no_location'] = 1;
         }
         // We need to save ticket translations here as well to the ticket objects
         foreach ($EM_Event->get_tickets()->tickets as $EM_Ticket) {
             /* @var $EM_Ticket EM_Ticket */
             $ticket_translation = array();
             if (!empty($_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_name'])) {
                 $ticket_translation['ticket_name'] = wp_kses_data(stripslashes($_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_name']));
             }
             if (!empty($_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_description'])) {
                 $ticket_translation['ticket_description'] = wp_kses_post(stripslashes($_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_description']));
             }
             if (!empty($ticket_translation)) {
                 $EM_Ticket->ticket_meta['langs'][EM_ML::$current_language] = $ticket_translation;
             }
         }
     } elseif (!empty($EM_Event->location_id)) {
         //we need to make sure the location is the original location
         $EM_Location = $EM_Event->get_location();
         if (!EM_ML::is_original($EM_Location)) {
             $EM_Event->location_id = EM_ML::get_original_location($EM_Location)->location_id;
         }
     }
     return $result;
 }
            $EM_Event->event_rsvp_date = $event->event_rsvp_date;
            $EM_Event->event_rsvp = $event->event_rsvp;
            $EM_Event->event_rsvp_time = $event->event_rsvp_time;
            $EM_Event->blog_id = $event->blog_id;
            $EM_Event->group_id = $event->group_id;
            $EM_Event->recurrence = $event->recurrence;
            $EM_Event->recurrence_freq = $event->recurrence_freq;
            $EM_Event->recurrence_byday = $event->recurrence_byday;
            $EM_Event->recurrence_interval = $event->recurrence_interval;
            $EM_Event->recurrence_byweekno = $event->recurrence_byweekno;
            $EM_Event->recurrence_days = $event->recurrence_days;
            // We need to save ticket translations here as well to the ticket objects
            foreach ($EM_Event->get_tickets()->tickets as $EM_Ticket) {
                /* @var $EM_Ticket EM_Ticket */
                $ticket_translation = array();
                if (!empty($_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_name'])) {
                    $ticket_translation['ticket_name'] = $_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_name'];
                }
                if (!empty($_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_description'])) {
                    $ticket_translation['ticket_description'] = $_REQUEST['ticket_translations'][$EM_Ticket->ticket_id]['ticket_description'];
                }
                if (!empty($ticket_translation)) {
                    $EM_Ticket->ticket_meta['langs'][EM_ML::$current_language] = $ticket_translation;
                }
            }
        }
        return $result;
    }
}
EM_ML_IO::init();