function output($format, $target = "html")
 {
     preg_match_all("/(#@?_?[A-Za-z0-9]+)({([^}]+)})?/", $format, $placeholders);
     $output_string = $format;
     $replaces = array();
     foreach ($placeholders[1] as $key => $result) {
         $replace = '';
         $full_result = $placeholders[0][$key];
         switch ($result) {
             case '#_BOOKINGTICKETNAME':
             case '#_BOOKINGTICKETDESCRIPTION':
             case '#_BOOKINGTICKETPRICEWITHTAX':
             case '#_BOOKINGTICKETPRICEWITHOUTTAX':
             case '#_BOOKINGTICKETTAX':
             case '#_BOOKINGTICKETPRICE':
                 $replace = '';
                 //this booking object doesn't have 'tickets', all these become defunct
                 break;
             case '#_BOOKINGTICKETS':
                 //change how this placeholder displays, for backwards compatability
                 ob_start();
                 emp_locate_template('placeholders/bookingtickets-multiple.php', true, array('EM_Multiple_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             case '#_BOOKINGSUMMARY':
                 //change how this placeholder displays, for backwards compatability
                 ob_start();
                 emp_locate_template('placeholders/bookingsummary-multiple.php', true, array('EM_Multiple_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             case '#_BOOKINGATTENDEES':
                 //change how this placeholder displays, for backwards compatability
                 ob_start();
                 emp_locate_template('placeholders/bookingattendees-multiple.php', true, array('EM_Multiple_Booking' => $this));
                 $replace = ob_get_clean();
                 break;
             default:
                 $replace = $full_result;
                 break;
         }
         $replaces[$full_result] = apply_filters('em_multiple_booking_output_placeholder', $replace, $this, $full_result, $target);
     }
     //sort out replacements so that during replacements shorter placeholders don't overwrite longer varieties.
     krsort($replaces);
     foreach ($replaces as $full_result => $replacement) {
         $output_string = str_replace($full_result, $replacement, $output_string);
     }
     $output_string = parent::output($output_string, $target);
     //run through original booking object for commonly used fields
     return apply_filters('em_multiple_booking_output', $output_string, $this, $format, $target);
 }
    public static function booking_admin()
    {
        emp_locate_template('multiple-bookings/admin.php', true);
        if (!defined('EM_CART_JS_LOADED')) {
            //load
            function em_cart_js_footer()
            {
                ?>
				<script type="text/javascript">
					<?php 
                include 'multiple-bookings.js';
                ?>
				</script>
				<?php 
            }
            add_action('wp_footer', 'em_cart_js_footer', 20);
            add_action('admin_footer', 'em_cart_js_footer', 20);
            define('EM_CART_JS_LOADED', true);
        }
    }
Ejemplo n.º 3
0
?>
'/>
							<p><em><?php 
echo wp_kses_data(__('<strong>Warning:</strong> Status changes made here will be applied to all the bookings below.', 'em-pro'));
?>
</em>
							<br /><em><?php 
echo wp_kses_data(__emp('<strong>Notes:</strong> Ticket availability not taken into account when approving new bookings (i.e. you can overbook).', 'dbem'));
?>
</em>
							</p>
						</form>
					</div>
					<form action="" method="post" class="em-booking-form">
						<?php 
emp_locate_template('multiple-bookings/admin-cart-table.php', true, array('EM_Multiple_Booking' => $EM_Multiple_Booking));
?>
						<table class="em-form-fields" cellspacing="0" cellpadding="0">
							<div class="em-booking-single-edit">
								<p><em><?php 
_e('You are editing the information supplied no the checkout form. To edit information about a specific booking, including the data entered in that booking form, click the edit link on your bookings above.', 'em-pro');
?>
</em></p>
							</div>
							<?php 
do_action('em_bookings_single_custom', $EM_Multiple_Booking);
//do your own thing, e.g. pro
?>
						</table>
						<p class="em-booking-single-info">
							<input type="button" class="em-booking-submit-modify" id="em-booking-submit-modify" value="<?php 
Ejemplo n.º 4
0
?>
<div id="em-booking" class="em-booking <?php 
if (get_option('dbem_css_rsvp')) {
    echo 'css-booking';
}
?>
">
	<?php 
global $EM_Notices;
echo $EM_Notices;
do_action('em_checkout_form_before_summary', $EM_Multiple_Booking);
//do not delete
?>
	<div class="em-cart-table-contents">
		<?php 
emp_locate_template('multiple-bookings/cart-table.php', true);
?>
	</div>
	<?php 
do_action('em_checkout_form_after_summary', $EM_Multiple_Booking);
//do not delete
?>
		
	<form id='em-booking-form' class="em-booking-form" name='booking-form' method='post' action='<?php 
echo apply_filters('em_checkout_form_action_url', '');
?>
#em-booking'>
	 	<input type='hidden' name='action' value='emp_checkout'/>
	 	<input type='hidden' name='_wpnonce' value='<?php 
echo wp_create_nonce('emp_checkout');
?>
<?php

/*
* This displays the content of the #_BOOKINGATTENDEES placeholder in Multiple Bookings mode.
* You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager-pro/placeholders/ and modifying it however you need.
* For more information, see http://wp-events-plugin.com/documentation/using-template-files/
*/
foreach ($EM_Multiple_Booking->get_bookings() as $EM_Booking) {
    /* @var $EM_Booking EM_Booking */
    echo "\r\n" . __emp('Event', 'dbem') . ' - ' . $EM_Booking->get_event()->event_name . "\r\n" . '==============================';
    emp_locate_template('placeholders/bookingattendees.php', true, array('EM_Booking' => $EM_Booking));
}
 /**
  * @param string $replace
  * @param EM_Booking $EM_Booking
  * @param string $full_result
  * @return string
  */
 public static function placeholders($replace, $EM_Booking, $full_result)
 {
     if (empty($replace) || $replace == $full_result) {
         $user = $EM_Booking->get_person();
         $EM_Form = self::get_form($EM_Booking->event_id);
         if ($full_result == '#_BOOKINGATTENDEES') {
             $replace = '';
             ob_start();
             emp_locate_template('placeholders/bookingattendees.php', true, array('EM_Booking' => $EM_Booking));
             $replace = ob_get_clean();
         }
     }
     return $replace;
     //no need for a filter, use the em_booking_email_placeholders filter
 }