本文整理汇总了PHP中EEH_Template::locate_template方法的典型用法代码示例。如果您正苦于以下问题:PHP EEH_Template::locate_template方法的具体用法?PHP EEH_Template::locate_template怎么用?PHP EEH_Template::locate_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEH_Template
的用法示例。
在下文中一共展示了EEH_Template::locate_template方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: payment_overview_content
/**
* 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::locate_template('payment_methods' . DS . 'Bank' . DS . 'templates' . DS . 'bank_payment_details_content.template.php', $template_vars);
}
示例2: __construct
public function __construct($template_file, $args = array(), $options_array = array())
{
EE_Registry::instance()->load_helper('Template');
$html = EEH_Template::locate_template($template_file, $args);
// echo " filepath:$template_file html $html";
parent::__construct($html, $options_array);
}
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:7,代码来源:EE_Form_Section_HTML_From_Template.form.php
示例3: _migration_step
/**
* _migration_step
*
* @access protected
* @param int $num_items
* @throws EE_Error
* @return int number of items ACTUALLY migrated
*/
protected function _migration_step($num_items = 1)
{
$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
$overridden_invoice_body = EEH_Template::locate_template($templates_relative_path . 'invoice_body.template.php', NULL, FALSE, FALSE, TRUE);
$overridden_receipt_body = EEH_Template::locate_template($templates_relative_path . 'receipt_body.template.php', NULL, FALSE, FALSE, TRUE);
if ($overridden_invoice_body || $overridden_receipt_body) {
EE_Error::add_persistent_admin_notice('invoice_overriding_templates', sprintf(__('Note: in this version of Event Espresso, PDF and HTML Invoices and Receipts are now Messages and can be changed just like any other messages; however we noticed you had previously overriden the old default Invoice/Receipt templates. Because of this, your old Invoice/Receipt templates will continue to be used INSTEAD of the new Invoice/Receipt message equivalents (but this will be removed in an upcoming version). We recommend deleting your old Invoice/Receipt templates and using the new messages system. Then modify the new Invoice and Receipt messages\'s content in Messages -> Invoice and Messages -> Receipt.')), TRUE);
}
//regardless of whether it worked or not, we ought to continue the migration
$this->set_completed();
return 1;
}
示例4: process_shortcode
/**
* process_shortcode
*
* [ESPRESSO_PROMOTIONS]
*
* @access public
* @param array $attributes
* @return string
*/
public function process_shortcode($attributes = array())
{
/** @type EEM_Promotion $EEM_Promotion */
$EEM_Promotion = EE_Registry::instance()->load_model('Promotion');
EE_Registry::instance()->load_helper('Template');
$active_promotions = $EEM_Promotion->get_all_active_codeless_promotions();
$html = '<div id="ee-upcoming-promotions-dv">';
foreach ($active_promotions as $promotion) {
if ($promotion instanceof EE_Promotion) {
$config = EED_Promotions::instance()->set_config();
if (!empty($config->banner_template) && $config->banner_template == 'promo-banner-ribbon.template.php' && !empty($config->ribbon_banner_color)) {
$promo_bg_color = $config->ribbon_banner_color;
} else {
$promo_bg_color = '';
}
$scope_objects = $promotion->get_objects_promo_applies_to();
$html .= EEH_Template::locate_template(apply_filters('FHEE__EED_Promotions__process_shortcode__upcoming_promotions', EE_PROMOTIONS_PATH . 'templates' . DS . 'upcoming-promotions-grid.template.php'), array('PRO_ID' => $promotion->ID(), 'promo_bg_color' => apply_filters('FHEE__EED_Promotions__process_shortcode__promo_bg_color', $promo_bg_color), 'promo_header' => $promotion->name(), 'promo_desc' => $promotion->description() != '' ? $promotion->description() . '<br />' : '', 'promo_amount' => $promotion->pretty_amount(), 'promo_dates' => $promotion->promotion_date_range(), 'promo_scopes' => $promotion->get_promo_applies_to_link_array($scope_objects)));
}
}
$html .= '</div>';
return $html;
}
示例5: _migration_step
/**
* _migration_step
*
* @access protected
* @param int $num_items
* @throws EE_Error
* @return int number of items ACTUALLY migrated
*/
protected function _migration_step($num_items = 1)
{
// if this isn't set then something is really wrong
if (!EE_Config::instance()->gateway instanceof EE_Gateway_Config) {
throw new EE_Error(__('It appears the Event Espresso Core Configuration is not setup correctly.', 'event_espresso'));
}
$invoice_settings = isset(EE_Config::instance()->gateway->payment_settings['Invoice']) ? EE_Config::instance()->gateway->payment_settings['Invoice'] : NULL;
if (!$invoice_settings) {
$this->add_error(__('Could not migrate EE4.4 invoice settings to EE4.5 because they didnt exist', 'event_espresso'));
} else {
$invoice_settings['template_payment_instructions'] = $invoice_settings['pdf_instructions'];
$invoice_settings['template_invoice_payee_name'] = $invoice_settings['payable_to'];
$invoice_settings['template_invoice_address'] = $invoice_settings['payment_address'];
$invoice_settings['template_invoice_email'] = '';
$invoice_settings['template_invoice_tax_number'] = '';
unset($invoice_settings['pdf_instructions']);
unset($invoice_settings['payable_to']);
unset($invoice_settings['payment_address']);
EE_Config::instance()->gateway->payment_settings['Invoice'] = $invoice_settings;
EE_Config::instance()->update_espresso_config(false, false);
//@todo: check 'invoice_css' too because we can't easily affect that so we might need to set a persistent notice
//(why is it tough to change? because we want to update the receipt and invoice message template, but
//message templates are only initialized AFTER migrations and those two are new in 4.5. So if we wanted to
//update them from a DMS, we'd need to have the DMS create the message templates which is quite a lot of code;
//also we don't want to build a dependency on the messages code because it is likely to change soon
if (!in_array($invoice_settings['invoice_css'], array('', 'simple.css'))) {
EE_Error::add_persistent_admin_notice('invoice_css_not_updated', sprintf(__('You had previously set your Invoice Payment Method\'s stylesheet to be %1$s, but that setting has moved. PDF and HTML Invoices and Receipts are now Messages, which means you can easily modify them from your Wordpress Dashboard instead of using filters or uploading template files. Please visit Messages -> Receipt and Messages -> Invoice to change their stylesheets.', 'event_espresso'), $invoice_settings['invoice_css']), FALSE);
}
EE_Registry::instance()->load_helper('Template');
$templates_relative_path = 'modules/gateways/Invoice/lib/templates/';
$overridden_invoice_body = EEH_Template::locate_template($templates_relative_path . 'invoice_body.template.php', NULL, FALSE, FALSE, TRUE);
$overridden_receipt_body = EEH_Template::locate_template($templates_relative_path . 'receipt_body.template.php', NULL, FALSE, FALSE, TRUE);
if ($overridden_invoice_body || $overridden_receipt_body) {
EE_Error::add_persistent_admin_notice('invoice_overriding_templates', sprintf(__('Note: in this version of Event Espresso, PDF and HTML Invoices and Receipts are now Messages and can be changed just like any other messages; however we noticed you had previously overriden the old default Invoice/Receipt templates. Because of this, your old Invoice/Receipt templates will continue to be used INSTEAD of the new Invoice/Receipt message equivalents. We recommend deleting your old Invoice/Receipt templates and modifying the new Invoice and Receipt messages\'s content in Messages -> Invoice and Messages -> Receipt.')), TRUE);
}
}
//regardless of whether it worked or not, we ought to continue the migration
$this->set_completed();
return 1;
}
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:48,代码来源:EE_DMS_4_5_0_invoice_settings.dmsstage.php
示例6: layout_form_end
/**
* closing div tag for a form
* @return string
*/
public function layout_form_end()
{
if ($this->_layout_end_template_file) {
return EEH_Template::locate_template($this->_layout_end_template_file, $this->template_args(), TRUE, TRUE);
} else {
return parent::layout_form_end();
}
}
示例7: template_include
/**
* template_include
*
* replacement EE CPT template that displays message notifying site visitors that EE has been temporarily placed into maintenance mode
*
* @access public
* @param string $template_path
* @return string
*/
public static function template_include($template_path)
{
EE_Registry::instance()->load_helper('Template');
$template_located = EEH_Template::locate_template(EE_TEMPLATES . 'maintenance_mode.template.php', FALSE, FALSE);
return $template_located ? $template_located : $template_path;
}
示例8: _position_template_part
/**
* position_template_part
*
* based on the priority of the incoming template part
* relative to the known event description template part priority,
* this method will assign template parts to one of the following:
* $this->before_event_content
* $this->event_content
* $this->after_event_content
*
* @access protected
* @param string $content
* @param string $template
* @param int $priority
* @return string
*/
protected function _position_template_part($content, $template, $priority)
{
// Event Description content is the actual incoming content itself
if ($priority === $this->event_desc_priority) {
$this->event_content = $content;
} else {
if ($priority < $this->event_desc_priority) {
// everything BEFORE the Event Description
$this->before_event_content .= EEH_Template::locate_template($template);
} else {
if ($priority > $this->event_desc_priority) {
// everything AFTER the Event Description
$this->after_event_content .= EEH_Template::locate_template($template);
}
}
}
}
示例9: payment_overview_content
/**
* For adding any html output above 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)
{
return EEH_Template::locate_template('payment_methods' . DS . 'Invoice' . DS . 'templates' . DS . 'invoice_payment_details_content.template.php', array_merge(array('payment_method' => $this->_pm_instance, 'payment' => $payment, 'page_confirmation_text' => '', 'page_extra_info' => '', 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html')), $this->_pm_instance->all_extra_meta_array()));
}
示例10: event_venues
/**
* event_venues
*
* @access public
* @param string $content
* @return void
*/
public static function event_venues($content)
{
return $content . EEH_Template::locate_template('content-espresso_events-venues.php');
}
示例11: process_shortcode
/**
* process_shortcode - ESPRESSO_EVENTS - Returns a list of events
* [ESPRESSO_EVENTS]
* [ESPRESSO_EVENTS title="My Super Event"]
* [ESPRESSO_EVENTS limit=5]
* [ESPRESSO_EVENTS css_class="my-custom-class"]
* [ESPRESSO_EVENTS month="April 2014"]
* [ESPRESSO_EVENTS show_expired=true]
* [ESPRESSO_EVENTS category_slug="free-events"]
* [ESPRESSO_EVENTS order_by="start_date,id"]
* [ESPRESSO_EVENTS sort="ASC"]
*
* @access public
* @param array $attributes
* @return string
*/
public function process_shortcode($attributes = array())
{
// make sure EED_Events_Archive is setup properly
if (apply_filters('FHEE__fallback_shortcode_processor__EES_Espresso_Events', FALSE)) {
EED_Events_Archive::instance()->event_list();
}
// merge in any attributes passed via fallback shortcode processor
$attributes = array_merge((array) $attributes, (array) $this->_attributes);
//set default attributes
$default_espresso_events_shortcode_atts = array('title' => NULL, 'limit' => 10, 'css_class' => NULL, 'show_expired' => FALSE, 'month' => NULL, 'category_slug' => NULL, 'order_by' => 'start_date', 'sort' => 'ASC', 'fallback_shortcode_processor' => FALSE);
// allow the defaults to be filtered
$default_espresso_events_shortcode_atts = apply_filters('EES_Espresso_Events__process_shortcode__default_espresso_events_shortcode_atts', $default_espresso_events_shortcode_atts);
// grab attributes and merge with defaults, then extract
$attributes = array_merge($default_espresso_events_shortcode_atts, $attributes);
// make sure we use the_excerpt()
add_filter('FHEE__EES_Espresso_Events__process_shortcode__true', '__return_true');
// run the query
global $wp_query;
$wp_query = new EE_Event_List_Query($attributes);
// check what template is loaded and load filters accordingly
EED_Events_Archive::instance()->template_include('loop-espresso_events.php');
// load our template
$event_list = EEH_Template::locate_template('loop-espresso_events.php', array(), TRUE, TRUE);
// now reset the query and postdata
wp_reset_query();
wp_reset_postdata();
EED_Events_Archive::remove_all_events_archive_filters();
// pull our content from the output buffer and return it
return $event_list;
}
示例12: show_admin_page
/**
* Renders the admin page, after most of the work was already done during enqueuing scripts
* of creating the job and localizing some data
*/
public function show_admin_page()
{
echo EEH_Template::locate_template(EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_wrapper.template.html', array('batch_request_type' => $this->batch_request_type()));
}
示例13: get_template_part
/**
* EEH_Template::get_template_part
* basically a copy of the WordPress get_template_part() function but uses EEH_Template::locate_template() instead, and doesn't add base versions of files
* so not a very useful function at all except that it adds familiarity PLUS filtering based off of the entire template part name
*
* @param string $slug The slug name for the generic template.
* @param string $name The name of the specialised template.
* @param array $template_args
* @param bool $return_string
* @return string the html output for the formatted money value
*/
public static function get_template_part($slug = NULL, $name = NULL, $template_args = array(), $return_string = FALSE)
{
do_action("get_template_part_{$slug}-{$name}", $slug, $name);
$templates = array();
$name = (string) $name;
if ($name != '') {
$templates[] = "{$slug}-{$name}.php";
}
// allow template parts to be turned off via something like: add_filter( 'FHEE__content_espresso_events_tickets_template__display_datetimes', '__return_false' );
if (apply_filters("FHEE__EEH_Template__get_template_part__display__{$slug}_{$name}", TRUE)) {
EEH_Template::locate_template($templates, $template_args, TRUE, $return_string);
}
}
示例14: people_event_details
/**
* This is added right before event content is displayed for an event
*
* @since 1.0.0
*
* @param string $content (the content so far).
*
* @return string show people attached to an event.
*/
public static function people_event_details($content)
{
if (function_exists('is_espresso_event') && is_espresso_event()) {
EE_Registry::instance()->load_helper('Template');
$content = EEH_Template::locate_template('content-espresso_events-people.php') . $content;
}
return $content;
}
开发者ID:adrianjonmiller,项目名称:hearts-being-healed,代码行数:17,代码来源:EED_People_Event_Template_Parts.module.php
示例15: batch_file_create
/**
* Loads a page for running a batch job that creates and downloads a file,
* and then sends the user back to wherever they were before
*/
protected function batch_file_create()
{
//creates a job based on the request variable
$job_handler_classname = str_replace('\\\\', '\\', $this->_req_data['job_handler']);
$request_data = array_diff_key($this->_req_data, array_flip(array('action', 'page')));
$batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor();
//eg 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport'
$job_response = $batch_runner->create_job($job_handler_classname, $request_data);
wp_localize_script('support_batch_file_runner', 'ee_job_response', $job_response->to_array());
wp_localize_script('support_batch_file_runner', 'ee_job_i18n', array('download_and_redirecting' => sprintf(__('File Generation complete. Downloading, and %1$sredirecting%2$s...', 'event_espresso'), '<a href="' . $this->_req_data['redirect_url'] . '">', '</a>'), 'redirect_url' => $this->_req_data['redirect_url']));
echo EEH_Template::locate_template(EE_SUPPORT_ADMIN . 'templates' . DS . 'admin_batch_file_runner.template.html', array('filename' => EEH_File::get_filename_from_filepath($job_response->job_parameters()->extra_datum('filepath'))));
}