當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Shopp::locate_template方法代碼示例

本文整理匯總了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;
 }
開發者ID:forthrobot,項目名稱:inuvik,代碼行數:13,代碼來源:Email.php

示例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);
 }
開發者ID:forthrobot,項目名稱:inuvik,代碼行數:19,代碼來源:API.php

示例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;
 }
開發者ID:borkweb,項目名稱:shopp,代碼行數:35,代碼來源:Purchase.php

示例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);
 }
開發者ID:jonathandavis,項目名稱:shopp,代碼行數:45,代碼來源:Pages.php

示例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);
}
開發者ID:BlessySoftwares,項目名稱:anvelocom,代碼行數:7,代碼來源:Core.php


注:本文中的Shopp::locate_template方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。