From b79cc545ec020f7dd4bd83dcd06af3cf2b1fcaff Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 28 Aug 2012 05:20:20 -0400
Subject: [PATCH] Improvements/fixes for Larry skin

---
 program/include/rcube_output_html.php |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/program/include/rcube_output_html.php b/program/include/rcube_output_html.php
index 7ceea18..a071ee3 100644
--- a/program/include/rcube_output_html.php
+++ b/program/include/rcube_output_html.php
@@ -67,6 +67,11 @@
         $this->set_env('task', $task);
         $this->set_env('x_frame_options', $this->config->get('x_frame_options', 'sameorigin'));
 
+        // add cookie info
+        $this->set_env('cookie_domain', ini_get('session.cookie_domain'));
+        $this->set_env('cookie_path', ini_get('session.cookie_path'));
+        $this->set_env('cookie_secure', ini_get('session.cookie_secure'));
+
         // load the correct skin (in case user-defined)
         $skin = $this->config->get('skin');
         $this->set_skin($skin);
@@ -149,7 +154,7 @@
         else {
             $skin_path = $this->config->get('skin_path');
             if (!$skin_path) {
-                $skin_path = 'skins/default';
+                $skin_path = 'skins/' . rcube_config::DEFAULT_SKIN;
             }
             $valid = !$skin;
         }
@@ -696,10 +701,31 @@
             // show a label
             case 'label':
                 if ($attrib['name'] || $attrib['command']) {
+                    // @FIXME: 'noshow' is useless, remove?
+                    if ($attrib['noshow']) {
+                        return '';
+                    }
+
                     $vars = $attrib + array('product' => $this->config->get('product_name'));
                     unset($vars['name'], $vars['command']);
-                    $label = $this->app->gettext($attrib + array('vars' => $vars));
-                    return !$attrib['noshow'] ? (get_boolean((string)$attrib['html']) ? $label : html::quote($label)) : '';
+
+                    $label   = $this->app->gettext($attrib + array('vars' => $vars));
+                    $quoting = !empty($attrib['quoting']) ? strtolower($attrib['quoting']) : (get_boolean((string)$attrib['html']) ? 'no' : '');
+
+                    switch ($quoting) {
+                        case 'no':
+                        case 'raw':
+                            break;
+                        case 'javascript':
+                        case 'js':
+                            $label = rcmail::JQ($label);
+                            break;
+                        default:
+                            $label = html::quote($label);
+                            break;
+                    }
+
+                    return $label;
                 }
                 break;
 
@@ -1357,6 +1383,9 @@
         if (empty($url) && !preg_match('/_(task|action)=logout/', $_SERVER['QUERY_STRING']))
             $url = $_SERVER['QUERY_STRING'];
 
+        // Disable autocapitalization on iPad/iPhone (#1488609)
+        $attrib['autocapitalize'] = 'off';
+
         // set atocomplete attribute
         $user_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off');
         $host_attrib = $autocomplete > 0 ? array() : array('autocomplete' => 'off');

--
Gitblit v1.9.1