本文整理汇总了PHP中EEH_Template类的典型用法代码示例。如果您正苦于以下问题:PHP EEH_Template类的具体用法?PHP EEH_Template怎么用?PHP EEH_Template使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EEH_Template类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _parser
protected function _parser($shortcode)
{
EE_Registry::instance()->load_helper('Template');
if (!$this->_data instanceof EE_Ticket) {
return '';
}
//get out cause we can only parse with the ticket object.
switch ($shortcode) {
case '[TICKET_ID]':
return $this->_data->ID();
break;
case '[TICKET_NAME]':
return $this->_data->get('TKT_name');
break;
case '[TICKET_DESCRIPTION]':
return $this->_data->get('TKT_description');
break;
case '[TICKET_PRICE]':
return EEH_Template::format_currency($this->_data->get('TKT_price'));
break;
case '[TKT_QTY_PURCHASED]':
return $this->_extra_data['data']->tickets[$this->_data->ID()]['count'];
break;
}
}
示例2: 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);
}
示例3: column_name
public function column_name(EE_Promotion $item)
{
$edit_link = EEH_URL::add_query_args_and_nonce(array('action' => 'edit', 'PRO_ID' => $item->ID()), EE_PROMOTIONS_ADMIN_URL);
$content = EE_Registry::instance()->CAP->current_user_can('ee_edit_promotion', 'espresso_promotions_edit_promotion', $item->ID()) ? '<a href="' . $edit_link . '" title="' . __('Edit Promotion', 'event_espresso') . '">' . $item->name() . '</a>' : $item->name();
$content .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status($item->status(), false, 'sentence') . '</span>';
return $content;
}
示例4: template_settings_form
/**
* 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);
}
示例5: _setup_data
/**
* This will just setup the _events property in the expected format.
* @return void
*/
protected function _setup_data()
{
//now let's loop and set up the _events property. At the same time we'll set up attendee properties.
//a variable for tracking totals
$running_total = 0;
//get txn
$this->txn = $this->reg_obj->transaction();
$this->taxes = $this->txn->tax_total();
$this->grand_total_price_object = '';
//possible session stuff?
$session = $this->txn->session_data();
$session_data = $session instanceof EE_Session ? $session->get_session_data() : array();
//other data from the session (if possible)
$this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : '';
$this->ip_address = isset($session_data['ip_address']) ? $session_data['ip_address'] : '';
$this->user_agent = isset($session_data['user_agent']) ? $session_data['user_agent'] : '';
$this->init_access = $this->last_access = '';
$this->payment = $this->txn->get_first_related('Payment');
$this->payment = empty($this->payment) ? EE_Payment::new_instance(array('STS_ID' => EEM_Payment::status_id_pending, 'PAY_timestamp' => (int) current_time('timestamp'), 'PAY_gateway' => $this->txn->selected_gateway(), 'PAY_gateway_response' => $this->txn->gateway_response_on_transaction())) : $this->payment;
//if there is no payments associated with the transaction then we just create a default payment object for potential parsing.
$this->billing = $this->payment->details();
EE_Registry::instance()->load_helper('Template');
$this->billing['total_due'] = isset($this->billing['total']) ? EEH_Template::format_currency($this->billing['total']) : '';
//get reg_objs for txn
$this->reg_objs = $this->txn->registrations();
//now we can set things up like we do for other handlers
$this->_assemble_data();
}
示例6: category_color_widget
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);
}
示例7: _setup_data
protected function _setup_data()
{
//basically ALL we're going to get from this is the transaction object and use it to build the majority of our info.
$session = $this->_data->get_session_data();
$this->txn = $session['transaction'];
if (empty($this->txn) || !$this->txn instanceof EE_Transaction) {
throw new EE_Error(__('Incoming data for the EE_Session data handler must have a valid EE_Transaction object in order to setup the data'));
}
$this->reg_info = array();
$this->incoming_data = $session;
$this->taxes = $this->txn->tax_total();
$this->grand_total_price_object = '';
//other data from the session (if possible)
$this->user_id = isset($session['user_id']) ? $session['user_id'] : '';
$this->ip_address = isset($session['ip_address']) ? $session['ip_address'] : '';
$this->user_agent = isset($session['user_agent']) ? $session['user_agent'] : '';
$this->init_access = $this->last_access = '';
$this->payment = $this->txn->get_first_related('Payment');
$this->payment = empty($this->payment) ? EE_Payment::new_instance(array('STS_ID' => EEM_Payment::status_id_pending, 'PAY_timestamp' => (int) current_time('timestamp'), 'PAY_gateway' => $this->txn->selected_gateway(), 'PAY_gateway_response' => $this->txn->gateway_response_on_transaction())) : $this->payment;
//if there is no payments associated with the transaction then we just create a default payment object for potential parsing.
$this->billing = $this->payment->details();
EE_Registry::instance()->load_helper('Template');
$this->billing['total_due'] = isset($this->billing['total']) ? EEH_Template::format_currency($this->billing['total']) : '';
//let's get all the registrations associated with this txn
$this->reg_objs = $this->txn->registrations();
$this->_assemble_data();
}
示例8: __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
示例9: debug_logging_options
/**
* 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);
}
开发者ID:DavidSteinbauer,项目名称:event-espresso-core,代码行数:14,代码来源:Extend_General_Settings_Admin_Page.core.php
示例10: _message_status_legend
/**
* output the relevant ee-status-legend with the designated status highlighted.
* @param EEM_Message constant $status What status is set (by class)
* @return string The status legend with the related status highlighted
*/
private function _message_status_legend($status)
{
$status_array = array('sent_status' => EEM_Message::status_sent, 'idle_status' => EEM_Message::status_idle, 'failed_status' => EEM_Message::status_failed, 'resend_status' => EEM_Message::status_resend, 'incomplete_status' => EEM_Message::status_incomplete, 'retry_status' => EEM_Message::status_retry);
if (defined('WP_DEBUG') && WP_DEBUG) {
$status_array['debug_only_status'] = EEM_Message::status_debug_only;
}
return EEH_Template::status_legend($status_array, $status);
}
示例11: _credits
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();
}
示例12: _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;
}
示例13: prepare_for_pretty_echoing
/**
* Gets a string representation of the array
* @param type $value_on_field_to_be_outputted
* @param string $schema, possible values are ',', others can be added
* @return string
*/
function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
{
switch ($schema) {
case 'print_r':
$pretty_value = print_r($value_on_field_to_be_outputted, true);
break;
case 'as_table':
$pretty_value = EEH_Template::layout_array_as_table($value_on_field_to_be_outputted);
break;
default:
$pretty_value = implode(", ", $value_on_field_to_be_outputted);
}
return $pretty_value;
}
示例14: prepare_for_pretty_echoing
/**
* Schemas:
* 'localized_float': "3,023.00"
* 'no_currency_code': "$3,023.00"
* null: "$3,023.00<span>USD</span>"
* @param type $value_on_field_to_be_outputted
* @param type $schema
* @return string
*/
function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
{
$pretty_float = parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted);
if ($schema == 'localized_float') {
return $pretty_float;
}
if ($schema == 'no_currency_code') {
// echo "schema no currency!";
$display_code = false;
} else {
$display_code = true;
}
//we don't use the $pretty_float because format_currency will take care of it.
return EEH_Template::format_currency($value_on_field_to_be_outputted, false, $display_code);
}
示例15: _parser
protected function _parser($shortcode)
{
EE_Registry::instance()->load_helper('Template');
$this->_ticket = $this->_data instanceof EE_Ticket ? $this->_data : null;
$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : null;
$aee = !$aee instanceof EE_Messages_Addressee && is_array($this->_extra_data) && isset($this->_extra_data['data']) && $this->_extra_data['data'] instanceof EE_Messages_Addressee ? $this->_extra_data['data'] : $aee;
//possible EE_Line_Item may be incoming data
$this->_ticket = empty($this->_ticket) && $this->_data instanceof EE_Line_Item && $aee instanceof EE_Messages_Addressee && !empty($aee->line_items_with_children[$this->_data->ID()]['EE_Ticket']) && $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] instanceof EE_Ticket ? $aee->line_items_with_children[$this->_data->ID()]['EE_Ticket'] : $this->_ticket;
//if still no ticket, then let's see if there is a reg_obj. If there IS, then we'll try and grab the ticket from the reg_obj instead.
if (empty($this->_ticket)) {
$this->_ticket = $aee instanceof EE_Messages_Addressee && $aee->reg_obj instanceof EE_Registration ? $aee->reg_obj->ticket() : NULL;
}
//If there is no event object by now then get out.
if (!$this->_ticket instanceof EE_Ticket) {
return '';
}
switch ($shortcode) {
case '[TICKET_ID]':
return $this->_ticket->ID();
break;
case '[TICKET_NAME]':
return $this->_ticket->get('TKT_name');
break;
case '[TICKET_DESCRIPTION]':
return $this->_ticket->get('TKT_description');
break;
case '[TICKET_PRICE]':
return EEH_Template::format_currency($this->_ticket->get('TKT_price'));
break;
case '[TICKET_PRICE_WITH_TAXES]':
return EEH_Template::format_currency($this->_ticket->get_ticket_total_with_taxes());
break;
case '[TKT_QTY_PURCHASED]':
return $aee instanceof EE_Messages_Addressee ? $aee->tickets[$this->_ticket->ID()]['count'] : '';
break;
}
if (strpos($shortcode, '[TKT_USES_*') !== FALSE) {
$attrs = $this->_get_shortcode_attrs($shortcode);
$schema = empty($attrs['schema']) ? null : $attrs['schema'];
return $this->_ticket->get_pretty('TKT_uses', $schema);
}
return '';
}