/* Get URL/Anchor strings now. */
$url_anchor = null;
-$url_in = $url_form = Horde_Util::getFormData('url');
+$url_in = Horde_Util::getFormData('url');
if (($pos = strrpos($url_in, '#')) !== false) {
$url_anchor = substr($url_in, $pos + 1);
$url_in = substr($url_in, 0, $pos);
}
if ($browser->isMobile()) {
- require_once 'Horde/Mobile.php';
-
/* Build the <select> widget containing the available languages. */
if (!$is_auth && !$prefs->isLocked('language')) {
- $lang_select = new Horde_Mobile_select('new_lang', 'popup', _("Language:"));
- $lang_select->set('htmlchars', true);
+ $tmp = array();
foreach ($langs as $val) {
- $lang_select->add($val['name'], $val['val'], $val['sel']);
+ $tmp[$val['val']] = array(
+ 'name' => $val['name'],
+ 'selected' => $val['sel']
+ );
}
+ $loginparams['new_lang'] = array(
+ 'label' => _("Language"),
+ 'type' => 'select',
+ 'value' => $tmp
+ );
}
+ 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;
}
require $registry->get('templates', 'horde') . '/login/login.inc';
if (!empty($js_code)) {
- print '<script type="text/javascript">//<![CDATA[' . "\n" . implode(';', $js_code) . "\n//]]></script>\n";
+ echo Horde::wrapInlineScript(array(implode(';', $js_code)));
}
require $registry->get('templates', 'horde') . '/common-footer.inc';
<?php
/**
+ * Mobile portal page.
+ *
* Copyright 2002-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
$fullname = Horde_Auth::getAuth();
}
-$m = new Horde_Mobile(_("Welcome"));
-$m->add(new Horde_Mobile_text(sprintf(_("Welcome, %s"), $fullname)));
-
+$links = array();
foreach ($registry->listApps() as $app) {
if ($registry->hasMobileView($app)) {
- $m->add(new Horde_Mobile_link($registry->get('name', $app), Horde::url($registry->get('webroot', $app) . '/'), $registry->get('name', $app)));
+ $links[htmlspecialchars($registry->get('name', $app))] = Horde::url($registry->get('webroot', $app) . '/');
}
}
-$m->display();
+$title = _("Welcome");
+
+require HORDE_TEMPLATES . '/common-header.inc';
+require HORDE_TEMPLATES . '/portal/mobile.inc';
+require HORDE_TEMPLATES . '/common-footer.inc';
+<?php if (!$GLOBALS['browser']->isMobile()): ?>
<script type="text/javascript">
if (document.title && parent.frames && parent.frames.horde_main) {
parent.document.title = document.title;
}
</script>
-<?php if (isset($GLOBALS['notification'])) $GLOBALS['notification']->notify(array('listeners' => array('audio', 'javascript'))); ?>
+<?php $GLOBALS['notification']->notify(array('listeners' => array('audio', 'javascript'))); ?>
+<?php endif; ?>
</body>
</html>
}
?>
<title><?php echo htmlspecialchars($page_title) ?></title>
+<?php if (!$browser->isMobile()): ?>
<link href="<?php echo $GLOBALS['registry']->getImageDir() ?>/favicon.ico" rel="SHORTCUT ICON" />
<?php
echo Horde::includeStylesheetFiles(array('additional' => Horde_Util::nonInputVar('horde_css_stylesheets', array())));
echo implode("\n", Horde_Util::nonInputVar('linkTags', array()));
Horde::outputInlineScript();
?>
+<?php endif ?>
</head>
<body<?php if ($bc = Horde_Util::nonInputVar('bodyClass')) echo ' class="' . $bc . '"' ?><?php if ($bi = Horde_Util::nonInputVar('bodyId')) echo ' id="' . $bi . '"'; ?>>
-<?php
-
-$m = new Horde_Mobile($title);
-$m->add(new Horde_Mobile_text(sprintf(_("Welcome to %s"), $registry->get('name'))));
-
-$f = new Horde_Mobile_form('login.php');
-$f->add(new Horde_Mobile_hidden('app', $app));
-$f->add(new Horde_Mobile_hidden('url', Horde_Util::getFormData('url', '')));
-$f->add(new Horde_Mobile_hidden('anchor_string', Horde_Util::getFormData('anchor_string', '')));
-
-foreach ($loginparams as $key => $val) {
- switch ($val['type']) {
- case 'hidden':
- $f->add(new Horde_Mobile_hidden($key, isset($val['value']) ? $val['value'] : ''));
- break;
-
- case 'text':
- $f->add(new Horde_Mobile_input($key, isset($val['value']) ? $val['value'] : '', $val['label']));
- break;
+<div><?php printf(_("Welcome to %s"), htmlspecialchars($registry->get('name'))) ?></div>
- case 'password':
- $p = $f->add(new Horde_Mobile_input($key, isset($val['value']) ? $val['value'] : '', $val['label']));
- $p->set('type', 'password');
- break;
+<form action="login.php" method="post">
+ <input type="hidden" name="anchor_string" value="<?php echo htmlspecialchars(strval(Horde_Util::getFormData('anchor_string'))) ?>" />
+ <input type="hidden" name="app" value="<?php echo htmlspecialchars($app) ?>" />
+ <input type="hidden" name="url" value="<?php echo htmlspecialchars(strval(Horde_Util::getFormData('url'))) ?>" />
- case 'select':
- $s = $f->add(new Horde_Mobile_select($key, 'popup', $val['label']));
- foreach ($val['value'] as $k2 => $v2) {
- // Doesn't account for 'hidden' values
- $s->add($v2['name'], $k2, !empty($v2['selected']));
+ <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'] : '') . '" />';
+ }
+ echo '</label></div>';
+ break;
}
}
-}
-
-if (!empty($lang_select)) {
- $f->add($lang_select);
-}
-
-// Submit button.
-$f->add(new Horde_Mobile_submit($title, 'login_button'));
-
-// Add the form to the page.
-$m->add($f);
-
-// Display everything.
-$m->display();
+?>
+ </p>
+ <p>
+ <input type="submit" name="login_button" value="<?php echo htmlspecialchars($title) ?>" />
+ </p>
+</form>
--- /dev/null
+<p><?php echo sprintf(_("Welcome, %s"), $fullname) ?></p>
+
+<ul>
+<?php foreach ($links as $key => $val): ?>
+ <li><a href="<?php echo $val ?>"><?php echo $key ?></a></li>
+<?php endforeach; ?>
+</ul>