From 4004c9a4e1e1ee794b1797ede1acde638bca73e5 Mon Sep 17 00:00:00 2001 From: seek3r Date: Fri, 31 May 2002 08:29:19 +0000 Subject: [PATCH] updated so that login page will destroy frames, cleaned up various other issues like better lang support in msgbox, now langs trailing char can be turned off. several other improvements --- login.php | 1 + phpgwapi/inc/class.common.inc.php | 41 +++++++- phpgwapi/inc/class.phpgw.inc.php | 4 - phpgwapi/inc/class.translation_file.inc.php | 3 +- phpgwapi/inc/class.translation_sql.inc.php | 3 +- phpgwapi/templates/default/login.tpl | 1 - phpgwapi/templates/default/phpgw.tpl | 102 ++++++++------------ 7 files changed, 80 insertions(+), 75 deletions(-) diff --git a/login.php b/login.php index 32e1ff1711..684fe48b32 100755 --- a/login.php +++ b/login.php @@ -43,6 +43,7 @@ $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_main_basic','phpgw_main'); $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'); exit; diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index d9328a6dd5..2b5307d8fb 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1025,7 +1025,10 @@ $row = 1; } + $prev_helper = $GLOBALS['phpgw']->translation->translator_helper; + $GLOBALS['phpgw']->translation->translator_helper = ''; $GLOBALS['phpgw']->template->set_var('msgbox_text',lang($key)); + $GLOBALS['phpgw']->translation->translator_helper = $prev_helper; if ($value == True) { $GLOBALS['phpgw']->template->set_var('msgbox_img',$this->image('phpgwapi','msgbox_good')); @@ -1042,7 +1045,9 @@ else { $GLOBALS['phpgw']->template->set_var('msgbox_row_color',$GLOBALS['phpgw_info']['theme']['row_on']); - $GLOBALS['phpgw']->template->set_var('msgbox_text',lang($text)); + $GLOBALS['phpgw']->translation->translator_helper = ''; + $GLOBALS['phpgw']->template->set_var('msgbox_text',lang($key)); + $GLOBALS['phpgw']->translation->translator_helper = $prev_helper; if ($type == True) { $GLOBALS['phpgw']->template->set_var('msgbox_img',$this->image('phpgwapi','msgbox_good')); @@ -1287,11 +1292,38 @@ $preload_image_string .= "'$value'"; } } - $preload_image_string = "MM_preloadImages($preload_image_string); "; - $GLOBALS['phpgw']->template->set_var('phpgw_preload_images',$preload_image_string); + return " MM_preloadImages($preload_image_string);"; } + return ''; } + + function load_phpgw_body_tags() + { + $GLOBALS['phpgw_info']['flags']['body_tags']['marginwidth']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['marginheight']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['topmargin']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['bottommargin']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['rightmargin']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['leftmargin']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['leftmargin']='0'; + $GLOBALS['phpgw_info']['flags']['body_tags']['border']='0'; + + $GLOBALS['phpgw_info']['flags']['body_tags']['onLoad'] .= $this->load_preload_images_data(); + + + if(@is_array($GLOBALS['phpgw_info']['flags']['body_tags'])) + { + $body_tags_string = ''; + reset($GLOBALS['phpgw_info']['flags']['body_tags']); + while(list($key,$value) = each($GLOBALS['phpgw_info']['flags']['body_tags'])) + { + $body_tags_string .= " $key=\"$value\""; + } + $GLOBALS['phpgw']->template->set_var('phpgw_body_tags',$body_tags_string); + } + } + /*! @function phpgw_header @abstract load the phpgw header @@ -1358,7 +1390,8 @@ $GLOBALS['phpgw']->db->disconnect(); $this->msgbox('',False,'phpgw_msgbox'); $this->load_css_data(); - $this->load_preload_images_data(); + $this->load_phpgw_body_tags(); + $GLOBALS['phpgw']->template->set_block('phpgw','phpgw_head_javascript'); $GLOBALS['phpgw']->template->pfp('out','phpgw_main'); /* diff --git a/phpgwapi/inc/class.phpgw.inc.php b/phpgwapi/inc/class.phpgw.inc.php index bd0f22e437..d1ca5c2dbd 100644 --- a/phpgwapi/inc/class.phpgw.inc.php +++ b/phpgwapi/inc/class.phpgw.inc.php @@ -133,10 +133,6 @@ } } -// if(@isset($GLOBALS['HTTP_GET_VARS']['framepart'])) -// { -// $url .= '" target="_parent"'; -// } if ($iis) { echo "\n\n\nRedirecting to $url"; diff --git a/phpgwapi/inc/class.translation_file.inc.php b/phpgwapi/inc/class.translation_file.inc.php index 878cd49465..5fc06e1eaa 100644 --- a/phpgwapi/inc/class.translation_file.inc.php +++ b/phpgwapi/inc/class.translation_file.inc.php @@ -27,6 +27,7 @@ var $lang; // Currently loaded translations var $loaded = False; var $all_loaded = False; + var $translator_helper = '*'; function translation() { @@ -66,7 +67,7 @@ $this->load_langs(True); } - $ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . '*'; + $ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . $this->translator_helper; $ndx = 1; while(list($key,$val) = each($vars)) diff --git a/phpgwapi/inc/class.translation_sql.inc.php b/phpgwapi/inc/class.translation_sql.inc.php index 73d84062df..03a731ae46 100644 --- a/phpgwapi/inc/class.translation_sql.inc.php +++ b/phpgwapi/inc/class.translation_sql.inc.php @@ -31,6 +31,7 @@ var $userlang = 'en'; var $currentapp = ''; var $loaded = False; + var $translator_helper = '*'; /*! @function translation @@ -104,7 +105,7 @@ $this->load_langs(); } - $ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . '*'; + $ret = @isset($this->lang[$_key]) ? $this->lang[$_key] : $key . $this->translator_helper; $ndx = 1; while(list($key,$val) = each($vars)) diff --git a/phpgwapi/templates/default/login.tpl b/phpgwapi/templates/default/login.tpl index 00616dc9e7..336d3f022e 100644 --- a/phpgwapi/templates/default/login.tpl +++ b/phpgwapi/templates/default/login.tpl @@ -15,7 +15,6 @@ -
diff --git a/phpgwapi/templates/default/phpgw.tpl b/phpgwapi/templates/default/phpgw.tpl index 42defc7d14..a8a87e92e3 100644 --- a/phpgwapi/templates/default/phpgw.tpl +++ b/phpgwapi/templates/default/phpgw.tpl @@ -11,41 +11,11 @@ {phpgw_head_website_title} - + {phpgw_head_javascript} {phpgw_css} {phpgw_head_tags} - +
@@ -76,41 +46,11 @@ {phpgw_head_website_title} - + {phpgw_head_javascript} {phpgw_css} {phpgw_head_tags} - + {phpgw_msgbox} {phpgw_body} @@ -146,3 +86,37 @@ + + + +
{phpgw_top}