diff --git a/Smarty/Smarty.class.php b/Smarty/Smarty.class.php index b298c3276..aa2c3fe59 100644 --- a/Smarty/Smarty.class.php +++ b/Smarty/Smarty.class.php @@ -1107,8 +1107,8 @@ public function templateExists($resource_name) { * * @return \Smarty current Smarty instance for chaining */ - public function setTemplateDir($template_dir, $isConfig = false) { - $this->addTemplateDir($template_dir, null, $isConfig); + public function setTemplateDir($template_dir) { + $this->template_dir = (array) $template_dir; return $this; } diff --git a/smarty5/Smarty.php b/smarty5/Smarty.php index 9da8a4ede..a35958563 100644 --- a/smarty5/Smarty.php +++ b/smarty5/Smarty.php @@ -1,5 +1,8 @@ smarty = new Smarty\Smarty(); + $this->smarty->addExtension(new Extension()); global $civicrm_root; $pluginsDirectory = $civicrm_root . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . 'plugins'; $files = scandir($pluginsDirectory); foreach ($files as $file) { - if (str_starts_with($file, '.')) { + if (str_starts_with($file, '.') || str_starts_with($file, 'modifier')) { continue; } if (CRM_Utils_File::isIncludable($pluginsDirectory .DIRECTORY_SEPARATOR . $file)) { @@ -53,4 +57,8 @@ public function loadFilter($type, $name) { } } + public function getVersion(): ?int { + return 5; + } + }