From 48c4bfdc9b01103ed76cbc63922e4876567165a1 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Tue, 9 Jan 2007 23:14:21 +0000 Subject: [PATCH] put current_user code in its own functions --- phpgwapi/inc/class.egw_framework.inc.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index dcb41259a7..1889928807 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -290,14 +290,11 @@ class egw_framework else { $var['current_app_title']=$apps[$GLOBALS['egw_info']['flags']['currentapp']]['title']; - } + } + // current users for admins - if(isset($apps['admin']) && $GLOBALS['egw_info']['user']['preferences']['common']['show_currentusers']) - { - $var['current_users'] = '' - . lang('Current users') . ': ' . $GLOBALS['egw']->session->total() . ''; - } + $var['current_users'] = $this->_current_users(); + // quick add selectbox $var['quick_add'] = $this->_get_quick_add(); @@ -355,6 +352,15 @@ class egw_framework return $user_info; } + function _current_users() + { + if( $GLOBALS['egw_info']['user']['apps']['admin'] && $GLOBALS['egw_info']['user']['preferences']['common']['show_currentusers']) + { + $current_users = '' . lang('Current users') . ': ' . $GLOBALS['egw']->session->total() . ''; + return $current_users; + } + } + /** * Prepare the quick add selectbox *