From 4059be1561a629fbd65e838e27bbe2445cd634c6 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 5 Apr 2024 23:10:12 +0900 Subject: [PATCH] =?UTF-8?q?Smarty5=20=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/class/SC_SiteView.php | 9 ++++----- data/class/SC_View.php | 20 +++++++++---------- .../function.html_radios_ex.php | 17 ---------------- 3 files changed, 14 insertions(+), 32 deletions(-) delete mode 100644 data/smarty_extends/function.html_radios_ex.php diff --git a/data/class/SC_SiteView.php b/data/class/SC_SiteView.php index 0d0d58a636..c2f8399d96 100644 --- a/data/class/SC_SiteView.php +++ b/data/class/SC_SiteView.php @@ -26,9 +26,8 @@ class SC_SiteView extends SC_View_Ex public function init() { parent::init(); - - $this->_smarty->template_dir = realpath(TEMPLATE_REALDIR); - $this->_smarty->compile_dir = realpath(COMPILE_REALDIR); + $this->_smarty->setTemplateDir(realpath(TEMPLATE_REALDIR)); + $this->_smarty->setCompileDir(realpath(COMPILE_REALDIR)); $this->assignTemplatePath(DEVICE_TYPE_PC); } @@ -38,7 +37,7 @@ public function init() */ public function setPrevURL() { - $objCartSess = new SC_CartSession_Ex(); - $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); + $objCartSess = new SC_CartSession_Ex(); + $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); } } diff --git a/data/class/SC_View.php b/data/class/SC_View.php index 7ded6219a4..cd61f52b35 100644 --- a/data/class/SC_View.php +++ b/data/class/SC_View.php @@ -23,7 +23,7 @@ class SC_View { - /** @var Smarty */ + /** @var \Smarty\Smarty */ public $_smarty; /** @var LC_Page */ @@ -41,9 +41,9 @@ public function __construct() public function init() { // include_phpの利用のためSmartyBCを呼び出す、ホントはinclude_phpをなくしたいそうすれば、blank.tplもなくせる - $this->_smarty = new Smarty; - $this->_smarty->left_delimiter = ''; + $this->_smarty = new \Smarty\Smarty(); + $this->_smarty->setLeftDelimiter(''); $this->_smarty->registerPlugin('modifier', 'sfDispDBDate', function ($dbdate, $time = true) { return SC_Utils_Ex::sfDispDBDate($dbdate, $time); }); $this->_smarty->registerPlugin('modifier', 'sfGetErrorColor', array('SC_Utils_Ex', 'sfGetErrorColor')); $this->_smarty->registerPlugin('modifier', 'sfTrim', array('SC_Utils_Ex', 'sfTrim')); @@ -141,10 +141,10 @@ public function registFilter() /** * prefilter用のフィルタ関数。プラグイン用のフックポイント処理を実行 * @param string $source ソース - * @param Smarty_Internal_Template $smarty Smartyのコンパイラクラス + * @param \Smarty\Template $smarty Smartyのコンパイラクラス * @return string $source ソース */ - public function prefilter_transform($source, Smarty_Internal_Template $template) + public function prefilter_transform($source, \Smarty\Template $template) { if (!is_null($this->objPage)) { // フックポイントを実行. @@ -160,10 +160,10 @@ public function prefilter_transform($source, Smarty_Internal_Template $template) /** * outputfilter用のフィルタ関数。プラグイン用のフックポイント処理を実行 * @param string $source ソース - * @param Smarty_Internal_Template $smarty Smartyのコンパイラクラス + * @param \Smarty\Template $smarty Smartyのコンパイラクラス * @return string $source ソース */ - public function outputfilter_transform($source, Smarty_Internal_Template $template) + public function outputfilter_transform($source, \Smarty\Template $template) { if (!is_null($this->objPage)) { // フックポイントを実行. @@ -281,9 +281,9 @@ public function lower_compatibility_smarty($tpl_source, $smarty) * @param Smarty_Internal_Template $template * @return string 現在のテンプレートファイルパス */ - public function getCurrentTemplateFile(Smarty_Internal_Template $template) + public function getCurrentTemplateFile(\Smarty\Template $template) { - $current_file = str_replace($template->smarty->getTemplateDir(), '', $template->source->filepath); + $current_file = str_replace($template->getSmarty()->getTemplateDir(), '', $template->getSource()->getFilepath()); return str_replace('\\', '/', $current_file); // Windows 向けにパスの区切り文字を正規化する } } diff --git a/data/smarty_extends/function.html_radios_ex.php b/data/smarty_extends/function.html_radios_ex.php deleted file mode 100644 index 69487e3955..0000000000 --- a/data/smarty_extends/function.html_radios_ex.php +++ /dev/null @@ -1,17 +0,0 @@ -