本文整理汇总了PHP中Shopp::locate_template方法的典型用法代码示例。如果您正苦于以下问题:PHP Shopp::locate_template方法的具体用法?PHP Shopp::locate_template怎么用?PHP Shopp::locate_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shopp
的用法示例。
在下文中一共展示了Shopp::locate_template方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InlineStyles
static function InlineStyles($message)
{
if (false === strpos($message, '<html')) {
return $message;
}
$cssfile = Shopp::locate_template(array('email.css'));
$stylesheet = file_get_contents($cssfile);
if (!empty($stylesheet)) {
$Emogrifier = new Emogrifier($message, $stylesheet);
$message = $Emogrifier->emogrify();
}
return $message;
}
示例2: functions
/**
* Loads the theme templates `shopp/functions.php` if present
*
* If theme content templates are enabled, checks for and includes a functions.php file (if present).
* This allows developers to add Shopp-specific presentation logic with the added convenience of knowing
* that shopp_init has run.
*
* @author Barry Hughes
* @since 1.3
*
* @return void
**/
public static function functions()
{
if (!Shopp::str_true(shopp_setting('theme_templates'))) {
return;
}
Shopp::locate_template(array('functions.php'), true);
}
示例3: email
public function email($addressee, $address, $subject, array $templates = array())
{
global $is_IIS;
shopp_debug("ShoppPurchase::email(): {$addressee},{$address},{$subject}," . _object_r($templates));
// Build the e-mail message data
$email['from'] = Shopp::email_from(shopp_setting('merchant_email'), shopp_setting('business_name'));
if ($is_IIS) {
$email['to'] = Shopp::email_to($address);
} else {
$email['to'] = Shopp::email_to($address, $addressee);
}
$email['subject'] = $subject;
$email['receipt'] = $this->receipt();
$email['url'] = get_bloginfo('url');
$email['sitename'] = get_bloginfo('name');
$email['orderid'] = $this->id;
$email = apply_filters('shopp_email_receipt_data', $email);
$email = apply_filters('shopp_purchase_email_message', $email);
$this->message = array_merge($this->message, $email);
// Load and process the template file
$defaults = array('email.php', 'order.php', 'order.html');
$emails = array_merge((array) $templates, $defaults);
$template = Shopp::locate_template($emails);
if (!file_exists($template)) {
shopp_add_error(Shopp::__('A purchase notification could not be sent because the template for it does not exist.'), SHOPP_ADMIN_ERR);
return false;
}
// Send the email
if (Shopp::email($template, $this->message)) {
shopp_debug('A purchase notification was sent to: ' . $this->message['to']);
return true;
}
shopp_debug('A purchase notification FAILED to be sent to: ' . $this->message['to']);
return false;
}
示例4: content
public function content($content, $request = false)
{
if (!$request) {
global $wp_query;
// Test that this is the main query and it is the account page
if (!$wp_query->is_main_query() || !is_shopp_page('account')) {
return $content;
}
}
$widget = 'widget' === $request;
if ($widget) {
$request = 'menu';
}
// Modify widget request to render the account menu
$orderlookup = '';
if ('none' == shopp_setting('account_system')) {
$orderlookup = shopp('customer', 'get-order-lookup');
}
// $download_request = get_query_var('s_dl');
if (!$request) {
$request = ShoppStorefront()->account['request'];
}
$templates = array('account-' . $request . '.php', 'account.php');
$context = ShoppStorefront::intemplate();
// Set account page context
$Errors = ShoppErrorStorefrontNotices();
ob_start();
if (apply_filters('shopp_show_account_errors', true) && $Errors->exist()) {
echo ShoppStorefront::errors(array("errors-{$context}", 'account-errors.php', 'errors.php'));
}
if (!empty($orderlookup)) {
echo $orderlookup;
} else {
if ('login' == $request || !ShoppCustomer()->loggedin()) {
$templates = array('login-' . $request . '.php', 'login.php');
}
Shopp::locate_template($templates, true);
}
$content = ob_get_clean();
// Suppress the #shopp div for sidebar widgets
if ($widget) {
$content = '<!-- id="shopp" -->' . $content;
}
return apply_filters('shopp_account_template', $content, $request);
}
示例5: locate_shopp_template
/**
* @deprecated Use Shopp::locate_shopp_template()
**/
function locate_shopp_template($template_names, $load = false, $require_once = false)
{
return Shopp::locate_template($template_names, $load, $require_once);
}