コード例 #1
0
ファイル: WebPayExt.php プロジェクト: ttsuru/mdl_webpay
 /**
  * prefilterコールバック関数
  * テンプレートの変更処理を行います.
  *
  * @param  string     &$source  テンプレートのHTMLソース
  * @param  LC_Page_Ex $objPage  ページオブジェクト
  * @param  string     $filename テンプレートのファイル名
  * @return void
  */
 public function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename)
 {
     $objTransform = new SC_Helper_Transform($source);
     switch ($objPage->arrPageLayout['device_type_id']) {
         case DEVICE_TYPE_MOBILE:
         case DEVICE_TYPE_SMARTPHONE:
         case DEVICE_TYPE_PC:
             break;
         case DEVICE_TYPE_ADMIN:
         case null:
             // 未設定は admin
             if (strpos($filename, 'order/edit.tpl') !== false) {
                 // 個別受注画面にWebPay上のオブジェクトとの連携を挿入する
                 $template = PLUGIN_UPLOAD_REALDIR . $this->arrSelfInfo['plugin_code'] . '/templates/webpayext_admin_order_charge_add.tpl';
                 $objTransform->select('div#order')->appendFirst(file_get_contents($template));
             }
             break;
         default:
             break;
     }
     // 変更を実行します
     $source = $objTransform->getHTML();
 }
コード例 #2
0
 /**
  * プレフィルタコールバック関数
  *
  * @param string &$source テンプレートのHTMLソース
  * @param LC_Page_Ex $objPage ページオブジェクト
  * @param string $filename テンプレートのファイル名
  * @return void
  */
 function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename)
 {
     // 「システム設定」にメニューを追加
     $objTransform = new SC_Helper_Transform($source);
     $template_dir = PLUGIN_UPLOAD_REALDIR . 'AddProduct/data/templates/';
     if ($this->endsWith($filename, 'Smarty/templates/admin/system/subnavi.tpl') !== false) {
         $objTransform->select('li', 0)->insertAfter(file_get_contents($template_dir . 'plg_AddProduct_subnavi.tpl'));
     }
     $source = $objTransform->getHTML();
 }
コード例 #3
0
 /**
  * プレフィルタコールバック関数
  *
  * @param string &$source テンプレートのHTMLソース
  * @param LC_Page_Ex $objPage ページオブジェクト
  * @param string $filename テンプレートのファイル名
  * @return void
  */
 static function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename)
 {
     $objTransform = new SC_Helper_Transform($source);
     $templates_dir = PLUGIN_UPLOAD_REALDIR . 'AddProductColumns/templates/';
     switch ($objPage->arrPageLayout['device_type_id']) {
         case DEVICE_TYPE_MOBILE:
         case DEVICE_TYPE_SMARTPHONE:
         case DEVICE_TYPE_PC:
             break;
         case DEVICE_TYPE_ADMIN:
         default:
             // 商品ナビゲーション
             if (strpos($filename, 'products/subnavi.tpl') !== false) {
                 $objTransform->select('ul.level1')->appendChild(file_get_contents($templates_dir . 'admin/products/plg_AddProductColumns_snippet_subnavi.tpl'));
             } elseif (strpos($filename, 'products/product.tpl') !== false) {
                 $objTransform->select('#products .form', 0)->insertAfter(file_get_contents($templates_dir . 'admin/products/plg_AddProductColumns_snippet_product.tpl'));
             } elseif (strpos($filename, 'products/confirm.tpl') !== false) {
                 $objTransform->select('#products table', 0)->insertAfter(file_get_contents($templates_dir . 'admin/products/plg_AddProductColumns_snippet_confirm.tpl'));
             }
             break;
     }
     $source = $objTransform->getHTML();
 }
コード例 #4
0
ファイル: VideoPlayer.php プロジェクト: nassos9090/plugin
 /**
  * プレフィルタコールバック関数
  *
  * @param string &$source テンプレートのHTMLソース
  * @param LC_Page_Ex $objPage ページオブジェクト
  * @param string $filename テンプレートのファイル名
  * @return void
  */
 function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename)
 {
     $objTransform = new SC_Helper_Transform($source);
     $template_dir = PLUGIN_UPLOAD_REALDIR . 'VideoPlayer/templates/default/';
     switch ($objPage->arrPageLayout['device_type_id']) {
         case DEVICE_TYPE_PC:
             // 商品詳細画面
             if (strpos($filename, 'products/detail.tpl') !== false) {
                 $objTransform->select('div.cart_area')->insertAfter(file_get_contents($template_dir . 'plg_videoplayer.tpl'));
             }
             break;
         case DEVICE_TYPE_MOBILE:
         case DEVICE_TYPE_SMARTPHONE:
         case DEVICE_TYPE_ADMIN:
         default:
             break;
     }
     $source = $objTransform->getHTML();
 }
コード例 #5
0
ファイル: CAPTCHA.php プロジェクト: nobuhiko/ECCUBE-CAPTCHA
 function prefilterTransform(&$source, LC_Page_Ex $objPage, $filename)
 {
     $objTransform = new SC_Helper_Transform($source);
     $template_dir = PLUGIN_UPLOAD_REALDIR . "CAPTCHA/templates/";
     switch ($objPage->arrPageLayout['device_type_id']) {
         // 端末種別:PC
         case DEVICE_TYPE_PC:
             // 端末種別:スマートフォン
         // 端末種別:スマートフォン
         case DEVICE_TYPE_SMARTPHONE:
             if (strpos($filename, "contact/index.tpl") !== false) {
                 $objTransform->select("div.btn_area", 0)->insertBefore(file_get_contents($template_dir . "captcha.tpl"));
             }
             break;
     }
     $source = $objTransform->getHTML();
 }