From 7085a0c2f7104a56a7e946c43ba0b5736be5f4e7 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 27 Dec 2016 14:47:01 +0100 Subject: * smarty bundled --- lib/smarty3/sysplugins/smarty_template_config.php | 99 +++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 lib/smarty3/sysplugins/smarty_template_config.php (limited to 'lib/smarty3/sysplugins/smarty_template_config.php') diff --git a/lib/smarty3/sysplugins/smarty_template_config.php b/lib/smarty3/sysplugins/smarty_template_config.php new file mode 100644 index 0000000..44cdba6 --- /dev/null +++ b/lib/smarty3/sysplugins/smarty_template_config.php @@ -0,0 +1,99 @@ + true, 'php' => true); + if ($_template) { + $smarty = $_template->smarty; + $template_resource = $_template->template_resource; + } + if (empty($template_resource)) { + throw new SmartyException('Source: Missing name'); + } + // parse resource_name, load resource handler + list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $smarty->default_config_type); + // make sure configs are not loaded via anything smarty can't handle + if (isset($_incompatible_resources[ $type ])) { + throw new SmartyException ("Unable to use resource '{$type}' for config"); + } + $source = new Smarty_Template_Config($smarty, $template_resource, $type, $name); + $source->handler->populate($source, $_template); + if (!$source->exists && isset($smarty->default_config_handler_func)) { + Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); + $source->handler->populate($source, $_template); + } + return $source; + } +} -- cgit v1.2.3