From 51609351f2c4b5082b7e6f0744cd3811c325303f Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 11 Oct 2016 14:01:29 +0200 Subject: * initial template --- .../smarty_internal_compile_config_load.php | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 lib/smarty/sysplugins/smarty_internal_compile_config_load.php (limited to 'lib/smarty/sysplugins/smarty_internal_compile_config_load.php') diff --git a/lib/smarty/sysplugins/smarty_internal_compile_config_load.php b/lib/smarty/sysplugins/smarty_internal_compile_config_load.php new file mode 100644 index 0000000..deaa052 --- /dev/null +++ b/lib/smarty/sysplugins/smarty_internal_compile_config_load.php @@ -0,0 +1,85 @@ + true,'parent' => true,'root' => true,'global' => true); + // check and get attributes + $_attr = $this->getAttributes($compiler, $args); + + if ($_attr['nocache'] === true) { + $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno); + } + + + // save posible attributes + $conf_file = $_attr['file']; + if (isset($_attr['section'])) { + $section = $_attr['section']; + } else { + $section = 'null'; + } + $scope = 'local'; + // scope setup + if (isset($_attr['scope'])) { + $_attr['scope'] = trim($_attr['scope'], "'\""); + if (isset($_is_legal_scope[$_attr['scope']])) { + $scope = $_attr['scope']; + } else { + $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno); + } + } + // create config object + $_output = "smarty, \$_smarty_tpl);"; + $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>"; + return $_output; + } + +} + +?> \ No newline at end of file -- cgit v1.2.3