From 96577bfcd9e09544a039744e4efb00839c999708 Mon Sep 17 00:00:00 2001 From: seek3r Date: Fri, 31 May 2002 09:25:52 +0000 Subject: [PATCH] few minor bug fixed --- home.php | 71 ++++++------------------------- phpgwapi/inc/class.common.inc.php | 22 +++++----- phpgwapi/inc/functions.inc.php | 10 +++-- 3 files changed, 29 insertions(+), 74 deletions(-) diff --git a/home.php b/home.php index af6ddc1e86..2b7a8bcc2f 100755 --- a/home.php +++ b/home.php @@ -54,62 +54,14 @@ $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['phpgw_info']['server']['force_default_app']; } - if (($GLOBALS['phpgw_info']['user']['preferences']['common']['useframes'] && - $GLOBALS['phpgw_info']['server']['useframes'] == 'allowed') || - ($GLOBALS['phpgw_info']['server']['useframes'] == 'always')) - { - if ($GLOBALS['HTTP_GET_VARS']['cd'] == 'yes') - { - if (! $navbarframe && ! $framebody) - { - $tpl = new Template(PHPGW_TEMPLATE_DIR); - $tpl->set_file(array( - 'frames' => 'frames.tpl', - 'frame_body' => 'frames_body.tpl', - 'frame_navbar' => 'frames_navbar.tpl' - )); - $tpl->set_var('navbar_link',$GLOBALS['phpgw']->link('index.php','navbarframe=True&cd=yes')); - if ($GLOBALS['forward']) - { - $tpl->set_var('body_link',$GLOBALS['phpgw']->link($GLOBALS['forward'])); - } - else - { - $tpl->set_var('body_link',$GLOBALS['phpgw']->link('index.php','framebody=True&cd=yes')); - } - - if ($GLOBALS['phpgw_info']['user']['preferences']['common']['frame_navbar_location'] == 'bottom') - { - $tpl->set_var('frame_size','*,60'); - $tpl->parse('frames_','frame_body',True); - $tpl->parse('frames_','frame_navbar',True); - } - else - { - $tpl->set_var('frame_size','60,*'); - $tpl->parse('frames_','frame_navbar',True); - $tpl->parse('frames_','frame_body',True); - } - $tpl->pparse('out','frames'); - } - if ($navbarframe) - { - $GLOBALS['phpgw']->common->phpgw_header(); - } - } - } - elseif ($GLOBALS['HTTP_GET_VARS']['cd']=='yes' && $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] + if ($GLOBALS['HTTP_GET_VARS']['cd']=='yes' && $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] && $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']]) { $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php')); } - else - { - $GLOBALS['phpgw']->common->phpgw_header(); - } $GLOBALS['phpgw']->translation->add_app('mainscreen'); - if (lang('mainscreen_message') != 'mainscreen_message*') + if (lang('mainscreen_message') != 'mainscreen_message'.lang_char()) { echo '
' . stripslashes(lang('mainscreen_message')) . '
'; } @@ -130,8 +82,9 @@ } if($GLOBALS['phpgw']->common->cmp_version($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],$line_found[1])) { - echo '

There is a new version of phpGroupWare available. http://www.phpgroupware.org'; + $GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=True; } $_found = False; @@ -161,9 +114,12 @@ } if($_found) { - echo '
' . lang('The following applications require upgrades') . ':' . "\n"; - echo $_app_string . "\n"; - echo '
' . lang('Please run setup to become current') . '.' . "\n"; + $message = '
' . lang('The following applications require upgrades') . ':' . "\n"; + $message .= $_app_string . "\n"; + $message .= '
' . lang('Please run setup to become current') . '.' . "\n"; + + $GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=False; + unset($message); unset($_app_string); } } @@ -171,7 +127,7 @@ if (isset($GLOBALS['phpgw_info']['user']['apps']['notifywindow']) && $GLOBALS['phpgw_info']['user']['apps']['notifywindow']) { -?> +/* need to figure out how to implement this properly -' . lang('Open notify window') . ''; +*/ } /* This initializes the users portal_order preference if it does not exist. */ @@ -249,8 +205,5 @@ } $GLOBALS['phpgw']->preferences->save_repository(); } - - //$phpgw->common->debug_phpgw_info(); - //$phpgw->common->debug_list_core_functions(); $GLOBALS['phpgw']->common->phpgw_footer(); ?> diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 2b5307d8fb..c0ca002ff6 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1233,28 +1233,28 @@ { /* Make sure some of the defaults are set */ - if (!isset($phpgw_info['theme']['css']['A'])) + if (!isset($GLOBALS['phpgw_info']['theme']['css']['A'])) { - $phpgw_info['theme']['css']['A'] = 'text-decoration:none;'; + $GLOBALS['phpgw_info']['theme']['css']['A'] = 'text-decoration:none;'; } - if (!isset($phpgw_info['theme']['css']['A:link']) && !empty($GLOBALS['phpgw_info']['theme']['link'])) + if (!isset($GLOBALS['phpgw_info']['theme']['css']['A:link']) && !empty($GLOBALS['phpgw_info']['theme']['link'])) { - $phpgw_info['theme']['css']['A:link'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['link'].';'; + $GLOBALS['phpgw_info']['theme']['css']['A:link'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['link'].';'; } - if (!isset($phpgw_info['theme']['css']['A:visited']) && !empty($GLOBALS['phpgw_info']['theme']['vlink'])) + if (!isset($GLOBALS['phpgw_info']['theme']['css']['A:visited']) && !empty($GLOBALS['phpgw_info']['theme']['vlink'])) { - $phpgw_info['theme']['css']['A:visited'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['vlink'].';'; + $GLOBALS['phpgw_info']['theme']['css']['A:visited'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['vlink'].';'; } - if (!isset($phpgw_info['theme']['css']['A:active']) && !empty($GLOBALS['phpgw_info']['theme']['alink'])) + if (!isset($GLOBALS['phpgw_info']['theme']['css']['A:active']) && !empty($GLOBALS['phpgw_info']['theme']['alink'])) { - $phpgw_info['theme']['css']['A:active'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['alink'].';'; + $GLOBALS['phpgw_info']['theme']['css']['A:active'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['alink'].';'; } - if (!isset($phpgw_info['theme']['css']['A:hover']) && !empty($GLOBALS['phpgw_info']['theme']['hovlink'])) + if (!isset($GLOBALS['phpgw_info']['theme']['css']['A:hover']) && !empty($GLOBALS['phpgw_info']['theme']['hovlink'])) { - $phpgw_info['theme']['css']['A:hover'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['hovlink'].';'; + $GLOBALS['phpgw_info']['theme']['css']['A:hover'] = 'text-decoration:none; color: '.$GLOBALS['phpgw_info']['theme']['hovlink'].';'; } /* now put the css data into the template class */ @@ -1832,7 +1832,7 @@ $prefs['email']['mail_port'] = '110'; } // This is going to be used to switch to the nntp class - if (isset($phpgw_info['flags']['newsmode']) && + if (isset($GLOBALS['phpgw_info']['flags']['newsmode']) && $GLOBALS['phpgw_info']['flags']['newsmode']) { $prefs['email']['mail_server_type'] = 'nntp'; diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 30d0e0799f..9798b52bea 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -53,6 +53,10 @@ $value = $GLOBALS['phpgw']->translation->translate("$key",$vars); return $value; } + function lang_char() + { + return $GLOBALS['phpgw']->translation->translator_helper; + } /* Just a temp wrapper. ###DELETE_ME#### (Seek3r) */ function check_code($code) @@ -273,8 +277,7 @@ { if(@isset($GLOBALS['phpgw_info']['server']['enforce_ssl']) && $GLOBALS['phpgw_info']['server']['enforce_ssl'] && !$GLOBALS['HTTP_SERVER_VARS']['HTTPS']) { - Header('Location: ' . $GLOBALS['phpgw']->redirect($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI'])); - exit; + $GLOBALS['phpgw']->redirect($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']); } if (@$login != '') { @@ -298,8 +301,7 @@ \**************************************************************************/ if (! $GLOBALS['phpgw']->session->verify()) { - Header('Location: ' . $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->session->link('/login.php','code=10'))); - exit; + $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->session->link('/login.php','code=10')); } /***************************************************************************\