From 67a3908f24ed963eb6fcd1601301fd3d16c253d9 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 13 Nov 2010 12:45:00 -0500 Subject: [PATCH] Advertise Nag's mobile view, automatically detect it, and add Home/Logout links --- nag/index.php | 9 +++++++-- nag/lib/Application.php | 7 +++++++ nag/mobile.php | 7 +++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/nag/index.php b/nag/index.php index a3ef9765e..340370a07 100644 --- a/nag/index.php +++ b/nag/index.php @@ -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 diff --git a/nag/lib/Application.php b/nag/lib/Application.php index 6c72380aa..457ef3419 100644 --- a/nag/lib/Application.php +++ b/nag/lib/Application.php @@ -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: diff --git a/nag/mobile.php b/nag/mobile.php index 55a98c7de..59789e310 100644 --- a/nag/mobile.php +++ b/nag/mobile.php @@ -40,8 +40,11 @@ require $registry->get('templates', 'horde') . '/common-header-mobile.inc';
-

My Tasks

- +
+

My Tasks

+ + +