First cut at a jquery-mobile mobile login page
authorChuck Hagenbuch <chuck@horde.org>
Thu, 21 Oct 2010 03:22:27 +0000 (23:22 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 21 Oct 2010 03:22:27 +0000 (23:22 -0400)
horde/login.php
horde/templates/login/mobile.inc

index 2c3e38e..5034cb5 100644 (file)
@@ -317,9 +317,7 @@ if ($browser->isMobile()) {
         );
     }
 
-    require $registry->get('templates', 'horde') . '/common-header.inc';
     require $registry->get('templates', 'horde') . '/login/mobile.inc';
-    require $registry->get('templates', 'horde') . '/common-footer.inc';
     exit;
 }
 
index 63740b8..a8a3590 100644 (file)
@@ -1,38 +1,60 @@
-<div><?php printf(_("Welcome to %s"), htmlspecialchars($registry->get('name'))) ?></div>
+<!DOCTYPE html>
+<html>
+    <head>
+    <title><?php echo $title ?></title>
+    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css">
+    <script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
+    <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script>
+</head>
+<body>
+
+<div data-role="page">
+
+<div data-role="header"><h1><?php echo $title ?></h1></div>
+
+<div data-role="content">
 
 <form action="login.php" method="post">
- <input type="hidden" name="anchor_string" value="<?php echo htmlspecialchars(strval($vars->anchor_string)) ?>" />
- <input type="hidden" name="app" value="<?php echo htmlspecialchars($vars->app) ?>" />
- <input type="hidden" name="url" value="<?php echo htmlspecialchars($vars->url) ?>" />
+ <input type="hidden" name="anchor_string" value="<?php echo htmlspecialchars(strval($vars->anchor_string)) ?>">
+ <input type="hidden" name="app" value="<?php echo htmlspecialchars($vars->app) ?>">
+ <input type="hidden" name="url" value="<?php echo htmlspecialchars($vars->url) ?>">
 
- <p>
 <?php
-    foreach ($loginparams as $key => $val) {
-        switch ($val['type']) {
-        case 'hidden':
-            echo '<input type="hidden" name="' . $key . '" value="' . (isset($val['value']) ? $val['value'] : '') . '" />';
-            break;
-
-        case 'text':
-        case 'password':
-        case 'select':
-            echo '<div><label for="' . $key . '"><em>' . $val['label'] . '</em> ';
-            if ($val['type'] == 'select') {
-                echo '<select id="' . $key . '" name="' . $key . '">';
-                foreach ($val['value'] as $k2 => $v2) {
-                    echo '<option value="' . $k2 . '"' . (empty($v2['selected']) ? '' : ' selected="selected"') . '>' . $v2['name'] . '</option>';
-                }
-                echo '</select>';
-            } else {
-                echo '<input id="' . $key . '" name="' . $key . '" ' . (($val['type'] == 'password') ? 'type="password" ' : '') . 'value="' . (isset($val['value']) ? $val['value'] : '') . '" />';
+foreach ($loginparams as $key => $val) {
+    switch ($val['type']) {
+    case 'hidden':
+        echo '<input type="hidden" name="' . $key . '" value="' . (isset($val['value']) ? $val['value'] : '') . '">';
+        break;
+
+    case 'text':
+    case 'password':
+    case 'select':
+        echo '<div data-role="fieldcontain"><label for="' . $key . '">' . $val['label'] . '</label>';
+        if ($val['type'] == 'select') {
+            echo '<select id="' . $key . '" name="' . $key . '">';
+            foreach ($val['value'] as $k2 => $v2) {
+                echo '<option value="' . $k2 . '"' . (empty($v2['selected']) ? '' : ' selected="selected"') . '>' . $v2['name'] . '</option>';
             }
-            echo '</label></div>';
-            break;
+            echo '</select>';
+        } else {
+            echo '<input id="' . $key . '" name="' . $key . '" ' . (($val['type'] == 'password') ? 'type="password" ' : '') . 'value="' . (isset($val['value']) ? $val['value'] : '') . '">';
         }
+        echo '</div>';
+        break;
     }
+}
 ?>
- </p>
- <p>
-  <input type="submit" name="login_button" value="<?php echo htmlspecialchars($title) ?>" />
- </p>
+<div data-role="fieldcontain">
+ <input type="submit" data-theme="a" name="login_button" value="<?php echo htmlspecialchars($title) ?>">
+</div>
+
 </form>
+
+</div>
+
+<div data-role="footer"></div>
+
+</div>
+
+</body>
+</html>