will be a 'Message Source' link in the parts list of every message, allowing
the user to view the entire raw message, or to download it and save it to
disk.">true</configboolean>
- <configswitch name="select_view" desc="If either DIMP or MIMP is available,
- allow user to select the application view on login?">true
+ <configswitch name="select_view" desc="Allow user to select the application
+ view mode on login?">false
<case name="true" desc="Yes"/>
<case name="false" desc="No">
- <configenum name="force_view" desc="Which application view should be used
- for all users?">imp
+ <configenum name="force_view" desc="Force an application view to be used
+ for all users?">
<values>
+ <value desc="None (use user's browser and 'dynamic_view' preference)"></value>
<value desc="IMP">imp</value>
<value desc="DIMP">dimp</value>
<value desc="MIMP">mimp</value>
'column' => _("Other Options"),
'label' => _("Dynamic View Options"),
'desc' => _("Configure options for the dynamic view."),
- 'members' => array('dimp_login_view')
+ 'members' => array('dynamic_view', 'dimp_login_view')
+);
+
+// Show dynamic view?
+$_prefs['dynamic_view'] = array(
+ 'value' => 1,
+ 'type' => 'checkbox',
+ 'desc' => _("Show the dynamic view by default, if the browser supports it?")
);
// Login preferences (dimp)
v5.0-git
--------
+[mms] Automatically determine view based on browser and 'dynamic_view'
+ preference (Request #9159).
[mms] Add preference to define default font family/size for the HTML compose
editor.
[mms] Honor nav_expanded preference (DIMP).
}
/* Show selection of alternate views. */
- if (empty($GLOBALS['conf']['user']['select_view'])) {
- $view_cookie = empty($conf['user']['force_view'])
- ? 'imp'
- : $conf['user']['force_view'];
- } else {
- $views = array();
+ $js_code = array(
+ 'ImpLogin.server_key_error=' . Horde_Serialize::serialize(_("Please choose a mail server."), Horde_Serialize::JSON)
+ );
+ if (!empty($GLOBALS['conf']['user']['select_view'])) {
if (!($view_cookie = Horde_Util::getFormData('imp_select_view'))) {
$view_cookie = isset($_COOKIE['default_imp_view'])
? $_COOKIE['default_imp_view']
: ($GLOBALS['browser']->isMobile() ? 'mimp' : 'imp');
}
+ $js_code[] = 'ImpLogin.dimp_sel=' . intval($view_cookie == 'dimp');
+
$params['imp_select_view'] = array(
'label' => _("Mode"),
'type' => 'select',
}
return array(
- 'js_code' => array(
- 'ImpLogin.dimp_sel=' . intval($view_cookie == 'dimp'),
- 'ImpLogin.server_key_error=' . Horde_Serialize::serialize(_("Please choose a mail server."), Horde_Serialize::JSON)
- ),
+ 'js_code' => $js_code,
'js_files' => array(
array('login.js', 'imp')
),
$editor = $GLOBALS['injector']->getInstance('Horde_Editor')->getEditor('Ckeditor', array('no_notify' => true));
$sess['rteavail'] = $editor->supportedByBrowser();
- /* Set view in session/cookie. */
- $sess['view'] = empty($conf['user']['select_view'])
- ? (empty($conf['user']['force_view']) ? 'imp' : $conf['user']['force_view'])
- : (empty($sess['cache']['select_view']) ? 'imp' : $sess['cache']['select_view']);
+ /* Determine view. */
+ $setcookie = false;
+ if (empty($conf['user']['force_view'])) {
+ if (empty($conf['user']['select_view']) ||
+ empty($sess['cache']['select_view'])) {
+ $sess['view'] = $GLOBALS['browser']->isMobile()
+ ? 'mimp'
+ : ($GLOBALS['prefs']->getValue('dynamic_view') ? 'dimp' : 'imp');
+ } else {
+ $setcookie = true;
+ $sess['view'] = $sess['cache']['select_view'];
+ }
+ } else {
+ $sess['view'] = $conf['user']['force_view'];
+ }
- /* Enforce minimum browser standards for DIMP.
- * No IE < 7; Safari < 3 */
+ /* Enforce minimum browser standards for DIMP. */
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');
}
- setcookie('default_imp_view', $sess['view'], time() + 30 * 86400,
- $conf['cookie']['path'],
- $conf['cookie']['domain']);
+ if ($setcookie) {
+ setcookie('default_imp_view', $sess['view'], time() + 30 * 86400, $conf['cookie']['path'], $conf['cookie']['domain']);
+ }
- /* Suppress menus in options screen and indicate that notifications
- * should use the ajax mode. */
+ /* Indicate that notifications should use AJAX mode. */
if ($sess['view'] == 'dimp') {
$_SESSION['horde_notification']['override'] = array(
IMP_BASE . '/lib/Notification/Listener/AjaxStatus.php',