self::$_metaTags = array();
}
+ /**
+ * Is an AJAX view supported/available on the current browser?
+ *
+ * return boolean True if the AJAX view can be displayed.
+ */
+ static public function ajaxAvailable()
+ {
+ global $browser;
+
+ return $browser->hasFeature('xmlhttpreq') &&
+ (!$browser->isBrowser('msie') || $browser->getMajor() >= 7) &&
+ (!$browser->hasFeature('issafari') || $browser->getMajor() >= 2);
+ }
+
}
/* Enforce minimum browser standards for DIMP.
* No IE < 7; Safari < 3 */
- if (($sess['view'] == 'dimp') &&
- (($GLOBALS['browser']->isBrowser('msie') &&
- ($GLOBALS['browser']->getMajor() < 7)) ||
- ($GLOBALS['browser']->hasFeature('issafari') &&
- ($GLOBALS['browser']->getMajor() < 2)))) {
+ if (($sess['view'] == 'dimp') && !Horde::ajaxAvailable()) {
$sess['view'] = 'imp';
$GLOBALS['notification']->push(_("Your browser is too old to display the dynamic mode. Using traditional mode instead."), 'horde.warning');
}
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);
+ Horde::ajaxAvailable();
}
/**