From 904fec750520cfa0b3f63940abea3861258385c5 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 11 Mar 2014 04:31:45 -0400
Subject: [PATCH] Add id for login submit button (#1489676) - make it skin independent

---
 program/include/rcmail_output_html.php |   10 ++++++++--
 skins/classic/templates/login.html     |    6 ++----
 skins/classic/common.css               |    4 ++++
 skins/larry/templates/login.html       |    6 ++----
 4 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 45cb9f0..a23b840 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -1629,6 +1629,12 @@
             $out .= $input_host->show();
         }
 
+        if (rcube_utils::get_boolean($attrib['submit'])) {
+            $submit = new html_inputfield(array('type' => 'submit', 'id' => 'rcmloginsubmit',
+                'class' => 'button mainaction', 'value' => $this->app->gettext('login')));
+            $out .= html::p('formbuttons', $submit->show());
+        }
+
         // surround html output with a form tag
         if (empty($attrib['form'])) {
             $out = $this->form_tag(array('name' => $form_name, 'method' => 'post'), $out);
@@ -1691,9 +1697,9 @@
         // add form tag around text field
         if (empty($attrib['form'])) {
             $out = $this->form_tag(array(
-                'name' => "rcmqsearchform",
+                'name'     => "rcmqsearchform",
                 'onsubmit' => self::JS_OBJECT_NAME . ".command('search'); return false",
-                'style' => "display:inline"),
+                'style'    => "display:inline"),
                 $out);
         }
 
diff --git a/skins/classic/common.css b/skins/classic/common.css
index b1ec7c7..ec58af0 100644
--- a/skins/classic/common.css
+++ b/skins/classic/common.css
@@ -882,6 +882,10 @@
   font-weight: bold;
 }
 
+.formbuttons
+{
+  text-align: center;
+}
 
 /***** onclick menu list *****/
 
diff --git a/skins/classic/templates/login.html b/skins/classic/templates/login.html
index 2dacd48..8b549df 100644
--- a/skins/classic/templates/login.html
+++ b/skins/classic/templates/login.html
@@ -16,11 +16,9 @@
 <div class="boxcontent">
 
 <roundcube:form name="form" method="post">
-<roundcube:object name="loginform" form="form" />
-
-<p style="text-align:center;"><input type="submit" class="button mainaction" value="<roundcube:label name='login' />" /></p>
-
+<roundcube:object name="loginform" form="form" submit=true />
 </form>
+
 </div>
 </div>
 
diff --git a/skins/larry/templates/login.html b/skins/larry/templates/login.html
index 8da9411..64ff6be 100644
--- a/skins/larry/templates/login.html
+++ b/skins/larry/templates/login.html
@@ -12,11 +12,9 @@
 <roundcube:object name="logo" src="/images/roundcube_logo.png" id="logo" />
 
 <roundcube:form name="form" method="post">
-<roundcube:object name="loginform" form="form" size="40" />
-
-<p class="formbuttons"><input type="submit" class="button mainaction" value="<roundcube:label name='login' />" /></p>
-
+<roundcube:object name="loginform" form="form" size="40" submit=true />
 </form>
+
 </div>
 
 <div class="box-bottom">

--
Gitblit v1.9.1