/**
  * For adding any html output ab ove the payment overview.
  * Many gateways won't want ot display anything, so this function just returns an empty string.
  * Other gateways may want to override this, such as offline gateways.
  * @return string
  */
 public function payment_overview_content(EE_Payment $payment)
 {
     EE_Registry::instance()->load_helper('Template');
     $extra_meta_for_payment_method = $this->_pm_instance->all_extra_meta_array();
     $template_vars = array_merge(array('payment_method' => $this->_pm_instance, 'payment' => $payment, 'page_title' => '', 'payment_instructions' => ''), $extra_meta_for_payment_method);
     return EEH_Template::display_template($this->_file_folder . 'templates' . DS . 'bank_payment_details_content.template.php', $template_vars, true);
 }
 /**
  * 	template_settings_form
  *
  *  @access 	public
  *  @static
  *  @return 	void
  */
 public static function template_settings_form()
 {
     $EE = EE_Registry::instance();
     $EE->CFG->template_settings->EED_Event_Single = isset($EE->CFG->template_settings->EED_Event_Single) ? $EE->CFG->template_settings->EED_Event_Single : new EE_Event_Single_Config();
     $EE->CFG->template_settings->EED_Event_Single = apply_filters('FHEE__EED_Event_Single__template_settings_form__event_list_config', $EE->CFG->template_settings->EED_Event_Single);
     EEH_Template::display_template(EVENT_SINGLE_CAFF_TEMPLATES_PATH . 'admin-event-single-settings.template.php', $EE->CFG->template_settings->EED_Event_Single);
 }
 function category_color_widget()
 {
     if (isset($this->_req_data['EVT_CAT_ID'])) {
         $CAT_ID = $this->_req_data['EVT_CAT_ID'];
         $category = EEM_Term::instance()->get_one_by_ID($CAT_ID);
     } else {
         $category = null;
     }
     $use_color_picker = false;
     $default_background_color = '#eeeeee';
     $default_text_color = '#444444';
     if ($category) {
         $use_color_picker = $category->get_extra_meta('use_color_picker', true, false);
         $background_color = $category->get_extra_meta('background_color', true, $default_background_color);
         $text_color = $category->get_extra_meta('text_color', true, $default_text_color);
     } else {
         $background_color = $default_background_color;
         $text_color = $default_text_color;
     }
     $template_args = array();
     $template_args['use_color_picker'] = $use_color_picker;
     $template_args['background_color'] = $background_color;
     $template_args['text_color'] = $text_color;
     $template_args['default_background_color'] = $default_background_color;
     $template_args['default_text_color'] = $default_text_color;
     EEH_Template::display_template(EE_CALENDAR_ADMIN_TEMPLATE_PATH . 'category_color_for_calendar.template.php', $template_args);
 }
 protected function _credits()
 {
     //	$this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION );
     $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso');
     $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php';
     $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE);
     $this->display_about_admin_page();
 }
 /**
  * debug_logging_options
  *
  * @param array $template_args
  * @return void
  */
 public function debug_logging_options($template_args = array())
 {
     $template_args['use_full_logging'] = EE_Registry::instance()->CFG->admin->use_full_logging;
     $template_args['use_remote_logging'] = isset(EE_Registry::instance()->CFG->admin->use_remote_logging) ? absint(EE_Registry::instance()->CFG->admin->use_remote_logging) : FALSE;
     $template_args['remote_logging_url'] = isset(EE_Registry::instance()->CFG->admin->remote_logging_url) && !empty(EE_Registry::instance()->CFG->admin->remote_logging_url) ? stripslashes(EE_Registry::instance()->CFG->admin->remote_logging_url) : '';
     $template = GEN_SET_CAF_TEMPLATE_PATH . 'debug_log_settings.template.php';
     EEH_Template::display_template($template, $template_args);
 }
 /**
  * 		display_country_states
  *
  * 		@access 	public
  * 		@param 	string 		$CNT_ISO
  * 		@return 		string
  */
 public function display_country_states($CNT_ISO = '')
 {
     $CNT_ISO = isset($this->_req_data['country']) ? sanitize_text_field($this->_req_data['country']) : $CNT_ISO;
     if (!$CNT_ISO) {
         return '';
     }
     // for ajax
     remove_all_filters('FHEE__EEH_Form_Fields__label_html');
     remove_all_filters('FHEE__EEH_Form_Fields__input_html');
     add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'state_form_field_label_wrap'), 10, 2);
     add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'state_form_field_input__wrap'), 10, 2);
     $states = EEM_State::instance()->get_all_states_for_these_countries(array($CNT_ISO => $CNT_ISO));
     //			echo '<h4>$CNT_ISO : ' . $CNT_ISO . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
     //			global $wpdb;
     //			echo '<h4>' . $wpdb->last_query . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
     //			EEH_Debug_Tools::printr( $states, '$states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
     if ($states) {
         foreach ($states as $STA_ID => $state) {
             if ($state instanceof EE_State) {
                 //STA_abbrev 	STA_name 	STA_active
                 $state_input_types = array('STA_abbrev' => array('type' => 'TEXT', 'input_name' => 'states[' . $STA_ID . ']', 'class' => 'mid-text'), 'STA_name' => array('type' => 'TEXT', 'input_name' => 'states[' . $STA_ID . ']', 'class' => 'regular-text'), 'STA_active' => array('type' => 'RADIO_BTN', 'input_name' => 'states[' . $STA_ID . ']', 'options' => $this->_yes_no_values, 'use_desc_4_label' => true));
                 $this->_template_args['states'][$STA_ID]['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($state, $state_input_types);
                 $query_args = array('action' => 'delete_state', 'STA_ID' => $STA_ID, 'CNT_ISO' => $CNT_ISO, 'STA_abbrev' => $state->abbrev());
                 $this->_template_args['states'][$STA_ID]['delete_state_url'] = EE_Admin_Page::add_query_args_and_nonce($query_args, GEN_SET_ADMIN_URL);
             }
         }
     } else {
         $this->_template_args['states'] = FALSE;
     }
     //		EEH_Debug_Tools::printr( $this->_template_args['states'], 'states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
     $this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'add_new_state'), GEN_SET_ADMIN_URL);
     $state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'state_details_settings.template.php', $this->_template_args, TRUE);
     if (defined('DOING_AJAX')) {
         $notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
         echo json_encode(array('return_data' => $state_details_settings, 'success' => $notices['success'], 'errors' => $notices['errors']));
         die;
     } else {
         return $state_details_settings;
     }
 }
 protected function _term_object_details_content($taxonomy = 'espresso_people_categories')
 {
     $editor_args['category_desc'] = array('type' => 'wp_editor', 'value' => EEH_Formatter::admin_format_content($this->_term_object->category_desc), 'class' => 'my_editor_custom', 'wpeditor_args' => array('media_buttons' => FALSE));
     $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
     $all_terms = get_terms(array($taxonomy), array('hide_empty' => 0, 'exclude' => array($this->_term_object->id)));
     //setup category select for term parents.
     $category_select_values[] = array('text' => __('No Parent', 'event_espresso'), 'id' => 0);
     foreach ($all_terms as $term) {
         $category_select_values[] = array('text' => $term->name, 'id' => $term->term_id);
     }
     $category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_term_object->parent);
     $template_args = array('category' => $this->_term_object, 'category_select' => $category_select, 'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'), 'category_desc_editor' => $_wp_editor['category_desc']['field'], 'disable' => '', 'disabled_message' => FALSE, 'term_name_label' => $taxonomy == 'espresso_people_categories' ? __('Category Name', 'event_espresso') : __('Type Name', 'event_espresso'), 'term_id_description' => $taxonomy == 'espresso_people_categories' ? __('This is a default category so you can edit the label and the description but not the slug', 'event_espresso') : __('This is a default type so you can edit the label and the description but not the slug', 'event_espresso'), 'term_parent_label' => $taxonomy == 'espresso_people_categories' ? __('Category Parent', 'event_espresso') : __('Type Parent', 'event_espresso'), 'term_parent_description' => $taxonomy == 'espresso_people_categories' ? __('Categories are hierarchical.  You can change the parent for this category here.', 'event_espresso') : __('People Types are hierarchical.  You can change the parent for this type here.', 'event_espresso'), 'term_description_label' => $taxonomy == 'espresso_people_categories' ? __('Category Description', 'event_espresso') : __('Type Description'));
     $template = EEA_PEOPLE_ADDON_ADMIN_TEMPLATE_PATH . 'people_term_details.template.php';
     return EEH_Template::display_template($template, $template_args, TRUE);
 }
 /**
  * For adding any html output ab ove the payment overview.
  * Many gateways won't want ot display anything, so this function just returns an empty string.
  * Other gateways may want to override this, such as offline gateways.
  * @param EE_Payment $payment
  * @return string
  */
 public function payment_overview_content(EE_Payment $payment)
 {
     EE_Registry::instance()->load_helper('Template');
     return EEH_Template::display_template(EE_LIBRARIES . 'payment_methods' . DS . 'templates' . DS . 'payment_details_content.template.php', array('payment_method' => $this->_pm_instance, 'payment' => $payment), true);
 }
 /**
  * add in the form fields for the attendee edit
  * @param  WP_Post $post wp post object
  * @return string        html for new form.
  */
 public function after_title_form_fields($post)
 {
     if ($post->post_type == 'espresso_attendees') {
         $template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php';
         $template_args['attendee'] = $this->_cpt_model_obj;
         EEH_Template::display_template($template, $template_args);
     }
 }
 protected function _get_ticket_js_structure($all_dtts, $all_tickets)
 {
     $template_args = array('default_datetime_edit_row' => $this->_get_dtt_edit_row('DTTNUM', NULL, TRUE, $all_dtts), 'default_ticket_row' => $this->_get_ticket_row('TICKETNUM', NULL, array(), array(), TRUE), 'default_price_row' => $this->_get_ticket_price_row('TICKETNUM', 'PRICENUM', NULL, TRUE, NULL), 'default_price_rows' => '', 'default_base_price_amount' => 0, 'default_base_price_name' => '', 'default_base_price_description' => '', 'default_price_modifier_selector_row' => $this->_get_price_modifier_template('TICKETNUM', 'PRICENUM', NULL, TRUE), 'default_available_tickets_for_datetime' => $this->_get_dtt_attached_tickets_row('DTTNUM', NULL, array(), array(), TRUE), 'existing_available_datetime_tickets_list' => '', 'existing_available_ticket_datetimes_list' => '', 'new_available_datetime_ticket_list_item' => $this->_get_datetime_tickets_list_item('DTTNUM', 'TICKETNUM', NULL, NULL, array(), TRUE), 'new_available_ticket_datetime_list_item' => $this->_get_ticket_datetime_list_item('DTTNUM', 'TICKETNUM', NULL, NULL, array(), TRUE));
     $tktrow = 1;
     foreach ($all_tickets as $ticket) {
         $template_args['existing_available_datetime_tickets_list'] .= $this->_get_datetime_tickets_list_item('DTTNUM', $tktrow, NULL, $ticket, array(), TRUE);
         $tktrow++;
     }
     $dttrow = 1;
     foreach ($all_dtts as $dtt) {
         $template_args['existing_available_ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item($dttrow, 'TICKETNUM', $dtt, NULL, array(), TRUE);
         $dttrow++;
     }
     $default_prices = EE_Registry::instance()->load_model('Price')->get_all_default_prices();
     $prcrow = 1;
     foreach ($default_prices as $price) {
         if ($price->is_base_price()) {
             $template_args['default_base_price_amount'] = $price->get_pretty('PRC_amount', 'localized_float');
             $template_args['default_base_price_name'] = $price->get('PRC_name');
             $template_args['default_base_price_description'] = $price->get('PRC_desc');
             $prcrow++;
             continue;
         }
         $show_trash = count($default_prices) > 1 && $prcrow === 1 || count($default_prices) === 1 ? FALSE : TRUE;
         $show_create = count($default_prices) > 1 && count($default_prices) !== $prcrow ? FALSE : TRUE;
         $template_args['default_price_rows'] .= $this->_get_ticket_price_row('TICKETNUM', $prcrow, $price, TRUE, NULL, $show_trash, $show_create);
         $prcrow++;
     }
     $template_args = apply_filters('FHEE__espresso_events_Pricing_Hooks___get_ticket_js_structure__template_args', $template_args, $all_dtts, $all_tickets, $this->_is_creating_event);
     $template = PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_js_structure.template.php';
     return EEH_Template::display_template($template, $template_args, TRUE);
 }
 /**
  * This is the dynamic method for this class that will end up hooking into the 'admin_footer' hook on the 'edit_event' route in the events page.
  * @return string (admin_footer contents)
  */
 public function edit_admin_footer()
 {
     $template_path = EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/create_custom_template_form.template.php';
     EEH_Template::display_template($template_path, array());
 }
 /**
  *		generates  HTML wrapper with Tabbed nav for an admin page
  *		@access public
  *		@param  boolean $about whether to use the special about page wrapper or default.
  *		@return void
  */
 public function admin_page_wrapper($about = FALSE)
 {
     do_action('AHEE_log', __FILE__, __FUNCTION__, '');
     $this->_nav_tabs = $this->_get_main_nav_tabs();
     $this->_template_args['nav_tabs'] = $this->_nav_tabs;
     $this->_template_args['admin_page_title'] = $this->_admin_page_title;
     $this->_template_args['before_admin_page_content'] = apply_filters('FHEE_before_admin_page_content' . $this->_current_page . $this->_current_view, isset($this->_template_args['before_admin_page_content']) ? $this->_template_args['before_admin_page_content'] : '');
     $this->_template_args['after_admin_page_content'] = apply_filters('FHEE_after_admin_page_content' . $this->_current_page . $this->_current_view, isset($this->_template_args['after_admin_page_content']) ? $this->_template_args['after_admin_page_content'] : '');
     $this->_template_args['after_admin_page_content'] .= $this->_set_help_popup_content();
     // load settings page wrapper template
     $template_path = !defined('DOING_AJAX') ? EE_ADMIN_TEMPLATE . 'admin_wrapper.template.php' : EE_ADMIN_TEMPLATE . 'admin_wrapper_ajax.template.php';
     //about page?
     $template_path = $about ? EE_ADMIN_TEMPLATE . 'about_admin_wrapper.template.php' : $template_path;
     if (defined('DOING_AJAX')) {
         $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
         $this->_return_json();
     } else {
         EEH_Template::display_template($template_path, $this->_template_args);
     }
 }
 public function venue_metabox()
 {
     $values = array(array('id' => true, 'text' => __('Yes', 'event_espresso')), array('id' => false, 'text' => __('No', 'event_espresso')));
     $evt_obj = $this->_adminpage_obj->get_event_object();
     $evt_id = $evt_obj->ID();
     //first let's see if we have a venue already
     $evt_venues = !empty($evt_id) ? $evt_obj->venues() : array();
     $evt_venue = $evt_venues && is_array($evt_venues) ? reset($evt_venues) : null;
     $evt_venue_id = $evt_venue instanceof EE_Venue ? $evt_venue->ID() : null;
     //possibly private venues.
     if (EE_Registry::instance()->CAP->current_user_can('ee_read_private_venues', 'get_venues')) {
         $vnu_where['status'] = array('IN', array('publish', 'private'));
     } else {
         $vnu_where['status'] = 'publish';
     }
     //cap checks
     if (!EE_Registry::instance()->CAP->current_user_can('ee_read_others_venues', 'get_venues')) {
         $vnu_where['VNU_wp_user'] = get_current_user_id();
     }
     $vnumdl = EE_Registry::instance()->load_model('Venue');
     $venues = $vnumdl->get_all(array($vnu_where, 'order_by' => array('VNU_name' => 'ASC')));
     $ven_select = array();
     $ven_select[0] = __('Select a Venue', 'event_espresso');
     //setup venues for selector
     foreach ($venues as $venue) {
         $ven_select[$venue->ID()] = $venue->name();
     }
     //if $ven_select does not have the existing venue attached to event then let's add that because we'll always
     //show existing attached venues even if it's trashed (or some other restricted status).
     if ($evt_venue_id && !isset($ven_select[$evt_venue_id])) {
         $ven_select[$evt_venue_id] = $evt_venue->name();
         $venues = array_merge($venues, array($evt_venue));
     }
     $template_args['venues'] = $venues;
     $template_args['evt_venue_id'] = $evt_venue_id;
     $template_args['venue_selector'] = EEH_Form_Fields::select_input('venue_id', $ven_select, $evt_venue_id, 'id="venue_id"');
     $template_args['enable_for_gmap'] = EEH_Form_Fields::select_input('enable_for_gmap', $values, is_object($evt_venue) ? $evt_venue->enable_for_gmap() : NULL, 'id="enable_for_gmap"');
     $template_path = empty($venues) ? EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content.template.php' : EE_VENUES_TEMPLATE_PATH . 'event_venues_metabox_content_from_manager.template.php';
     EEH_Template::display_template($template_path, $template_args);
 }
 protected function _reg_form_settings()
 {
     $this->_template_args['values'] = $this->_yes_no_values;
     $this->_template_args['use_captcha'] = isset(EE_Registry::instance()->CFG->registration->use_captcha) ? EE_Registry::instance()->CFG->registration->use_captcha : FALSE;
     $this->_template_args['show_captcha_settings'] = $this->_template_args['use_captcha'] ? 'style="display:table-row;"' : '';
     $this->_template_args['recaptcha_publickey'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_publickey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_publickey) : '';
     $this->_template_args['recaptcha_privatekey'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) ? stripslashes(EE_Registry::instance()->CFG->registration->recaptcha_privatekey) : '';
     $this->_template_args['recaptcha_width'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_width) ? absint(EE_Registry::instance()->CFG->registration->recaptcha_width) : 500;
     $this->_template_args['recaptcha_theme_options'] = array(array('id' => 'red', 'text' => __('Red', 'event_espresso')), array('id' => 'white', 'text' => __('White', 'event_espresso')), array('id' => 'blackglass', 'text' => __('Blackglass', 'event_espresso')), array('id' => 'clean', 'text' => __('Clean', 'event_espresso')));
     $this->_template_args['recaptcha_theme'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_theme) ? EE_Registry::instance()->CFG->registration->get_pretty('recaptcha_theme') : 'clean';
     $this->_template_args['recaptcha_language_options'] = array(array('id' => 'en', 'text' => __('English', 'event_espresso')), array('id' => 'es', 'text' => __('Spanish', 'event_espresso')), array('id' => 'nl', 'text' => __('Dutch', 'event_espresso')), array('id' => 'fr', 'text' => __('French', 'event_espresso')), array('id' => 'de', 'text' => __('German', 'event_espresso')), array('id' => 'pt', 'text' => __('Portuguese', 'event_espresso')), array('id' => 'ru', 'text' => __('Russian', 'event_espresso')), array('id' => 'tr', 'text' => __('Turkish', 'event_espresso')));
     $this->_template_args['recaptcha_language'] = isset(EE_Registry::instance()->CFG->registration->recaptcha_language) ? EE_Registry::instance()->CFG->registration->recaptcha_language : 'en';
     $this->_set_add_edit_form_tags('update_reg_form_settings');
     $this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE);
     $this->_template_args['admin_page_content'] = EEH_Template::display_template(REGISTRATION_FORM_TEMPLATE_PATH . 'reg_form_settings.template.php', $this->_template_args, TRUE);
     $this->display_admin_page_with_sidebar();
 }
 protected function _faq()
 {
     $template_path = EE_SUPPORT_CAF_ADMIN_TEMPLATE_PATH . 'support_admin_details_faq.template.php';
     $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, '', TRUE);
     $this->display_admin_page_with_sidebar();
 }
 /**
  * 	template_settings_form
  *
  *  @access 	public
  *  @static
  *  @return 	void
  */
 public static function template_settings_form()
 {
     // grab general settings admin page and remove the existing hook callback
     $gen_set_admin = EE_Registry::instance()->LIB->EE_Admin_Page_Loader->get_admin_page_object('general_settings');
     if ($gen_set_admin instanceof General_Settings_Admin_Page) {
         remove_action('AHEE__template_settings__template__before_settings_form', array($gen_set_admin, 'template_settings_caff_features'), 100);
     }
     $template_settings = EE_Registry::instance()->CFG->template_settings;
     $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config();
     $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive);
     $events_archive_settings = array('display_status_banner' => 0, 'display_description' => 1, 'display_ticket_selector' => 0, 'display_datetimes' => 1, 'display_venue' => 0, 'display_expired_events' => 0);
     $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive);
     EEH_Template::display_template(EVENTS_ARCHIVE_CAFF_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings);
 }
 /**
  * txn_billing_info_side_meta_box
  * 	generates HTML for the Edit Transaction side meta box
  *
  * @access public
  *	@return void
  */
 public function txn_billing_info_side_meta_box()
 {
     $this->_template_args['billing_form'] = $this->_transaction->billing_info();
     $this->_template_args['billing_form_url'] = add_query_arg(array('action' => 'edit_transaction', 'process' => 'billing'), TXN_ADMIN_URL);
     $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_billing_info.template.php';
     echo EEH_Template::display_template($template_path, $this->_template_args, TRUE);
     /**/
 }
 /**
  * display_recaptcha
  *
  * @access public
  * @return void
  */
 public static function display_recaptcha()
 {
     // logged in means you have already passed a turing test of sorts
     if (is_user_logged_in()) {
         return;
     }
     // don't display if not using recaptcha or user is logged in
     if (EE_Registry::instance()->CFG->registration->use_captcha) {
         // only display if they have NOT passed the test yet
         if (!EED_Recaptcha::$_not_a_robot) {
             EEH_Template::display_template(RECAPTCHA_BASE_PATH . DS . 'templates' . DS . 'recaptcha.template.php', array('recaptcha_publickey' => EE_Registry::instance()->CFG->registration->recaptcha_publickey, 'recaptcha_theme' => EE_Registry::instance()->CFG->registration->recaptcha_theme, 'recaptcha_type' => EE_Registry::instance()->CFG->registration->recaptcha_type));
             wp_enqueue_script('google_recaptcha');
         }
     }
 }
 protected function _payment_log_details()
 {
     EE_Registry::instance()->load_model('Change_Log');
     /** @var $payment_log EE_Change_Log */
     $payment_log = EEM_Change_Log::instance()->get_one_by_ID($this->_req_data['ID']);
     $payment_method = NULL;
     $transaction = NULL;
     if ($payment_log instanceof EE_Change_Log) {
         if ($payment_log->object() instanceof EE_Payment) {
             $payment_method = $payment_log->object()->payment_method();
             $transaction = $payment_log->object()->transaction();
         } elseif ($payment_log->object() instanceof EE_Payment_Method) {
             $payment_method = $payment_log->object();
         }
     }
     $this->_template_args['admin_page_content'] = EEH_Template::display_template(EE_PAYMENTS_TEMPLATE_PATH . 'payment_log_details.template.php', array('payment_log' => $payment_log, 'payment_method' => $payment_method, 'transaction' => $transaction), TRUE);
     $this->display_admin_page_with_sidebar();
 }
 protected function _developers()
 {
     $template_path = EE_SUPPORT_ADMIN_TEMPLATE_PATH . 'developers_admin_details.template.php';
     $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, array(), true);
     $this->display_admin_page_with_sidebar();
 }
 /**
  * ticket_selector_iframe
  *
  *	@access 	public
  * 	@return 	void
  */
 public function ticket_selector_iframe()
 {
     self::$_in_iframe = true;
     /** @type EEM_Event $EEM_Event */
     $EEM_Event = EE_Registry::instance()->load_model('Event');
     $event = $EEM_Event->get_one_by_ID(EE_Registry::instance()->REQ->get('event', 0));
     EE_Registry::instance()->REQ->set_espresso_page(true);
     $template_args['ticket_selector'] = EED_Ticket_Selector::display_ticket_selector($event);
     $template_args['css'] = apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__css', array(TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_embed.css?ver=' . EVENT_ESPRESSO_VERSION, TICKET_SELECTOR_ASSETS_URL . 'ticket_selector.css?ver=' . EVENT_ESPRESSO_VERSION, includes_url('css/dashicons.min.css?ver=' . $GLOBALS['wp_version']), EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css?ver=' . EVENT_ESPRESSO_VERSION));
     EE_Registry::$i18n_js_strings['ticket_selector_iframe'] = true;
     EE_Registry::$i18n_js_strings['EEDTicketSelectorMsg'] = __('Please choose at least one ticket before continuing.', 'event_espresso');
     $template_args['eei18n'] = apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__eei18n_js_strings', EE_Registry::localize_i18n_js_strings());
     $template_args['js'] = apply_filters('FHEE__EED_Ticket_Selector__ticket_selector_iframe__js', array(includes_url('js/jquery/jquery.js?ver=' . $GLOBALS['wp_version']), EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js?ver=' . EVENT_ESPRESSO_VERSION, TICKET_SELECTOR_ASSETS_URL . 'ticket_selector_iframe_embed.js?ver=' . EVENT_ESPRESSO_VERSION));
     $template_args['notices'] = EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php', array(), true);
     EEH_Template::display_template(TICKET_SELECTOR_TEMPLATES_PATH . 'ticket_selector_chart_iframe.template.php', $template_args);
     exit;
 }
 public function new_default_templates($contents, $actual_path, EE_messenger $messenger, EE_message_type $message_type, $field, $context, EE_Messages_Template_Pack $template_pack)
 {
     //we're only modifying templates for the default template pack
     if (!$template_pack instanceof EE_Messages_Template_Pack_Default) {
         return $contents;
     }
     //the template file name we're replacing contents for.
     $template_file_prefix = $field . '_' . $context;
     $msg_prefix = $messenger->name . '_' . $message_type->name . '_';
     $base_path = EE_CAF_LIBRARIES . 'messages/defaults/default/';
     if ($messenger->name == 'email' && $message_type->name == 'registration') {
         switch ($template_file_prefix) {
             case 'question_list_admin':
             case 'question_list_attendee':
             case 'question_list_primary_attendee':
                 $path = $base_path . $msg_prefix . 'question_list.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
             case 'attendee_list_primary_attendee':
                 $path = $base_path . $msg_prefix . 'attendee_list.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
             case 'attendee_list_admin':
                 $path = $base_path . $msg_prefix . 'attendee_list_admin.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
             case 'attendee_list_attendee':
                 $contents = '';
                 break;
             case 'event_list_attendee':
                 $path = $base_path . $msg_prefix . 'event_list_attendee.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
         }
     } elseif ($messenger->name == 'email' && $message_type->name == 'newsletter') {
         switch ($template_file_prefix) {
             case 'content_attendee':
                 $path = $base_path . $msg_prefix . 'content.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
             case 'newsletter_content_attendee':
                 $path = $base_path . $msg_prefix . 'newsletter_content.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
             case 'newsletter_subject_attendee':
                 $path = $base_path . $msg_prefix . 'subject.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
         }
     } elseif ($messenger->name == 'html' && $message_type->name == 'receipt') {
         switch ($template_file_prefix) {
             case 'attendee_list_purchaser':
                 $path = $base_path . $msg_prefix . 'attendee_list.template.php';
                 $contents = EEH_Template::display_template($path, array(), true);
                 break;
         }
     }
     return $contents;
 }
 protected function _category_details_content()
 {
     $editor_args['category_desc'] = array('type' => 'wp_editor', 'value' => EEH_Formatter::admin_format_content($this->_category->category_desc), 'class' => 'my_editor_custom', 'wpeditor_args' => array('media_buttons' => FALSE));
     $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
     $all_terms = get_terms(array('espresso_venue_categories'), array('hide_empty' => 0, 'exclude' => array($this->_category->id)));
     //setup category select for term parents.
     $category_select_values[] = array('text' => __('No Parent', 'event_espresso'), 'id' => 0);
     foreach ($all_terms as $term) {
         $category_select_values[] = array('text' => $term->name, 'id' => $term->term_id);
     }
     $category_select = EEH_Form_Fields::select_input('category_parent', $category_select_values, $this->_category->parent);
     $template_args = array('category' => $this->_category, 'category_select' => $category_select, 'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'), 'category_desc_editor' => $_wp_editor['category_desc']['field'], 'disable' => '', 'disabled_message' => FALSE);
     $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
     return EEH_Template::display_template($template, $template_args, TRUE);
 }
 /**
  * Utility method for retrieving a specific template matching the given parameters
  *
  * @param null | EE_Messages_Template_Pack_Default $default_pack
  * @param EE_messenger    $messenger
  * @param EE_message_type $message_type
  * @param string          $field          The field reference for the specific template being looked up.
  * @param string          $context      The context reference for the specific template being looked up
  *
  * @return string          The template contents.
  */
 protected function _get_specific_template($default_pack, EE_messenger $messenger, EE_message_type $message_type, $field, $context)
 {
     //default templates
     $default_templates = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_templates($messenger, $message_type) : array();
     //first we allow for the $_base_path to be filtered.  However, we assign this to a new variable so that we have the original base_path as a fallback.
     $filtered_base_path = apply_filters('FHEE__EE_Template_Pack___get_specific_template__filtered_base_path', $this->_base_path, $messenger, $message_type, $field, $context, $this);
     $master_templates = $message_type->get_master_templates();
     $master_templates_mt = isset($master_templates[$messenger->name]) ? $master_templates[$messenger->name] : $message_type->name;
     $full_path = $filtered_base_path . $messenger->name . '_' . $message_type->name . '_' . $field . '_' . $context . '.template.php';
     $fallback_path = $filtered_base_path . $messenger->name . '_' . $message_type->name . '_' . $field . '.template.php';
     $mt_defined_full_path = $filtered_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '_' . $context . '.template.php';
     $mt_defined_fallback_path = $filtered_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '.template.php';
     $base_defined_full_path = $this->_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '_' . $context . '.template.php';
     $base_defined_fallback_path = $this->_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '.template.php';
     /**
      * Template checks are done hierarchically in the following order:
      *
      * - a match for the full messenger name, message type, context and field in the full path for the given template pack.
      * - a match for the full messenger name, message type, field in the full path for the given template pack.
      * - a match for the full messenger name, message type, field, context in the path grabbed for the related message type defined in the _master_templates property for the message type (i.e. all registration message types share the same template as the main registration message type).
      * - match for the full messenger name, message type, field for the related message type defined in the _master templates property for the message type
      * - a match for a default template matching the messenger, name, context, field (as set by the default template packs).
      * - empty string.
      */
     if (is_readable($full_path)) {
         $actual_path = $full_path;
     } elseif (is_readable($fallback_path)) {
         $actual_path = $fallback_path;
     } elseif (is_readable($mt_defined_full_path)) {
         $actual_path = $mt_defined_full_path;
     } elseif (is_readable($mt_defined_fallback_path)) {
         $actual_path = $mt_defined_fallback_path;
     } elseif (is_readable($base_defined_full_path)) {
         $actual_path = $base_defined_full_path;
     } elseif (is_readable($base_defined_fallback_path)) {
         $actual_path = $base_defined_fallback_path;
     } else {
         $actual_path = '';
     }
     if (empty($actual_path)) {
         $contents = isset($default_templates[$context][$field]) ? $default_templates[$context][$field] : '';
     } else {
         $contents = EEH_Template::display_template($actual_path, array(), TRUE);
     }
     return apply_filters('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', $contents, $actual_path, $messenger, $message_type, $field, $context, $this);
 }
 /**
  * Overwrite parent _get_main_template for pdf purposes.
  *
  * @since  4.5.0
  *
  * @param bool $preview
  * @return string
  */
 protected function _get_main_template($preview = FALSE)
 {
     $wrapper_template = $this->_tmp_pack->get_wrapper('html', 'main');
     //add message type to template_args
     $this->_template_args['message_type'] = $this->_incoming_message_type;
     //require template helper
     EE_Registry::instance()->load_helper('Template');
     return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE);
 }
 /**
  * Utility method for child classes to get the contents of a template file and return
  *
  * We're assuming the child messenger class has already setup template args!
  * @param  bool $preview if true we use the preview wrapper otherwise we use main wrapper.
  * @return string
  * @throws \EE_Error
  */
 protected function _get_main_template($preview = FALSE)
 {
     $type = $preview ? 'preview' : 'main';
     $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, $type);
     //check file exists and is readable
     if (!is_readable($wrapper_template)) {
         throw new EE_Error(sprintf(__('Unable to access the template file for the %s messenger main content wrapper.  The location being attempted is %s.', 'event_espresso'), ucwords($this->label['singular']), $wrapper_template));
     }
     //add message type to template args
     $this->_template_args['message_type'] = $this->_incoming_message_type;
     //require template helper
     EE_Registry::instance()->load_helper('Template');
     return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE);
 }
 /**
  * 	template_settings_form
  *
  *  @access 	public
  *  @static
  *  @return 	string
  */
 public static function template_settings_form()
 {
     $template_settings = EE_Registry::instance()->CFG->template_settings;
     $template_settings->EED_Events_Archive = isset($template_settings->EED_Events_Archive) ? $template_settings->EED_Events_Archive : new EE_Events_Archive_Config();
     $template_settings->EED_Events_Archive = apply_filters('FHEE__EED_Events_Archive__template_settings_form__event_list_config', $template_settings->EED_Events_Archive);
     $events_archive_settings = array('display_status_banner' => 0, 'display_description' => 1, 'display_ticket_selector' => 0, 'display_datetimes' => 1, 'display_venue' => 0, 'display_expired_events' => 0);
     $events_archive_settings = array_merge($events_archive_settings, (array) $template_settings->EED_Events_Archive);
     EEH_Template::display_template(EVENTS_ARCHIVE_TEMPLATES_PATH . 'admin-event-list-settings.template.php', $events_archive_settings);
 }
 /**
  * 	template_settings_form
  *
  *  @access 	public
  *  @static
  *  @return 	void
  */
 public static function template_settings_form()
 {
     $config = EE_Registry::instance()->CFG->template_settings;
     $config = isset($config->EED_Event_Single) && $config->EED_Event_Single instanceof EE_Event_Single_Config ? $config->EED_Event_Single : new EE_Event_Single_Config();
     $config->use_sortable_display_order = isset($config->use_sortable_display_order) ? $config->use_sortable_display_order : false;
     $config = apply_filters('FHEE__EED_Event_Single__template_settings_form__event_list_config', $config);
     $event_single_order_array = array();
     $event_single_order_array[$config->display_order_tickets] = 'tickets';
     $event_single_order_array[$config->display_order_datetimes] = 'datetimes';
     $event_single_order_array[$config->display_order_event] = 'event';
     $event_single_order_array[$config->display_order_venue] = 'venue';
     // get template parts
     $template_parts = EED_Event_Single::instance()->initialize_template_parts($config);
     // convert to array so that we can add more properties
     $config = get_object_vars($config);
     $config['event_single_display_order'] = $template_parts->generate_sortable_list_of_template_parts('event-single-sortable-js', '', 'single-sortable-li single-sortable-js');
     EEH_Template::display_template(EVENT_SINGLE_CAFF_TEMPLATES_PATH . 'admin-event-single-settings.template.php', $config);
 }
 /**
  * Generate the html for selecting events that a promotion applies to.
  *
  * @since 1.0.0
  *
  * @param integer $PRO_ID The promotion ID for the applies to selector we are retrieving.
  * @return string html
  */
 public function get_admin_applies_to_selector($PRO_ID)
 {
     $applied_filters = $this->_maybe_overload_request_with_saved_filters($PRO_ID);
     $total_items = $this->_get_total_items();
     $items_to_select = $this->get_scope_items();
     $selected_items = $this->_get_applied_to_item_ids($PRO_ID);
     $template_args = array('scope_slug' => $this->slug, 'scope' => $this, 'header_content' => sprintf(__('%sCheck off the specific events that this promotion will be applied to.%s', 'event_espresso'), '<p>', '</p>'), 'filters' => $this->_get_applies_to_filters(), 'show_filters' => $applied_filters, 'items_to_select' => $this->_get_applies_to_items_to_select($items_to_select, $selected_items, $PRO_ID), 'items_paging' => $this->_get_applies_to_items_paging($total_items), 'selected_items' => $selected_items, 'number_of_selected_items' => count($selected_items), 'display_selected_label' => __('Display only selected Events', 'event_espresso'), 'footer_content' => '');
     return EEH_Template::display_template(EE_PROMOTIONS_PATH . '/lib/scopes/templates/promotion_applies_to_wrapper.template.php', $template_args, TRUE);
 }
 public function _confirm_migration_crash_report_sent()
 {
     try {
         $most_recent_migration = EE_Data_Migration_Manager::instance()->get_last_ran_script(true);
     } catch (EE_Error $e) {
         EE_Data_Migration_Manager::instance()->add_error_to_migrations_ran($e->getMessage());
         //now, just so we can display the page correctly, make a error migration script stage object
         //and also put the error on it. It only persists for the duration of this request
         $most_recent_migration = new EE_DMS_Unknown_1_0_0();
         $most_recent_migration->add_error($e->getMessage());
     }
     $success = $this->_req_data['success'] == '1' ? true : false;
     $this->_template_args['success'] = $success;
     $this->_template_args['most_recent_migration'] = $most_recent_migration;
     $this->_template_args['reset_db_action_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'reset_db'), EE_MAINTENANCE_ADMIN_URL);
     $this->_template_args['reset_db_page_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'data_reset'), EE_MAINTENANCE_ADMIN_URL);
     $this->_template_args['reattempt_action_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'reattempt_migration'), EE_MAINTENANCE_ADMIN_URL);
     $this->_template_path = EE_MAINTENANCE_TEMPLATE_PATH . 'ee_confirm_migration_crash_report_sent.template.php';
     $this->_template_args['admin_page_content'] = EEH_Template::display_template($this->_template_path, $this->_template_args, TRUE);
     $this->display_admin_page_with_sidebar();
 }