From 0e2e0f544625dd9d663a99648a8a5120602c5f8e Mon Sep 17 00:00:00 2001 From: seek3r Date: Fri, 31 May 2002 18:13:07 +0000 Subject: [PATCH] fixed design to allow for backwards compatibility --- addressbook/inc/class.uifields.inc.php | 4 ++-- login.php | 12 ++++++++---- phpgwapi/inc/class.common.inc.php | 19 +++++++++++++------ phpgwapi/inc/functions.inc.php | 17 +++++++++++++---- phpgwapi/templates/default/phpgw.tpl | 26 +++++++++++++++++++------- 5 files changed, 55 insertions(+), 23 deletions(-) diff --git a/addressbook/inc/class.uifields.inc.php b/addressbook/inc/class.uifields.inc.php index 706a195143..9c8cf39dac 100644 --- a/addressbook/inc/class.uifields.inc.php +++ b/addressbook/inc/class.uifields.inc.php @@ -24,8 +24,8 @@ function uifields() { - $GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); - $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); +// $GLOBALS['phpgw']->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); +// $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); $this->config = CreateObject('phpgwapi.config','addressbook'); } diff --git a/login.php b/login.php index 684fe48b32..76334df203 100755 --- a/login.php +++ b/login.php @@ -40,12 +40,14 @@ // This is used for system downtime, to prevent new logins. if ($GLOBALS['phpgw_info']['server']['deny_all_logins']) { - $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_start','phpgw_main_start'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_end','phpgw_main_end'); $GLOBALS['phpgw']->template->set_block('login','login_form_deny','login_form'); $GLOBALS['phpgw']->template->set_var('template_set','default'); $GLOBALS['phpgw']->template->set_var('phpgw_head_tags',''); $GLOBALS['phpgw']->template->fp('phpgw_body','login_form'); - $GLOBALS['phpgw']->template->pfp('out','phpgw_main'); + $GLOBALS['phpgw']->template->pfp('out','phpgw_main_start'); + $GLOBALS['phpgw']->template->pfp('out','phpgw_main_end'); exit; } @@ -232,7 +234,8 @@ check_logoutcode(); $GLOBALS['phpgw']->common->msgbox('', False,'phpgw_login_msgbox'); - $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_start','phpgw_main_start'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_end','phpgw_main_end'); $GLOBALS['phpgw']->template->set_var('phpgw_head_charset',lang('charset')); $GLOBALS['phpgw']->template->set_var('phpgw_head_description','phpGroupWare - Login Page'); $GLOBALS['phpgw']->template->set_var('phpgw_head_keywords','phpGroupWare'); @@ -251,5 +254,6 @@ $GLOBALS['phpgw']->template->set_var('lang_login',lang('login')); $GLOBALS['phpgw']->template->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']); $GLOBALS['phpgw']->template->fp('phpgw_body','login_form'); - $GLOBALS['phpgw']->template->pfp('out','phpgw_main'); + $GLOBALS['phpgw']->template->pfp('out','phpgw_main_start'); + $GLOBALS['phpgw']->template->pfp('out','phpgw_main_end'); ?> diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index c0ca002ff6..284c17dfe1 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1330,7 +1330,17 @@ */ function phpgw_header($forceheader = True, $forcenavbar = True) { - /* This is no longer used */ + /* So far I dont have use for $forceheader and $forcenavbar */ + /* I only allow this to be run once by using the constant */ + if(!defined('PHPGW_HEADER_RAN')) + { + define('PHPGW_HEADER_RAN',True); + $this->msgbox('',False,'phpgw_msgbox'); + $this->load_css_data(); + $this->load_phpgw_body_tags(); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_head_javascript'); + $GLOBALS['phpgw']->template->pfp('out','phpgw_main_start'); + } } /*! @@ -1388,11 +1398,8 @@ $this->phpgw_appfooter(); } $GLOBALS['phpgw']->db->disconnect(); - $this->msgbox('',False,'phpgw_msgbox'); - $this->load_css_data(); - $this->load_phpgw_body_tags(); - $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_head_javascript'); - $GLOBALS['phpgw']->template->pfp('out','phpgw_main'); + $this->phpgw_header(); + $GLOBALS['phpgw']->template->pfp('out','phpgw_main_end'); /* $GLOBALS['phpgw']->template->p('phpgw_head'); diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 1f73dbde80..9a751b7f06 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -396,7 +396,7 @@ { define('PHPGW_FRAME_PART','start'); } -//$GLOBALS['phpgw_info']['server']['useframes'] = 'always'; +$GLOBALS['phpgw_info']['server']['useframes'] = 'always'; if(((isset($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes']) && $GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] && $GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') || @@ -414,12 +414,14 @@ $GLOBALS['phpgw']->template->set_var('phpgw_left_link',$GLOBALS['phpgw']->session->link('home.php','framepart=left')); $GLOBALS['phpgw']->template->set_var('phpgw_bottom_link',$GLOBALS['phpgw']->session->link('home.php','framepart=bottom')); $GLOBALS['phpgw']->template->set_var('phpgw_unupported_link',$GLOBALS['phpgw']->session->link($GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME'],'framepart=unsupported')); - $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_frames','phpgw_main'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_frames_start','phpgw_main_start'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_frames_end','phpgw_main_end'); } else { /* if we are using frames and not starting then we use the basic block to keep each part in a nice clean html format */ - $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_start','phpgw_main_start'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic_end','phpgw_main_end'); } } else @@ -427,7 +429,8 @@ /* Not using frames, so we default to tables */ define('PHPGW_USE_FRAMES',False); define('PHPGW_NAVBAR_TARGET','_self'); - $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_tables','phpgw_main'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_tables_start','phpgw_main_start'); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_tables_end','phpgw_main_end'); } $GLOBALS['phpgw']->template->set_var('phpgw_head_target',PHPGW_NAVBAR_TARGET); @@ -580,6 +583,12 @@ } if($continue_app_data) { + /* I want to phase this out over time. App apps should put their data into the templates phpgw_body var*/ + if (!@$GLOBALS['phpgw_info']['flags']['noheader']) + { + $GLOBALS['phpgw']->common->phpgw_header(); + } + $GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL); $GLOBALS['phpgw']->template->halt_on_error = 'report'; if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION) diff --git a/phpgwapi/templates/default/phpgw.tpl b/phpgwapi/templates/default/phpgw.tpl index a8a87e92e3..ec64d3c0a3 100644 --- a/phpgwapi/templates/default/phpgw.tpl +++ b/phpgwapi/templates/default/phpgw.tpl @@ -1,4 +1,4 @@ - + @@ -22,7 +22,13 @@ {phpgw_left} - {phpgw_msgbox}{phpgw_body} + + {phpgw_msgbox} + + + + {phpgw_body} + {phpgw_right} @@ -31,9 +37,9 @@ - + - + @@ -52,12 +58,15 @@ {phpgw_msgbox} + + + {phpgw_body} - + - + @@ -84,8 +93,11 @@ + + + - +