* * -------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ /* $Id$ */ $phpgw_info = array(); if (!is_file('header.inc.php')) { echo '
There is a new version of phpGroupWare available. http://www.phpgroupware.org';
$GLOBALS['phpgw_info']['flags']['msgbox_data'][$message]=True;
}
$_found = False;
$GLOBALS['phpgw']->db->query("select app_name,app_version from phpgw_applications",__LINE__,__FILE__);
while($GLOBALS['phpgw']->db->next_record())
{
$_db_version = $GLOBALS['phpgw']->db->f('app_version');
$_app_name = $GLOBALS['phpgw']->db->f('app_name');
$_versionfile = $GLOBALS['phpgw']->common->get_app_dir($_app_name) . '/setup/setup.inc.php';
if(file_exists($_versionfile))
{
include($_versionfile);
$_file_version = $setup_info[$_app_name]['version'];
unset($setup_info);
if($GLOBALS['phpgw']->common->cmp_version_long($_db_version,$_file_version))
{
$_found = True;
$_app_string .= '
' . $GLOBALS['phpgw_info']['apps'][$_app_name]['title'];
}
unset($_file_version);
}
unset($_db_version);
unset($_versionfile);
}
if($_found)
{
$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);
}
}
if (isset($GLOBALS['phpgw_info']['user']['apps']['notifywindow']) &&
$GLOBALS['phpgw_info']['user']['apps']['notifywindow'])
{
/* need to figure out how to implement this properly
echo '' . lang('Open notify window') . '';
*/
}
/* This initializes the users portal_order preference if it does not exist. */
if(!is_array($GLOBALS['phpgw_info']['user']['preferences']['portal_order']) && $GLOBALS['phpgw_info']['apps'])
{
$GLOBALS['phpgw']->preferences->delete('portal_order');
@reset($GLOBALS['phpgw_info']['apps']);
$order = 0;
while (list(,$p) = each($GLOBALS['phpgw_info']['apps']))
{
if($GLOBALS['phpgw_info']['user']['apps'][$p['name']])
{
$GLOBALS['phpgw']->preferences->add('portal_order',$order++,$p['id']);
}
}
$GLOBALS['phpgw_info']['user']['preferences'] = $GLOBALS['phpgw']->preferences->save_repository();
}
if(is_array($GLOBALS['phpgw_info']['user']['preferences']['portal_order']))
{
$app_check = Array();
@ksort($GLOBALS['phpgw_info']['user']['preferences']['portal_order']);
while(list($order,$app) = each($GLOBALS['phpgw_info']['user']['preferences']['portal_order']))
{
if(!isset($app_check[intval($app)]) || !$app_check[intval($app)])
{
$app_check[intval($app)] = True;
$sorted_apps[] = $GLOBALS['phpgw']->applications->id2name(intval($app));
}
}
}
else
{
$sorted_apps = Array
(
'email',
'calendar',
'news',
'addressbook',
'squirrelmail'
);
}
@reset($sorted_apps);
$GLOBALS['phpgw']->portalbox = CreateObject('phpgwapi.listbox');
$GLOBALS['phpgw']->hooks->process('home',$sorted_apps);
if($GLOBALS['portal_order'])
{
$GLOBALS['phpgw']->preferences->delete('portal_order');
@reset($GLOBALS['portal_order']);
while(list($app_order,$app_id) = each($GLOBALS['portal_order']))
{
$GLOBALS['phpgw']->preferences->add('portal_order',$app_order,$app_id);
}
$GLOBALS['phpgw']->preferences->save_repository();
}
$GLOBALS['phpgw_info']['flags']['currentapp'] = 'home'; // has been changed by hook_home's
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',$GLOBALS['phpgw']->portalbox->output);
}
?>