diff options
author | David King <imkingdavid@gmail.com> | 2013-05-22 16:10:51 -0400 |
---|---|---|
committer | David King <imkingdavid@gmail.com> | 2013-05-22 16:10:51 -0400 |
commit | 4b0d51adea5ca0214e917c61c7920ca4d057c06d (patch) | |
tree | 2685bd3cfc3f03cc6e1b1ddc5debf41daf4d4045 /phpBB/includes/template/compile.php | |
parent | 3ab222d1c748f26378152606a27accc8de9a45e0 (diff) | |
parent | 06720fb0d795423331372c73304ba923e47f7135 (diff) | |
download | forums-4b0d51adea5ca0214e917c61c7920ca4d057c06d.tar forums-4b0d51adea5ca0214e917c61c7920ca4d057c06d.tar.gz forums-4b0d51adea5ca0214e917c61c7920ca4d057c06d.tar.bz2 forums-4b0d51adea5ca0214e917c61c7920ca4d057c06d.tar.xz forums-4b0d51adea5ca0214e917c61c7920ca4d057c06d.zip |
Merge remote-tracking branch 'EXreaction/ticket/11435-2' into develop
* EXreaction/ticket/11435-2:
[ticket/11435] Enable spacing test as it should now pass
[ticket/11435] Create new template filter option (cleanup)
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 * |