fixed a couple of problems with automatic switch to idots template from mobile browsers: csp-error, wrong icons

This commit is contained in:
Ralf Becker 2014-03-03 17:35:48 +00:00
parent f45c1e7d53
commit 11d77f3dab
4 changed files with 9 additions and 6 deletions

View File

@ -854,7 +854,7 @@ class common
{ {
if (is_null($template_set)) if (is_null($template_set))
{ {
$template_set = $GLOBALS['egw_info']['user']['preferences']['common']['template_set']; $template_set = $GLOBALS['egw_info']['server']['template_set'];
} }
if (is_null($svg)) if (is_null($svg))
{ {

View File

@ -1144,8 +1144,8 @@ if ($app == 'home') continue;
'etag' => md5(json_encode(config::clientConfigs()).egw_link::json_registry()), 'etag' => md5(json_encode(config::clientConfigs()).egw_link::json_registry()),
)); ));
self::validate_file('/phpgwapi/images.php', array( self::validate_file('/phpgwapi/images.php', array(
'template' => $GLOBALS['egw_info']['user']['preferences']['common']['template_set'], 'template' => $GLOBALS['egw_info']['server']['template_set'],
'etag' => md5(json_encode(common::image_map($GLOBALS['egw_info']['user']['preferences']['common']['template_set']))), 'etag' => md5(json_encode(common::image_map($GLOBALS['egw_info']['server']['template_set']))),
'svg' => 0, // always load non-svg image map 'svg' => 0, // always load non-svg image map
)); ));
self::validate_file('/phpgwapi/user.php', array( self::validate_file('/phpgwapi/user.php', array(

View File

@ -255,6 +255,11 @@
{ {
egw(window).message(JSON.parse(egw_script.getAttribute('data-message'))); egw(window).message(JSON.parse(egw_script.getAttribute('data-message')));
} }
// hide location bar for mobile browsers
if (egw_script.getAttribute('data-mobile'))
{
window.scrollTo(0, 1);
}
}); });
}); });

View File

@ -99,7 +99,6 @@ class idots_framework extends egw_framework
// the instanciation of the template has to be here and not in the constructor, // the instanciation of the template has to be here and not in the constructor,
// as the old Template class has problems if restored from the session (php-restore) // as the old Template class has problems if restored from the session (php-restore)
if (!is_object($this->tpl)) ;
$this->tpl = new Template(EGW_TEMPLATE_DIR,'keep'); $this->tpl = new Template(EGW_TEMPLATE_DIR,'keep');
$this->tpl->set_file(array('_head' => 'head.tpl')); $this->tpl->set_file(array('_head' => 'head.tpl'));
$this->tpl->set_block('_head','head'); $this->tpl->set_block('_head','head');
@ -107,8 +106,7 @@ class idots_framework extends egw_framework
if (html::$ua_mobile) if (html::$ua_mobile)
{ {
self::$css_include_files[] = '/phpgwapi/templates/idots/mobile.css'; self::$css_include_files[] = '/phpgwapi/templates/idots/mobile.css';
// hide location bar $extra['mobile'] = true;
egw_framework::set_onload('window.setTimeout(function(){window.scrollTo(0, 1);}, 100);');
} }
// load idots specific javascript files, if we are not in login or logout // load idots specific javascript files, if we are not in login or logout