From 8e99ffbcaccf83602a47b2be230eb4dd2f106399 Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 13 May 2011 17:22:35 +0000 Subject: - Use less included files in mail and message templates for better performance - Add access to template name in template expressions --- program/include/rcube_template.php | 9 ++++- skins/default/includes/forwardmenu.html | 7 ---- skins/default/includes/messagemenu.html | 10 ----- skins/default/includes/messagetoolbar.html | 65 ++++++++++++++++++++++++++++++ skins/default/includes/replyallmenu.html | 7 ---- skins/default/templates/mail.html | 33 +-------------- skins/default/templates/message.html | 23 +---------- 7 files changed, 74 insertions(+), 80 deletions(-) delete mode 100644 skins/default/includes/forwardmenu.html delete mode 100644 skins/default/includes/messagemenu.html create mode 100644 skins/default/includes/messagetoolbar.html delete mode 100644 skins/default/includes/replyallmenu.html diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index 3131b39c2..8495ab8ee 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -38,6 +38,7 @@ class rcube_template extends rcube_html_page private $js_commands = array(); private $object_handlers = array(); private $plugin_skin_path; + private $template_name; public $browser; public $framed = false; @@ -365,7 +366,9 @@ class rcube_template extends rcube_html_page $plugin = false; $realname = $name; $temp = explode('.', $name, 2); + $this->plugin_skin_path = null; + $this->template_name = $realname; if (count($temp) > 1) { $plugin = $temp[0]; @@ -600,7 +603,8 @@ class rcube_template extends rcube_html_page '/env:([a-z0-9_]+)/i', '/request:([a-z0-9_]+)/i', '/cookie:([a-z0-9_]+)/i', - '/browser:([a-z0-9_]+)/i' + '/browser:([a-z0-9_]+)/i', + '/template:name/i', ), array( "\$_SESSION['\\1']", @@ -608,7 +612,8 @@ class rcube_template extends rcube_html_page "\$this->env['\\1']", "get_input_value('\\1', RCUBE_INPUT_GPC)", "\$_COOKIE['\\1']", - "\$this->browser->{'\\1'}" + "\$this->browser->{'\\1'}", + $this->template_name, ), $expression); } diff --git a/skins/default/includes/forwardmenu.html b/skins/default/includes/forwardmenu.html deleted file mode 100644 index 685d67ec5..000000000 --- a/skins/default/includes/forwardmenu.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -
diff --git a/skins/default/includes/messagemenu.html b/skins/default/includes/messagemenu.html deleted file mode 100644 index e89155ae8..000000000 --- a/skins/default/includes/messagemenu.html +++ /dev/null @@ -1,10 +0,0 @@ -
- -
diff --git a/skins/default/includes/messagetoolbar.html b/skins/default/includes/messagetoolbar.html new file mode 100644 index 000000000..dcc27caea --- /dev/null +++ b/skins/default/includes/messagetoolbar.html @@ -0,0 +1,65 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+
    +
  • +
  • +
  • +
  • + +
+
+ diff --git a/skins/default/includes/replyallmenu.html b/skins/default/includes/replyallmenu.html deleted file mode 100644 index 5cf1236b4..000000000 --- a/skins/default/includes/replyallmenu.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
    -
  • -
  • - -
-
diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html index 7ea93145d..ea6a2f71c 100644 --- a/skins/default/templates/mail.html +++ b/skins/default/templates/mail.html @@ -102,41 +102,10 @@ - - - - -
- - - - - - - - - - - - - - -
- -
-
    -
  • -
  • -
  • -
  • - -
- - - +
    diff --git a/skins/default/templates/message.html b/skins/default/templates/message.html index 3fd14e4b6..8e2bb2cb3 100644 --- a/skins/default/templates/message.html +++ b/skins/default/templates/message.html @@ -16,28 +16,7 @@ - -
    - - - - - - - - - - - - - - - -
    - - - - +
    -- cgit v1.2.3