From 1007f2ec7e3d3580ec91e3ca11efe0a1e6160ffc Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 25 Mar 2014 12:12:00 +0000 Subject: [PATCH] fixed idots not always loaded client-side configuration: now using egw_info[flags][nonavbar] === "popup" to let framework definitly know we dont want a navbar (need to know before navbar is called and can not use true, which is allways set by index.php) --- etemplate/inc/class.etemplate.inc.php | 7 ++--- etemplate/inc/class.etemplate_new.inc.php | 2 ++ .../idots/class.idots_framework.inc.php | 28 ++++--------------- 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index f1c55b9583..79c3635d30 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -328,16 +328,15 @@ class etemplate extends boetemplate { if (!@self::$hooked) { + // let framework know, if we are a popup or not ('popup' not true, which is allways used by index.php!) + $GLOBALS['egw_info']['flags']['nonavbar'] = $output_mode == 2 ? 'popup' : false; + echo $GLOBALS['egw']->framework->header(); if((int) $output_mode != 2) { - // jdots needs sidebox/navbar data in header call, therefore enable navbar BEFORE calling header - $GLOBALS['egw_info']['flags']['nonavbar'] = false; - echo $GLOBALS['egw']->framework->header(); echo $GLOBALS['egw']->framework->navbar(); } else { - echo $GLOBALS['egw']->framework->header(); echo '
'."\n"; if ($GLOBALS['egw_info']['user']['apps']['manual']) // adding a manual icon to every popup { diff --git a/etemplate/inc/class.etemplate_new.inc.php b/etemplate/inc/class.etemplate_new.inc.php index 627ca7d953..4139f6aaf5 100644 --- a/etemplate/inc/class.etemplate_new.inc.php +++ b/etemplate/inc/class.etemplate_new.inc.php @@ -205,6 +205,8 @@ class etemplate_new extends etemplate_widget_template self::$request = null; return; } + // let framework know, if we are a popup or not ('popup' not true, which is allways used by index.php!) + $GLOBALS['egw_info']['flags']['nonavbar'] = $output_mode == 2 ? 'popup' : false; echo $GLOBALS['egw']->framework->header(); if ($output_mode != 2) { diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php index e05dd1f4a3..1f3903a014 100644 --- a/phpgwapi/templates/idots/class.idots_framework.inc.php +++ b/phpgwapi/templates/idots/class.idots_framework.inc.php @@ -64,9 +64,6 @@ class idots_framework extends egw_framework { parent::__construct($template); // call the constructor of the extended class - // js stuff is not needed by login page and gives errors - $GLOBALS['egw_info']['flags']['js_link_registry'] = $GLOBALS['egw_info']['flags']['currentapp'] !== 'login'; - $this->tplsav2 = new tplsavant2(); $this->tplsav2->set_tpl_path(EGW_SERVER_ROOT.SEP.'phpgwapi'.SEP.'templates'.SEP.'idots'); } @@ -91,6 +88,12 @@ class idots_framework extends egw_framework if (self::$header_done) return ''; self::$header_done = true; + // js stuff is not needed by login page or in popups + $GLOBALS['egw_info']['flags']['js_link_registry'] = + !(in_array($GLOBALS['egw_info']['flags']['currentapp'], array('login', 'logout', 'setup')) || + $GLOBALS['egw_info']['flags']['nonavbar'] === 'popup'); + //error_log(__METHOD__."() ".__LINE__.' js_link_registry='.array2string($GLOBALS['egw_info']['flags']['js_link_registry']).' '.function_backtrace()); + $this->send_headers(); // catch error echo'ed before the header, ob_start'ed in the header.inc.php @@ -112,15 +115,6 @@ class idots_framework extends egw_framework // load idots specific javascript files, if we are not in login or logout if (!in_array($GLOBALS['egw_info']['flags']['currentapp'], array('login', 'logout'))) { - // include regular include slidereffects.js - if (!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects']) - { - self::validate_file('/phpgwapi/templates/idots/js/slidereffects.js'); - } - else - { - self::validate_file('/phpgwapi/templates/idots/js/simple_show_hide.js'); - } self::validate_file('/phpgwapi/templates/idots/js/idots.js'); } if ($GLOBALS['egw_info']['user']['preferences']['common']['click_or_onmouseover'] == 'onmouseover' && !html::$ua_mobile) @@ -191,16 +185,6 @@ class idots_framework extends egw_framework $apps = $this->_get_navbar_apps(); $vars = $this->_get_navbar($apps); - // add link registry to non-popup windows - if (!isset($GLOBALS['egw_info']['flags']['js_link_registry'])) - { - self::validate_file('/phpgwapi/config.php'); - self::validate_file('/phpgwapi/images.php',array('template' => $GLOBALS['egw_info']['user']['preferences']['common']['template_set'])); - $content .= ''."\n"; - } if($GLOBALS['egw_info']['user']['preferences']['common']['show_general_menu'] != 'sidebox' && !html::$ua_mobile) { $content .= $this->topmenu($vars,$apps);