diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-04-29 17:19:24 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-04-29 17:19:24 +0000 |
commit | 076a235bb0ab769099e73d832c2e4a349af5821e (patch) | |
tree | 6a6933e673138f5e9ef4b04cc22ec6b7c901f4f4 /phpBB/includes/template.php | |
parent | f1de99ff9a175b3075da92f7b7d1e0405d31d9c5 (diff) | |
download | forums-076a235bb0ab769099e73d832c2e4a349af5821e.tar forums-076a235bb0ab769099e73d832c2e4a349af5821e.tar.gz forums-076a235bb0ab769099e73d832c2e4a349af5821e.tar.bz2 forums-076a235bb0ab769099e73d832c2e4a349af5821e.tar.xz forums-076a235bb0ab769099e73d832c2e4a349af5821e.zip |
introduce LA_ for addslashing language variables for use in js vars (idea by naderman)
git-svn-id: file:///svn/phpbb/trunk@5865 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/template.php')
-rw-r--r-- | phpBB/includes/template.php | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 022ef4f68c..de54eff7ec 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -23,11 +23,12 @@ if (!defined('IN_PHPBB')) class template { - // variable that holds all the data we'll be substituting into - // the compiled templates. Takes form: - // --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value - // if it's a root-level variable, it'll be like this: - // --> $this->_tpldata[.][0][varname] == value + /** variable that holds all the data we'll be substituting into + * the compiled templates. Takes form: + * --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value + * if it's a root-level variable, it'll be like this: + * --> $this->_tpldata[.][0][varname] == value + */ var $_tpldata = array(); // Root dir and hash of filenames for each template handle. @@ -38,13 +39,11 @@ class template // this will hash handle names to the compiled/uncompiled code for that handle. var $compiled_code = array(); - var $static_lang; - /** * Set template location * @public */ - function set_template($static_lang = false) + function set_template() { global $phpbb_root_path, $config, $user; @@ -54,8 +53,6 @@ class template $this->cachepath = $phpbb_root_path . 'cache/tpl_' . $user->theme['template_path'] . '_'; } - $this->static_lang = $static_lang; - return true; } @@ -63,15 +60,13 @@ class template * Set custom template location (able to use directory outside of phpBB) * @public */ - function set_custom_template($template_path, $template_name, $static_lang = false) + function set_custom_template($template_path, $template_name) { global $phpbb_root_path; $this->root = $template_path; $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . $template_name . '_'; - $this->static_lang = $static_lang; - return true; } @@ -91,7 +86,7 @@ class template { if (empty($filename)) { - trigger_error("template error - Empty filename specified for $handle", E_USER_ERROR); + trigger_error("template->set_filenames: Empty filename specified for $handle", E_USER_ERROR); } $this->filename[$handle] = $filename; @@ -158,7 +153,7 @@ class template { global $user, $phpEx, $config; - $filename = $this->cachepath . $this->filename[$handle] . '.' . (($this->static_lang) ? $user->data['user_lang'] . '.' : '') . $phpEx; + $filename = $this->cachepath . $this->filename[$handle] . '.' . $phpEx; $recompile = (($config['load_tplcompile'] && @filemtime($filename) < filemtime($this->files[$handle])) || !file_exists($filename)) ? true : false; @@ -227,7 +222,7 @@ class template else { // Only bother compiling if it doesn't already exist - if (!file_exists($this->cachepath . $row['template_filename'] . '.' . (($this->static_lang) ? $user->data['user_lang'] . '.' : '') . $phpEx)) + if (!file_exists($this->cachepath . $row['template_filename'] . '.' . $phpEx)) { $this->filename[$row['template_filename']] = $row['template_filename']; $compile->compile_write($row['template_filename'], $compile->compile(trim($row['template_data']))); |