- // for an old header, we need to setup the reference before including it
- $GLOBALS['phpgw_info'] =3D& $GLOBALS['egw_info'];
+error_reporting(error_reporting() & ~E_NOTICE);
=
- if(file_exists('../header.inc.php'))
+// for an old header, we need to setup the reference before including it
+$GLOBALS['phpgw_info'] =3D& $GLOBALS['egw_info'];
+
+$GLOBALS['egw_info'] =3D array(
+ 'flags' =3D> array(
+ 'noheader' =3D> True,
+ 'nonavbar' =3D> True,
+ 'currentapp' =3D> 'setup',
+ 'noapi' =3D> True
+));
+if(file_exists('../header.inc.php'))
+{
+ include('../header.inc.php');
+}
+// for an old header we need to setup a reference for the domains
+if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =3D& $GLOBAL=
S['phpgw_domain'];
+
+if (!function_exists('version_compare'))//version_compare() is only availa=
ble in PHP4.1+
+{
+ echo 'eGroupWare now requires PHP 4.1 or greater.<br>';
+ echo 'Please contact your System Administrator';
+ exit;
+}
+
+/* If we included the header.inc.php, but it is somehow broken, cover our=
selves... */
+if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT'))
+{
+ if (defined('PHPGW_SERVER_ROOT') && defined('PHPGW_INCLUDE_ROOT')) // pre=
1.2 install
{
- include('../header.inc.php');
+ define('EGW_SERVER_ROOT',PHPGW_SERVER_ROOT);
+ define('EGW_INCLUDE_ROOT',PHPGW_INCLUDE_ROOT);
}
- // for an old header we need to setup a reference for the domains
- if (!is_array($GLOBALS['egw_domain'])) $GLOBALS['egw_domain'] =3D& $GLOBA=
LS['phpgw_domain'];
+ else // no install
+ {
+ define('EGW_SERVER_ROOT','..');
+ define('EGW_INCLUDE_ROOT','..');
+ define('PHPGW_SERVER_ROOT','..');
+ define('PHPGW_INCLUDE_ROOT','..');
+ }
+ define('EGW_API_INC',EGW_SERVER_ROOT.'/phpgwapi/inc');
+}
=
- if (!function_exists('version_compare'))//version_compare() is only avail=
able in PHP4.1+
+require_once(EGW_INCLUDE_ROOT . '/phpgwapi/inc/common_functions.inc.php');
+
+define('SEP',filesystem_separator());
+
+/**
+ * function to handle multilanguage support
+ *
+ */
+function lang($key,$vars=3Dnull)
+{
+ if(!is_array($vars))
{
- echo 'eGroupWare now requires PHP 4.1 or greater.<br>';
- echo 'Please contact your System Administrator';
- exit;
+ $vars =3D func_get_args();
+ array_shift($vars); // remove $key
}
+ return $GLOBALS['egw_setup']->translation->translate("$key", $vars);
+}
=
- define('SEP',filesystem_separator());
+if(file_exists(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'))
+{
+ include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* To set the c=
urrent core version */
+ /* This will change to just use setup_info */
+ $GLOBALS['egw_info']['server']['versions']['current_header'] =3D $setup_i=
nfo['phpgwapi']['versions']['current_header'];
+}
+else
+{
+ $GLOBALS['egw_info']['server']['versions']['phpgwapi'] =3D 'Undetected';
+}
=