X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=program%2Finclude%2Frcube_template.php;h=4709c7377f9477470612b94a2b324bf02830fb1e;hb=511160353722ebec8c258ddd6fa963ec8851eede;hp=201bde511e45f773da8d8f80c4eadc9c348383c5;hpb=4212156c5c79d2f58342feb0d3ed1893f177bcab;p=roundcube.git diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index 201bde5..4709c73 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -16,7 +16,7 @@ | Author: Thomas Bruederli | +-----------------------------------------------------------------------+ - $Id: rcube_template.php 4404 2011-01-12 10:26:32Z alec $ + $Id: rcube_template.php 4666 2011-04-17 09:34:02Z alec $ */ @@ -373,16 +373,19 @@ class rcube_template extends rcube_html_page private function parse($name = 'main', $exit = true) { $skin_path = $this->config['skin_path']; - $plugin = false; + $plugin = false; + $realname = $name; + $temp = explode('.', $name, 2); $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']; + $plugin = $temp[0]; + $name = $temp[1]; + $skin_dir = $plugin . '/skins/' . $this->config['skin']; $skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir; - if (!is_dir($skin_path)) { // fallback to default skin + + // fallback to default skin + if (!is_dir($skin_path)) { $skin_dir = $plugin . '/skins/default'; $skin_path = $this->plugin_skin_path = $this->app->plugins->dir . $skin_dir; } @@ -390,12 +393,13 @@ 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) && $this->deprecated_templates[$realname]) { + $path = "$skin_path/templates/".$this->deprecated_templates[$realname].".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."'"), + 'message' => "Using deprecated template '".$this->deprecated_templates[$realname] + ."' in ".$this->config['skin_path']."/templates. Please rename to '".$realname."'"), true, false); } @@ -406,7 +410,7 @@ class rcube_template extends rcube_html_page 'type' => 'php', 'line' => __LINE__, 'file' => __FILE__, - 'message' => 'Error loading template for '.$name + 'message' => 'Error loading template for '.$realname ), true, true); return false; } @@ -422,7 +426,7 @@ class rcube_template extends rcube_html_page $output = $this->parse_xml($output); // trigger generic hook where plugins can put additional content to the page - $hook = $this->app->plugins->exec_hook("render_page", array('template' => $name, 'content' => $output)); + $hook = $this->app->plugins->exec_hook("render_page", array('template' => $realname, 'content' => $output)); // add debug console if ($this->config['debug_level'] & 8) { @@ -1031,7 +1035,7 @@ class rcube_template extends rcube_html_page $username = $this->app->user->get_username(); } - return idn_to_utf8($username); + return rcube_idn_to_utf8($username); } @@ -1229,8 +1233,8 @@ class rcube_template extends rcube_html_page 'UTF-8' => 'UTF-8 ('.rcube_label('unicode').')', 'US-ASCII' => 'ASCII ('.rcube_label('english').')', 'ISO-8859-1' => 'ISO-8859-1 ('.rcube_label('westerneuropean').')', - 'ISO-8859-2' => 'ISO-8895-2 ('.rcube_label('easterneuropean').')', - 'ISO-8859-4' => 'ISO-8895-4 ('.rcube_label('baltic').')', + 'ISO-8859-2' => 'ISO-8859-2 ('.rcube_label('easterneuropean').')', + 'ISO-8859-4' => 'ISO-8859-4 ('.rcube_label('baltic').')', 'ISO-8859-5' => 'ISO-8859-5 ('.rcube_label('cyrillic').')', 'ISO-8859-6' => 'ISO-8859-6 ('.rcube_label('arabic').')', 'ISO-8859-7' => 'ISO-8859-7 ('.rcube_label('greek').')',