diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-11-07 12:44:54 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-11-07 12:44:54 +0000 |
| commit | 80e91a208d031c0f30c5ac62f2293742cbd77b58 (patch) | |
| tree | 28de88b536172a13432e06264ef99081461a94bd /roundcubemail/program | |
| parent | 8a5a450d463934f0342035731e4e3a1f598438db (diff) | |
Support skins with old template names
git-svn-id: https://svn.roundcube.net/trunk@4192 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rwxr-xr-x | roundcubemail/program/include/rcube_template.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/roundcubemail/program/include/rcube_template.php b/roundcubemail/program/include/rcube_template.php index a30c4f3b2..c8e813835 100755 --- a/roundcubemail/program/include/rcube_template.php +++ b/roundcubemail/program/include/rcube_template.php @@ -44,6 +44,15 @@ class rcube_template extends rcube_html_page public $type = 'html'; public $ajax_call = false; + // deprecated names of templates used before 0.5 + private $deprecated_templates = array( + 'contact' => 'showcontact', + 'contactadd' => 'addcontact', + 'contactedit' => 'editcontact', + 'identityedit' => 'editidentity', + 'messageprint' => 'printmessage', + ); + /** * Constructor * @@ -165,8 +174,7 @@ class rcube_template extends rcube_html_page public function template_exists($name) { $filename = $this->config['skin_path'] . '/templates/' . $name . '.html'; - - return (is_file($filename) && is_readable($filename)); + return (is_file($filename) && is_readable($filename)) || ($this->deprecated_templates[$name] && $this->template_exists($this->deprecated_templates[$name])); } /** @@ -380,6 +388,15 @@ class rcube_template extends rcube_html_page $path = "$skin_path/templates/$name.html"; + if (!is_readable($path) && $this->deprecated_templates[$name]) { + $path = "$skin_path/templates/".$this->deprecated_templates[$name].".html"; + if (is_readable($path)) + raise_error(array('code' => 502, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Using deprecated template '".$this->deprecated_templates[$name]."' in ".$this->config['skin_path']."/templates. Please rename to '".$name."'"), + true, false); + } + // read template file if (($templ = @file_get_contents($path)) === false) { raise_error(array( |
