"setting currentapp='setup' for setup"

This commit is contained in:
Ralf Becker 2008-08-13 07:19:32 +00:00
parent 8a9bf481f5
commit 5447cd6a6d

View File

@ -13,28 +13,35 @@
* @version $Id$ * @version $Id$
*/ */
error_reporting(error_reporting() & ~E_NOTICE); error_reporting(error_reporting() & ~E_NOTICE);
// for an old header, we need to setup the reference before including it // for an old header, we need to setup the reference before including it
$GLOBALS['phpgw_info'] =& $GLOBALS['egw_info']; $GLOBALS['phpgw_info'] =& $GLOBALS['egw_info'];
if(file_exists('../header.inc.php')) $GLOBALS['egw_info'] = array(
{ 'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'setup',
'noapi' => True
));
if(file_exists('../header.inc.php'))
{
include('../header.inc.php'); include('../header.inc.php');
} }
// for an old header we need to setup a reference for the domains // for an old header we need to setup a reference for the domains
if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =& $GLOBALS['phpgw_domain']; if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =& $GLOBALS['phpgw_domain'];
if (!function_exists('version_compare'))//version_compare() is only available in PHP4.1+ if (!function_exists('version_compare'))//version_compare() is only available in PHP4.1+
{ {
echo 'eGroupWare now requires PHP 4.1 or greater.<br>'; echo 'eGroupWare now requires PHP 4.1 or greater.<br>';
echo 'Please contact your System Administrator'; echo 'Please contact your System Administrator';
exit; exit;
} }
/* If we included the header.inc.php, but it is somehow broken, cover ourselves... */ /* If we included the header.inc.php, but it is somehow broken, cover ourselves... */
if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT')) if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT'))
{ {
if (defined('PHPGW_SERVER_ROOT') && defined('PHPGW_INCLUDE_ROOT')) // pre 1.2 install if (defined('PHPGW_SERVER_ROOT') && defined('PHPGW_INCLUDE_ROOT')) // pre 1.2 install
{ {
define('EGW_SERVER_ROOT',PHPGW_SERVER_ROOT); define('EGW_SERVER_ROOT',PHPGW_SERVER_ROOT);
@ -48,31 +55,31 @@
define('PHPGW_INCLUDE_ROOT','..'); define('PHPGW_INCLUDE_ROOT','..');
} }
define('EGW_API_INC',EGW_SERVER_ROOT.'/phpgwapi/inc'); define('EGW_API_INC',EGW_SERVER_ROOT.'/phpgwapi/inc');
} }
require(EGW_INCLUDE_ROOT . '/phpgwapi/inc/common_functions.inc.php'); require_once(EGW_INCLUDE_ROOT . '/phpgwapi/inc/common_functions.inc.php');
define('SEP',filesystem_separator()); define('SEP',filesystem_separator());
/** /**
* function to handle multilanguage support * function to handle multilanguage support
* *
*/ */
function lang($key,$vars=null) function lang($key,$vars=null)
{ {
if(!is_array($vars)) if(!is_array($vars))
{ {
$vars = func_get_args(); $vars = func_get_args();
array_shift($vars); // remove $key array_shift($vars); // remove $key
} }
return $GLOBALS['egw_setup']->translation->translate("$key", $vars); return $GLOBALS['egw_setup']->translation->translate("$key", $vars);
} }
/** /**
* returns array of languages we support, with enabled set to True if the lang file exists * returns array of languages we support, with enabled set to True if the lang file exists
*/ */
function get_langs() function get_langs()
{ {
$f = fopen('./lang/languages','rb'); $f = fopen('./lang/languages','rb');
while($line = fgets($f,200)) while($line = fgets($f,200))
{ {
@ -95,10 +102,10 @@
//print_r($languages); //print_r($languages);
return $languages; return $languages;
} }
function lang_select($onChange=False,$ConfigLang='') function lang_select($onChange=False,$ConfigLang='')
{ {
if (!$ConfigLang) if (!$ConfigLang)
{ {
$ConfigLang = get_var('ConfigLang',Array('POST','COOKIE')); $ConfigLang = get_var('ConfigLang',Array('POST','COOKIE'));
@ -125,20 +132,20 @@
$select .= '</select>' . "\n"; $select .= '</select>' . "\n";
return $select; return $select;
} }
if(file_exists(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php')) if(file_exists(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'))
{ {
include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* To set the current core version */ include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* To set the current core version */
/* This will change to just use setup_info */ /* This will change to just use setup_info */
$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header']; $GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
} }
else else
{ {
$GLOBALS['egw_info']['server']['versions']['phpgwapi'] = 'Undetected'; $GLOBALS['egw_info']['server']['versions']['phpgwapi'] = 'Undetected';
} }
$GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images'; $GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images';
CreateObject('setup.setup',True,True); // setup constuctor assigns itself to $GLOBALS['egw_setup'], doing it twice fails on some php4 CreateObject('setup.setup',True,True); // setup constuctor assigns itself to $GLOBALS['egw_setup'], doing it twice fails on some php4
$GLOBALS['phpgw_setup'] =& $GLOBALS['egw_setup']; $GLOBALS['phpgw_setup'] =& $GLOBALS['egw_setup'];