/** * ブロックファイルに応じて tpl_mainpage を設定する * * @param string $bloc_file ブロックファイル名 * @return void */ public function setTplMainpage($bloc_file) { if (Utils::isAbsoluteRealPath($bloc_file)) { $this->tpl_mainpage = $bloc_file; } else { $this->tpl_mainpage = Application::alias('eccube.helper.page_layout')->getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file; } $this->setTemplate($this->tpl_mainpage); }
/** * 数値を数字絵文字に変換する。 * * 入力が0~9ではない場合、または、携帯端末からのアクセスではない場合は、 * 入力を [ と ] で囲んだ文字列を返す。 * * @param string $value 入力 * @return string 出力 */ function smarty_modifier_numeric_emoji($value) { // 数字絵文字 (0~9) の絵文字番号 static $numeric_emoji_index = array('134', '125', '126', '127', '128', '129', '130', '131', '132', '133'); if (Display::detectDevice() == DEVICE_TYPE_MOBILE && isset($numeric_emoji_index[$value])) { return '[emoji:' . $numeric_emoji_index[$value] . ']'; } else { return '[' . $value . ']'; } }
/** * marqueeタグで囲む。 * * DoCoMoの携帯端末の場合はmarqueeを使用しない。 * * @return string 出力 */ function smarty_block_marquee($params, $content, &$smarty, &$repeat) { // {/marquee}の場合のみ出力する。 if ($repeat || !isset($content)) { return null; } // 末尾の改行などを取り除く。 $content = rtrim($content); // marqueeタグを使用しない場合 if (Display::detectDevice() == DEVICE_TYPE_MOBILE && MobileUserAgent::getCarrier() == 'docomo') { return "<div>\n{$content}\n</div>\n"; } return "<marquee>\n{$content}\n</marquee>\n"; }
/** * Page を初期化する. * * @return void */ public function init() { // 開始時刻を設定する。 $this->timeStart = microtime(true); $this->tpl_authority = isset($_SESSION['authority']) ? $_SESSION['authority'] : null; // ディスプレイクラス生成 $this->objDisplay = Application::alias('eccube.display'); if (!$this->skip_load_page_layout) { /* @var $objLayout PageLayoutHelper */ $objLayout = Application::alias('eccube.helper.page_layout'); $objLayout->sfGetPageLayout($this, false, $_SERVER['SCRIPT_NAME'], $this->objDisplay->detectDevice()); } // スーパーフックポイントを実行. $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $objPlugin->doAction('Eccube.Page.preProcess', array($this)); // 店舗基本情報取得 $this->arrSiteInfo = Application::alias('eccube.helper.db')->getBasisData(); // トランザクショントークンの検証と生成 $this->doValidToken(); $this->setTokenTo(); // ローカルフックポイントを実行. $this->doLocalHookpointBefore($objPlugin); }