diff options
author | thomascube <thomas@roundcube.net> | 2010-11-24 11:56:15 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2010-11-24 11:56:15 +0000 |
commit | fbe24e9fa92bf1f118bac2053fea822b8213c3f6 (patch) | |
tree | bd46a90a81a8e7130e53c602ed4af42ee5caacf3 /program | |
parent | 576b330ebd2541d89319ca4ef04e2fde172d2cc8 (diff) |
Allow plugin templates to include local files (#1487133); make autocomplete on login screen configurable
Diffstat (limited to 'program')
-rwxr-xr-x | program/include/rcube_template.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index c8e813835..8a9eff4f5 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -37,6 +37,7 @@ class rcube_template extends rcube_html_page private $js_env = array(); private $js_commands = array(); private $object_handlers = array(); + private $plugin_skin_path; public $browser; public $framed = false; @@ -373,16 +374,17 @@ class rcube_template extends rcube_html_page { $skin_path = $this->config['skin_path']; $plugin = false; + $this->plugin_skin_path = null; $temp = explode(".", $name, 2); if (count($temp) > 1) { $plugin = $temp[0]; $name = $temp[1]; $skin_dir = $plugin . '/skins/' . $this->config['skin']; - $skin_path = $this->app->plugins->dir . $skin_dir; + $skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir; if (!is_dir($skin_path)) { // fallback to default skin $skin_dir = $plugin . '/skins/default'; - $skin_path = $this->app->plugins->dir . $skin_dir; + $skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir; } } @@ -664,7 +666,9 @@ class rcube_template extends rcube_html_page // include a file case 'include': - $path = realpath($this->config['skin_path'].$attrib['file']); + if (!$this->plugin_skin_path || !is_file($path = realpath($this->plugin_skin_path . $attrib['file']))) + $path = realpath(($attrib['skin_path'] ? $attrib['skin_path'] : $this->config['skin_path']).$attrib['file']); + if (is_readable($path)) { if ($this->config['skin_include_php']) { $incl = $this->include_php($path); @@ -1041,6 +1045,7 @@ class rcube_template extends rcube_html_page private function login_form($attrib) { $default_host = $this->config['default_host']; + $attrib['autocomplete'] = $this->config['login_autocomplete'] ? null : 'off'; $_SESSION['temp'] = true; |