From: Jan Schneider Date: Tue, 20 Jul 2010 20:38:35 +0000 (+0200) Subject: Add showAjaxView(). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7d6ef69a3540299fe2cc5d4725849225c4506ae2;p=horde.git Add showAjaxView(). --- diff --git a/kronolith/index.php b/kronolith/index.php index daee5c6a7..48287b14a 100644 --- a/kronolith/index.php +++ b/kronolith/index.php @@ -10,9 +10,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('kronolith'); /* Load traditional interface? */ -if (!$prefs->getValue('dynamic_view') || !$browser->hasFeature('xmlhttpreq') || - ($browser->isBrowser('msie') && $browser->getMajor() < 7) || - ($browser->hasFeature('issafari') && $browser->getMajor() < 2)) { +if (!Kronolith::showAjaxView()) { if ($prefs->getValue('dynamic_view')) { $notification->push(_("Your browser is too old to display the dynamic mode. Using traditional mode instead."), 'horde.warning'); } diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index ec1da44a9..5b205c6a5 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -2881,6 +2881,21 @@ class Kronolith } /** + * Returns whether to display the ajax view. + * + * return boolean True if the ajax view should be displayed. + */ + public static function showAjaxView() + { + return $GLOBALS['prefs']->getValue('dynamic_view') && + $GLOBALS['browser']->hasFeature('xmlhttpreq') && + (!$GLOBALS['browser']->isBrowser('msie') || + $GLOBALS['browser']->getMajor() >= 7) && + (!$GLOBALS['browser']->hasFeature('issafari') || + $GLOBALS['browser']->getMajor() >= 2); + } + + /** * Used with usort() to sort events based on their start times. */ public static function _sortEventStartTime($a, $b)