Advertise Nag's mobile view, automatically detect it, and add Home/Logout links
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 13 Nov 2010 17:45:00 +0000 (12:45 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 13 Nov 2010 17:52:47 +0000 (12:52 -0500)
nag/index.php
nag/lib/Application.php
nag/mobile.php

index a3ef976..340370a 100644 (file)
@@ -7,5 +7,10 @@
  * See the enclosed file COPYING for license information (GPL). If you
  * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  */
-
-require dirname(__FILE__) . '/list.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('nag');
+if ($browser->isMobile()) {
+    require dirname(__FILE__) . '/mobile.php';
+} else {
+    require dirname(__FILE__) . '/list.php';
+}
\ No newline at end of file
index 6c72380..457ef34 100644 (file)
@@ -40,6 +40,13 @@ class Nag_Application extends Horde_Registry_Application
     public $version = 'H4 (3.0-git)';
 
     /**
+     * Indicate this app has a mobile view available.
+     *
+     * @var boolean
+     */
+    public $mobileView = true;
+
+    /**
      * Initialization function.
      *
      * Global variables defined:
index 55a98c7..59789e3 100644 (file)
@@ -40,8 +40,11 @@ require $registry->get('templates', 'horde') . '/common-header-mobile.inc';
 <body>
 <div data-role="page">
 
-<div data-role="header"><h1>My Tasks</h1></div>
-
+<div data-role="header">
+ <h1>My Tasks</h1>
+ <a class="ui-btn-left" href="<?php echo Horde::getServiceLink('portal', 'horde')?>"><?php echo _("Home")?></a>
+ <a rel="external" class="ui-btn-right" href="<?php echo Horde::getServiceLink('logout', 'horde')?>"><?php echo _("Logout")?></a>
+</div>
 <div data-role="content">
  <ul data-role="listview">
 <?php