diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2013-06-03 22:42:49 +0200 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2013-06-03 22:42:49 +0200 |
| commit | af8c4b29009548fd1a28c3210c4734d84e4ebb48 (patch) | |
| tree | 12a0bec1c9e91484534c7737afc9d06c6ee95b9d /phpBB/includes/template/compile.php | |
| parent | 79823b9cafb41f4f9405c6a5bf7e0c46b0aa751b (diff) | |
| parent | 74da9e32e5a3eafb942c4a5ab58c642654cf582e (diff) | |
| download | forums-af8c4b29009548fd1a28c3210c4734d84e4ebb48.tar forums-af8c4b29009548fd1a28c3210c4734d84e4ebb48.tar.gz forums-af8c4b29009548fd1a28c3210c4734d84e4ebb48.tar.bz2 forums-af8c4b29009548fd1a28c3210c4734d84e4ebb48.tar.xz forums-af8c4b29009548fd1a28c3210c4734d84e4ebb48.zip | |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into ticket/11531
Diffstat (limited to 'phpBB/includes/template/compile.php')
| -rw-r--r-- | phpBB/includes/template/compile.php | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/phpBB/includes/template/compile.php b/phpBB/includes/template/compile.php index fcdaf7abda..76cb3011df 100644 --- a/phpBB/includes/template/compile.php +++ b/phpBB/includes/template/compile.php @@ -33,6 +33,13 @@ class phpbb_template_compile private $filter_params; /** + * Array of default parameters + * + * @var array + */ + private $default_filter_params; + + /** * Constructor. * * @param bool $allow_php Whether PHP code will be allowed in templates (inline PHP code, PHP tag and INCLUDEPHP tag) @@ -44,18 +51,40 @@ class phpbb_template_compile */ public function __construct($allow_php, $style_names, $locator, $phpbb_root_path, $extension_manager = null, $user = null) { - $this->filter_params = array( - 'allow_php' => $allow_php, - 'style_names' => $style_names, - 'locator' => $locator, + $this->filter_params = $this->default_filter_params = array( + 'allow_php' => $allow_php, + 'style_names' => $style_names, + 'locator' => $locator, 'phpbb_root_path' => $phpbb_root_path, 'extension_manager' => $extension_manager, - 'user' => $user, + 'user' => $user, 'template_compile' => $this, + 'cleanup' => true, ); } /** + * Set filter parameters + * + * @param array $params Array of parameters (will be merged onto $this->filter_params) + */ + public function set_filter_params($params) + { + $this->filter_params = array_merge( + $this->filter_params, + $params + ); + } + + /** + * Reset filter parameters to their default settings + */ + public function reset_filter_params() + { + $this->filter_params = $this->default_filter_params; + } + + /** * Compiles template in $source_file and writes compiled template to * cache directory * |
