diff --git a/setup/applications.php b/setup/applications.php index cfec719385..6b53a364cc 100644 --- a/setup/applications.php +++ b/setup/applications.php @@ -17,7 +17,7 @@ // out from under other apps. e.g. if they select to uninstall the api // this will happen without further warning. - $phpgw_info['flags'] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -25,6 +25,8 @@ ); include ('./inc/functions.inc.php'); + $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain']; + $tpl_root = $phpgw_setup->setup_tpl_dir('setup'); $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root); $setup_tpl->set_file(array( @@ -50,8 +52,8 @@ $setup_tpl->set_block('T_setup_main','footer','footer'); // Check header and authentication - $phpgw_info['setup']['stage']['header'] = $phpgw_setup->check_header(); - if ($phpgw_info['setup']['stage']['header'] != '10') + $GLOBALS['phpgw_info']['setup']['stage']['header'] = $phpgw_setup->check_header(); + if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != '10') { Header("Location: manageheader.php"); exit; @@ -97,7 +99,7 @@ } $phpgw_setup->loaddb(); - $phpgw_info['setup']['stage']['db'] = $phpgw_setup->check_db(); + $GLOBALS['phpgw_info']['setup']['stage']['db'] = $phpgw_setup->check_db(); $setup_info = $phpgw_setup->get_versions(); //var_dump($setup_info);exit; @@ -117,7 +119,7 @@ if ($HTTP_POST_VARS['submit']) { - $phpgw_setup->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]["db_type"] . ')'); + $phpgw_setup->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')'); $setup_tpl->set_var('description',lang('App install/remove/upgrade') . ':'); $setup_tpl->pparse('out','header'); @@ -204,7 +206,7 @@ } else { - $phpgw_setup->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]["db_type"] . ')'); + $phpgw_setup->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')'); } if($HTTP_GET_VARS['detail']) diff --git a/setup/applist.php b/setup/applist.php index fc1b7732dc..26ef60cdf1 100644 --- a/setup/applist.php +++ b/setup/applist.php @@ -25,9 +25,9 @@ $setup_tpl->set_file(array('T_footer' => 'footer.tpl')); $setup_tpl->set_block('T_footer','footer','footer'); - $f = CreateObject('phpgwapi.xmlrpcmsg','system.listApps',array(CreateObject('phpgwapi.xmlrpcval',0, "int"))); - print "
" . htmlentities($f->serialize()) . "
\n"; - $c = CreateObject('phpgwapi.xmlrpc_client',"/phpgroupware/xmlrpc.php", $HTTP_HOST, 80); + $f = CreateObject('phpgwapi.xmlrpcmsg','system.listApps',array(CreateObject('phpgwapi.xmlrpcval',0,'int'))); + print '
' . htmlentities($f->serialize()) . "
\n"; + $c = CreateObject('phpgwapi.xmlrpc_client','/cvsdemo/xmlrpc.php','www.phpgroupware.org',80); $c->setDebug(1); $r = $c->send($f); if (!$r) diff --git a/setup/config.php b/setup/config.php index f8720eeab1..da16954f54 100644 --- a/setup/config.php +++ b/setup/config.php @@ -11,7 +11,7 @@ /* $Id$ */ - $phpgw_info['flags'] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -133,7 +133,7 @@ if ($GLOBALS['current_config']['files_dir'] == '/path/to/dir/phpgroupware/files') { - $GLOBALS['current_config']['files_dir'] = $phpgw_info['server']['server_root'] . '/files'; + $GLOBALS['current_config']['files_dir'] = $GLOBALS['phpgw_info']['server']['server_root'] . '/files'; } if ($error == 'badldapconnection') @@ -154,13 +154,13 @@ var $applications; var $db; } - $phpgw = new phpgw; - $phpgw->common = CreateObject('phpgwapi.common'); + $GLOBALS['phpgw'] = new phpgw; + $GLOBALS['phpgw']->common = CreateObject('phpgwapi.common'); $cfg_apps = array('phpgwapi','admin','preferences'); while(list(,$cfg_app) = each($cfg_apps)) { - $t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir($cfg_app)); + $t = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir($cfg_app)); $t->set_unknowns('keep'); $t->set_file(array('config' => 'config.tpl')); @@ -171,7 +171,7 @@ $t->set_var('row_off', 'EEEEEE'); $vars = $t->get_undefined('body'); - $phpgw->common->hook_single('config',$cfg_app); + $GLOBALS['phpgw']->common->hook_single('config',$cfg_app); while (list($null,$value) = each($vars)) { diff --git a/setup/inc/class.setup.inc.php b/setup/inc/class.setup.inc.php index 24b1372846..43c15d7ee8 100644 --- a/setup/inc/class.setup.inc.php +++ b/setup/inc/class.setup.inc.php @@ -27,9 +27,7 @@ */ function loaddb() { - global $HTTP_POST_VARS, $HTTP_COOKIE_VARS; - - $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain']; + $ConfigDomain = $GLOBALS['HTTP_COOKIE_VARS']['ConfigDomain'] ? $GLOBALS['HTTP_COOKIE_VARS']['ConfigDomain'] : $GLOBALS['HTTP_POST_VARS']['ConfigDomain']; if(empty($ConfigDomain)) { /* This is to fix the reading of this value immediately after the cookie was set on login */ @@ -201,7 +199,7 @@ */ function register_app($appname,$enable=99) { - global $setup_info,$DEBUG; + $setup_info = $GLOBALS['setup_info']; if(!$appname) { @@ -229,7 +227,7 @@ } } - if($DEBUG) + if($GLOBALS['DEBUG']) { echo '
register_app(): ' . $appname . ', version: ' . $setup_info[$appname]['version'] . ', table: ' . $appstbl . '
'; //var_dump($setup_info[$appname]); @@ -279,7 +277,7 @@ */ function app_registered($appname) { - global $setup_info,$DEBUG; + $setup_info = $GLOBALS['setup_info']; if(!$appname) { @@ -295,7 +293,7 @@ $appstbl = 'phpgw_applications'; } - if($DEBUG) + if($GLOBALS['DEBUG']) { echo '
app_registered(): checking ' . $appname . ', table: ' . $appstbl; //var_dump($setup_info[$appname]); @@ -305,13 +303,13 @@ $this->db->next_record(); if ($this->db->f(0)) { - if($DEBUG) + if($GLOBALS['DEBUG']) { echo '... app previously registered.'; } return True; } - if($DEBUG) + if($GLOBALS['DEBUG']) { echo '... app not registered'; } @@ -326,7 +324,7 @@ */ function update_app($appname) { - global $setup_info,$DEBUG; + $setup_info = $GLOBALS['setup_info']; if(!$appname) { @@ -342,7 +340,7 @@ $appstbl = 'phpgw_applications'; } - if($DEBUG) + if($GLOBALS['DEBUG']) { echo '
update_app(): ' . $appname . ', version: ' . $setup_info[$appname]['currentver'] . ', table: ' . $appstbl . '
'; //var_dump($setup_info[$appname]); @@ -422,7 +420,8 @@ { return False; } - global $setup_info; + $setup_info = $GLOBALS['setup_info']; + if ($this->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.10pre8') && ($setup_info['phpgwapi']['currentver'] != '')) { $appstbl = 'applications'; @@ -443,7 +442,7 @@ */ function register_hooks($appname) { - global $setup_info; + $setup_info = $GLOBALS['setup_info']; if(!$appname) { @@ -486,7 +485,7 @@ */ function update_hooks($appname) { - global $setup_info; + $setup_info = $GLOBALS['setup_info']; if(!$appname) { diff --git a/setup/inc/class.setup_detection.inc.php b/setup/inc/class.setup_detection.inc.php index 34304e6bb7..5d614aeb9b 100755 --- a/setup/inc/class.setup_detection.inc.php +++ b/setup/inc/class.setup_detection.inc.php @@ -19,7 +19,6 @@ function get_versions() { - global $phpgw_info, $phpgw_domain, $current_config, $newsetting, $SERVER_NAME; $d = dir(PHPGW_SERVER_ROOT); while($entry=$d->read()) { @@ -41,8 +40,6 @@ function get_db_versions($setup_info='') { - global $phpgw_info; - $this->db->Halt_On_Error = 'no'; $tables = $this->db->table_names(); while(list($key,$val) = @each($tables)) @@ -100,7 +97,6 @@ */ function compare_versions($setup_info) { - global $phpgw_info, $phpgw_domain, $current_config, $newsetting, $SERVER_NAME; reset ($setup_info); while (list ($key, $value) = each ($setup_info)) { @@ -134,7 +130,6 @@ function check_depends($setup_info) { - global $phpgw_info, $phpgw_domain, $current_config, $newsetting, $SERVER_NAME; reset ($setup_info); /* Run the list of apps */ while (list ($key, $value) = each ($setup_info)) @@ -183,38 +178,37 @@ function check_header() { - global $phpgw_domain, $phpgw_info; if(!file_exists('../header.inc.php')) { - $phpgw_info['setup']['header_msg'] = 'Stage One'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One'; return '1'; } else { - if (!isset($phpgw_info['server']['header_admin_password'])) + if (!isset($GLOBALS['phpgw_info']['server']['header_admin_password'])) { - $phpgw_info['setup']['header_msg'] = 'Stage One (No header admin password set)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (No header admin password set)'; return '2'; } - elseif (!isset($phpgw_domain)) + elseif (!isset($GLOBALS['phpgw_domain'])) { - $phpgw_info['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)'; return '3'; } - elseif ($phpgw_info['server']['versions']['header'] != $phpgw_info['server']['versions']['current_header']) + elseif ($GLOBALS['phpgw_info']['server']['versions']['header'] != $GLOBALS['phpgw_info']['server']['versions']['current_header']) { - $phpgw_info['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)'; return '3'; } } /* header.inc.php part settled. Moving to authentication */ - $phpgw_info['setup']['header_msg'] = 'Stage One (Completed)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Completed)'; return '10'; } function check_db() { - global $phpgw_info,$setup_info; + $setup_info = $GLOBALS['setup_info']; $this->db->Halt_On_Error = 'no'; //echo '
'.var_dump($setup_info).'
';exit; @@ -228,12 +222,12 @@ { if ($setup_info['phpgwapi']['currentver'] == $setup_info['phpgwapi']['version']) { - $phpgw_info['setup']['header_msg'] = 'Stage 1 (Tables Complete)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Tables Complete)'; return 10; } else { - $phpgw_info['setup']['header_msg'] = 'Stage 1 (Tables need upgrading)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Tables need upgrading)'; return 4; } } @@ -245,12 +239,12 @@ { //if (isset($isdb)){ $this->db->query('DROP TABLE phpgw_testrights'); - $phpgw_info['setup']['header_msg'] = 'Stage 3 (Install Applications)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Install Applications)'; return 3; } else { - $phpgw_info['setup']['header_msg'] = 'Stage 1 (Create Database)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Create Database)'; return 1; } } @@ -258,13 +252,12 @@ function check_config() { - global $phpgw_info; $this->db->Halt_On_Error = 'no'; - if ($phpgw_info['setup']['stage']['db'] != 10){return '';} + if ($GLOBALS['phpgw_info']['setup']['stage']['db'] != 10){return '';} // Since 0.9.10pre6 config table is named as phpgw_config $config_table = 'config'; - $ver = explode('.',$phpgw_info['server']['versions']['phpgwapi']); + $ver = explode('.',$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']); if(ereg("([0-9]+)(pre)([0-9]+)",$ver[2],$regs)) { @@ -279,22 +272,20 @@ $configed = $this->db->f('config_value'); if ($configed) { - $phpgw_info['setup']['header_msg'] = 'Stage 2 (Needs Configuration)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 2 (Needs Configuration)'; return 1; } else { - $phpgw_info['setup']['header_msg'] = 'Stage 2 (Configuration OK)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 2 (Configuration OK)'; return 10; } } function check_lang() { - global $phpgw_info; - $this->db->Halt_On_Error = 'no'; - if ($phpgw_info['setup']['stage']['db'] != 10) + if ($GLOBALS['phpgw_info']['setup']['stage']['db'] != 10) { return ''; } @@ -302,24 +293,24 @@ $this->db->query("select distinct lang from lang;"); if ($this->db->num_rows() == 0) { - $phpgw_info['setup']['header_msg'] = 'Stage 3 (No languages installed)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (No languages installed)'; return 1; } else { while (@$this->db->next_record()) { - $phpgw_info['setup']['installed_langs'][$this->db->f('lang')] = $this->db->f('lang'); + $GLOBALS['phpgw_info']['setup']['installed_langs'][$this->db->f('lang')] = $this->db->f('lang'); } - reset ($phpgw_info['setup']['installed_langs']); - while (list ($key, $value) = each ($phpgw_info['setup']['installed_langs'])) + reset ($GLOBALS['phpgw_info']['setup']['installed_langs']); + while (list ($key, $value) = each ($GLOBALS['phpgw_info']['setup']['installed_langs'])) { $sql = "select lang_name from languages where lang_id = '".$value."';"; $this->db->query($sql); $this->db->next_record(); - $phpgw_info['setup']['installed_langs'][$value] = $this->db->f('lang_name'); + $GLOBALS['phpgw_info']['setup']['installed_langs'][$value] = $this->db->f('lang_name'); } - $phpgw_info['setup']['header_msg'] = 'Stage 3 (Completed)'; + $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Completed)'; return 10; } } @@ -332,7 +323,7 @@ */ function check_app_tables($appname,$any=False) { - global $setup_info,$DEBUG; + $setup_info = $GLOBALS['setup_info']; if($setup_info[$appname]['tables']) { @@ -346,10 +337,10 @@ } while(list($key,$val) = @each($copy[$appname]['tables'])) { - if ($DEBUG) { echo '
check_app_tables(): Checking: ' . $appname . ',table: ' . $val; } + if ($GLOBALS['DEBUG']) { echo '
check_app_tables(): Checking: ' . $appname . ',table: ' . $val; } if(!$this->isinarray($val,$tables)) { - if ($DEBUG) { echo '
check_app_tables(): ' . $val . ' missing!'; } + if ($GLOBALS['DEBUG']) { echo '
check_app_tables(): ' . $val . ' missing!'; } if (!$any) { return False; @@ -363,7 +354,7 @@ { if ($any) { - if ($DEBUG) { echo '
check_app_tables(): Some tables installed'; } + if ($GLOBALS['DEBUG']) { echo '
check_app_tables(): Some tables installed'; } return True; } } @@ -371,12 +362,12 @@ } if ($none && $any) { - if ($DEBUG) { echo '
check_app_tables(): No tables installed'; } + if ($GLOBALS['DEBUG']) { echo '
check_app_tables(): No tables installed'; } return False; } else { - if ($DEBUG) { echo '
check_app_tables(): All tables installed'; } + if ($GLOBALS['DEBUG']) { echo '
check_app_tables(): All tables installed'; } return True; } } diff --git a/setup/inc/class.setup_process.inc.php b/setup/inc/class.setup_process.inc.php index 1a53e710a8..55af6ef87c 100755 --- a/setup/inc/class.setup_process.inc.php +++ b/setup/inc/class.setup_process.inc.php @@ -34,9 +34,7 @@ */ function init_process() { - global $HTTP_POST_VARS, $HTTP_COOKIE_VARS; - - $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain']; + $ConfigDomain = $GLOBALS['HTTP_COOKIE_VARS']['ConfigDomain'] ? $GLOBALS['HTTP_COOKIE_VARS']['ConfigDomain'] : $GLOBALS['HTTP_POST_VARS']['ConfigDomain']; $phpgw_domain = $GLOBALS['phpgw_domain']; $phpgw_info = $GLOBALS['phpgw_info']; diff --git a/setup/index.php b/setup/index.php index 75bae245ea..acfbe9f9a7 100644 --- a/setup/index.php +++ b/setup/index.php @@ -16,7 +16,7 @@ // page explaining what to do from there (ie, create there own account) $DEBUG = False; - $phpgw_info['flags'] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -49,8 +49,8 @@ $setup_tpl->set_block('T_setup_db_blocks','B_db_stage_default','V_db_stage_default'); // Check header and authentication - $phpgw_info['setup']['stage']['header'] = $phpgw_setup->check_header(); - if ($phpgw_info['setup']['stage']['header'] != '10') + $GLOBALS['phpgw_info']['setup']['stage']['header'] = $phpgw_setup->check_header(); + if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != '10') { Header('Location: manageheader.php'); exit; @@ -66,17 +66,17 @@ // Database actions $phpgw_setup->loaddb(); $setup_info = $phpgw_setup->get_versions(); - $phpgw_info['setup']['stage']['db'] = $phpgw_setup->check_db(); - if ($phpgw_info['setup']['stage']['db'] != 1) + $GLOBALS['phpgw_info']['setup']['stage']['db'] = $phpgw_setup->check_db(); + if ($GLOBALS['phpgw_info']['setup']['stage']['db'] != 1) { $setup_info = $phpgw_setup->get_versions(); $setup_info = $phpgw_setup->get_db_versions($setup_info); - $phpgw_info['setup']['stage']['db'] = $phpgw_setup->check_db(); + $GLOBALS['phpgw_info']['setup']['stage']['db'] = $phpgw_setup->check_db(); } - if ($DEBUG) { echo 'Stage: ' . $phpgw_info['setup']['stage']['db']; } + if ($DEBUG) { echo 'Stage: ' . $GLOBALS['phpgw_info']['setup']['stage']['db']; } // begin DEBUG code - //$phpgw_info['setup']['stage']['db'] = 0; + //$GLOBALS['phpgw_info']['setup']['stage']['db'] = 0; //$action = 'Upgrade'; // end DEBUG code @@ -86,29 +86,29 @@ $subtitle = lang('Create Database'); $submsg = lang('At your request, this script is going to attempt to create the database and assign the db user rights to it'); $subaction = 'created'; - $phpgw_info['setup']['currentver']['phpgwapi'] = 'dbcreate'; - $phpgw_info['setup']['stage']['db'] = 5; + $GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'dbcreate'; + $GLOBALS['phpgw_info']['setup']['stage']['db'] = 5; break; case 'Uninstall all applications': $subtitle = lang('Deleting Tables'); $submsg = lang('At your request, this script is going to take the evil action of uninstalling all your apps, which delete your existing tables and data') . '.'; $subaction = 'uninstalled'; - $phpgw_info['setup']['currentver']['phpgwapi'] = 'drop'; - $phpgw_info['setup']['stage']['db'] = 5; + $GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'drop'; + $GLOBALS['phpgw_info']['setup']['stage']['db'] = 5; break; case 'Upgrade': $subtitle = lang('Upgrading Tables'); $submsg = lang('At your request, this script is going to attempt to upgrade your old applications to the current versions').'.'; $subaction = 'upgraded'; - $phpgw_info['setup']['currentver']['phpgwapi'] = 'oldversion'; - $phpgw_info['setup']['stage']['db'] = 5; + $GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion'; + $GLOBALS['phpgw_info']['setup']['stage']['db'] = 5; break; case 'Install': $subtitle = lang('Creating Tables'); $submsg = lang('At your request, this script is going to attempt to install all the applications for you').'.'; $subaction = 'installed'; - $phpgw_info['setup']['currentver']['phpgwapi'] = 'new'; - $phpgw_info['setup']['stage']['db'] = 5; + $GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'new'; + $GLOBALS['phpgw_info']['setup']['stage']['db'] = 5; break; } $setup_tpl->set_var('subtitle',$subtitle); @@ -118,7 +118,7 @@ // Old PHP if (phpversion() < '3.0.16') { - $phpgw_setup->show_header($phpgw_info['setup']['header_msg'],True); + $phpgw_setup->show_header($GLOBALS['phpgw_info']['setup']['header_msg'],True); $phpgw_setup->show_alert_msg('Error', lang('You appear to be running an old version of PHP
It its recommend that you upgrade to a new version.
Older version of PHP might not run phpGroupWare correctly, if at all.

Please upgrade to at least version 3.0.16')); $phpgw_setup->show_footer(); @@ -128,18 +128,18 @@ // BEGIN setup page //$phpgw_setup->app_status(); - $phpgw_info['server']['app_images'] = 'templates/default/images'; - $incomplete = $phpgw_info['server']['app_images'] . '/incomplete.gif'; - $completed = $phpgw_info['server']['app_images'] . '/completed.gif'; + $GLOBALS['phpgw_info']['server']['app_images'] = 'templates/default/images'; + $incomplete = $GLOBALS['phpgw_info']['server']['app_images'] . '/incomplete.gif'; + $completed = $GLOBALS['phpgw_info']['server']['app_images'] . '/completed.gif'; $setup_tpl->set_var('img_incomplete',$incomplete); $setup_tpl->set_var('img_completed',$completed); $setup_tpl->set_var('db_step_text',lang('Step 1 - Simple Application Management')); - $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain']; + $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain']; - switch($phpgw_info['setup']['stage']['db']) + switch($GLOBALS['phpgw_info']['setup']['stage']['db']) { case 1: $setup_tpl->set_var('dbnotexist',lang('Your Database is not working!')); @@ -203,7 +203,7 @@ // FIXME : CAPTURE THIS OUTPUT $phpgw_setup->db->Halt_On_Error = 'report'; - switch ($phpgw_info['setup']['currentver']['phpgwapi']) + switch ($GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi']) { case 'dbcreate': $phpgw_setup->db->create_database($db_root, $db_pass); @@ -216,11 +216,11 @@ $setup_info = $phpgw_setup->process_pass($setup_info,'new',$DEBUG); $included = True; include('lang.php'); - $phpgw_info['setup']['currentver']['phpgwapi'] = 'oldversion'; + $GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion'; break; case 'oldversion': $setup_info = $phpgw_setup->process_pass($setup_info,'upgrade',$DEBUG); - $phpgw_info['setup']['currentver']['phpgwapi'] = 'oldversion'; + $GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion'; break; } @@ -252,13 +252,13 @@ // Config Section $setup_tpl->set_var('config_step_text',lang('Step 2 - Configuration')); - $phpgw_info['setup']['stage']['config'] = $phpgw_setup->check_config(); + $GLOBALS['phpgw_info']['setup']['stage']['config'] = $phpgw_setup->check_config(); // begin DEBUG code - //$phpgw_info['setup']['stage']['config'] = 10; + //$GLOBALS['phpgw_info']['setup']['stage']['config'] = 10; // end DEBUG code - switch($phpgw_info['setup']['stage']['config']) + switch($GLOBALS['phpgw_info']['setup']['stage']['config']) { case 1: $setup_tpl->set_var('config_status_img',$incomplete); @@ -330,13 +330,13 @@ // Lang Section $setup_tpl->set_var('lang_step_text',lang('Step 3 - Language Management')); - $phpgw_info['setup']['stage']['lang'] = $phpgw_setup->check_lang(); + $GLOBALS['phpgw_info']['setup']['stage']['lang'] = $phpgw_setup->check_lang(); // begin DEBUG code - //$phpgw_info['setup']['stage']['lang'] = 0; + //$GLOBALS['phpgw_info']['setup']['stage']['lang'] = 0; // end DEBUG code - switch($phpgw_info['setup']['stage']['lang']) + switch($GLOBALS['phpgw_info']['setup']['stage']['lang']) { case 1: $setup_tpl->set_var('lang_status_img',$incomplete); @@ -350,8 +350,8 @@ break; case 10: $langs_list = ''; - reset ($phpgw_info['setup']['installed_langs']); - while (list ($key, $value) = each ($phpgw_info['setup']['installed_langs'])) + reset ($GLOBALS['phpgw_info']['setup']['installed_langs']); + while (list ($key, $value) = each ($GLOBALS['phpgw_info']['setup']['installed_langs'])) { if (!$notfirst) { @@ -381,8 +381,8 @@ } $setup_tpl->set_var('apps_step_text',lang('Step 4 - Advanced Application Management')); -// $phpgw_info['setup']['stage']['apps'] = $phpgw_setup->check_apps(); - switch($phpgw_info['setup']['stage']['db']) +// $GLOBALS['phpgw_info']['setup']['stage']['apps'] = $phpgw_setup->check_apps(); + switch($GLOBALS['phpgw_info']['setup']['stage']['db']) { case 1: case 10: @@ -402,7 +402,7 @@ break; } - $phpgw_setup->show_header($phpgw_info['setup']['header_msg'],False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')'); + $phpgw_setup->show_header($GLOBALS['phpgw_info']['setup']['header_msg'],False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')'); $setup_tpl->pparse('out','T_setup_main'); $phpgw_setup->show_footer(); ?> diff --git a/setup/lang.php b/setup/lang.php index fda6b7dc22..ff1de9b9e5 100644 --- a/setup/lang.php +++ b/setup/lang.php @@ -13,7 +13,7 @@ if (!$included) { - $phpgw_info['flags'] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -116,7 +116,7 @@ { if($message_id && $content) { - //echo "
adding - insert into lang values ('$message_id','$app_name','$phpgw_setup->db_lang','$content')"; + // echo "
adding - insert into lang values ('$message_id','$app_name','$phpgw_setup->db_lang','$content')"; $phpgw_setup->db->query("INSERT into lang VALUES ('$message_id','$app_name','$phpgw_setup->db_lang','$content')",__LINE__,__FILE__); } } @@ -132,7 +132,6 @@ Header('Location: index.php'); exit; } - } else { @@ -204,6 +203,7 @@ $setup_tpl->set_var('lang_install',lang('install')); $setup_tpl->set_var('lang_cancel',lang('cancel')); + $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain']; $phpgw_setup->show_header("$stage_title",False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')'); $setup_tpl->pparse('out','T_lang_main'); $phpgw_setup->show_footer(); diff --git a/setup/ldap.php b/setup/ldap.php index 401e09d890..46b523b10c 100644 --- a/setup/ldap.php +++ b/setup/ldap.php @@ -11,7 +11,7 @@ /* $Id$ */ - $phpgw_info["flags"] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -29,9 +29,9 @@ } // Does not return unless user is authorized - if ($cancel) + if ($HTTP_POST_VARS['cancel']) { - Header("Location: index.php"); + Header('Location: index.php'); exit; } @@ -65,12 +65,12 @@ $setup_tpl->set_var('ldapimport','ldapimport.php'); $setup_tpl->set_var('ldapexport','ldapexport.php'); $setup_tpl->set_var('action_url','index.php'); - $setup_tpl->set_var('cancel',lang('Cancel')); $setup_tpl->pfp('out','header'); $setup_tpl->pfp('out','jump'); $setup_tpl->pfp('out','cancel_only'); $setup_tpl->pfp('out','footer'); + $phpgw_setup->show_footer(); ?> diff --git a/setup/schematoy.php b/setup/schematoy.php index 0a734ad2ee..482b7353c4 100644 --- a/setup/schematoy.php +++ b/setup/schematoy.php @@ -12,7 +12,7 @@ /* $Id$ */ $DEBUG = True; - $phpgw_info['flags'] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -20,9 +20,9 @@ ); include ('./inc/functions.inc.php'); - $tpl_root = $phpgw_setup->setup_tpl_dir('setup'); - $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root); - $setup_tpl->set_file(array( + $tpl_root = $GLOBALS['phpgw_setup']->setup_tpl_dir('setup'); + $GLOBALS['setup_tpl'] = CreateObject('phpgwapi.Template',$tpl_root); + $GLOBALS['setup_tpl']->set_file(array( 'T_head' => 'head.tpl', 'T_footer' => 'footer.tpl', 'T_alert_msg' => 'msg_alert_msg.tpl', @@ -31,31 +31,31 @@ 'T_setup_main' => 'schema.tpl' )); - $setup_tpl->set_block('T_login_stage_header','B_multi_domain','V_multi_domain'); - $setup_tpl->set_block('T_login_stage_header','B_single_domain','V_single_domain'); - $setup_tpl->set_block('T_setup_main','header','header'); - $setup_tpl->set_block('T_setup_main','app_header','app_header'); - $setup_tpl->set_block('T_setup_main','apps','apps'); - $setup_tpl->set_block('T_setup_main','detail','detail'); - $setup_tpl->set_block('T_setup_main','table','table'); - $setup_tpl->set_block('T_setup_main','hook','hook'); - $setup_tpl->set_block('T_setup_main','dep','dep'); - $setup_tpl->set_block('T_setup_main','app_footer','app_footer'); - $setup_tpl->set_block('T_setup_main','submit','submit'); - $setup_tpl->set_block('T_setup_main','footer','footer'); + $GLOBALS['setup_tpl']->set_block('T_login_stage_header','B_multi_domain','V_multi_domain'); + $GLOBALS['setup_tpl']->set_block('T_login_stage_header','B_single_domain','V_single_domain'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','header','header'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','app_header','app_header'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','apps','apps'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','detail','detail'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','table','table'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','hook','hook'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','dep','dep'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','app_footer','app_footer'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','submit','submit'); + $GLOBALS['setup_tpl']->set_block('T_setup_main','footer','footer'); // Check header and authentication - $phpgw_info['setup']['stage']['header'] = $phpgw_setup->check_header(); - if ($phpgw_info['setup']['stage']['header'] != '10') + $GLOBALS['phpgw_info']['setup']['stage']['header'] = $GLOBALS['phpgw_setup']->check_header(); + if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != '10') { Header("Location: manageheader.php"); exit; } - elseif (!$phpgw_setup->auth('Config')) + elseif (!$GLOBALS['phpgw_setup']->auth('Config')) { - $phpgw_setup->show_header(lang('Please login'),True); - $phpgw_setup->login_form(); - $phpgw_setup->show_footer(); + $GLOBALS['phpgw_setup']->show_header(lang('Please login'),True); + $GLOBALS['phpgw_setup']->login_form(); + $GLOBALS['phpgw_setup']->show_footer(); exit; } @@ -91,31 +91,32 @@ } } - $phpgw_setup->loaddb(); - $phpgw_info['setup']['stage']['db'] = $phpgw_setup->check_db(); + $GLOBALS['phpgw_setup']->loaddb(); + $GLOBALS['phpgw_info']['setup']['stage']['db'] = $GLOBALS['phpgw_setup']->check_db(); - $setup_info = $phpgw_setup->get_versions(); - //var_dump($setup_info);exit; - $setup_info = $phpgw_setup->get_db_versions($setup_info); - //var_dump($setup_info);exit; - $setup_info = $phpgw_setup->compare_versions($setup_info); - //var_dump($setup_info);exit; - $setup_info = $phpgw_setup->check_depends($setup_info); - //var_dump($setup_info);exit; - @ksort($setup_info); + $GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->get_versions(); + //var_dump($GLOBALS['setup_info']);exit; + $GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->get_db_versions($GLOBALS['setup_info']); + //var_dump($GLOBALS['setup_info']);exit; + $GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->compare_versions($GLOBALS['setup_info']); + //var_dump($GLOBALS['setup_info']);exit; + $GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->check_depends($GLOBALS['setup_info']); + //var_dump($GLOBALS['setup_info']);exit; + @ksort($GLOBALS['setup_info']); - if ($cancel) + if ($HTTP_POST_VARS['cancel']) { - Header("Location: index.php"); + Header('Location: index.php'); exit; } - $phpgw_setup->show_header(lang("Developers' Table Schema Toy"),False,'config',$ConfigDomain); + $ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain']; + $GLOBALS['phpgw_setup']->show_header(lang("Developers' Table Schema Toy"),False,'config',$ConfigDomain); if ($HTTP_POST_VARS['submit']) { - $setup_tpl->set_var('description',lang('App process') . ':'); - $setup_tpl->pparse('out','header'); + $GLOBALS['setup_tpl']->set_var('description',lang('App process') . ':'); + $GLOBALS['setup_tpl']->pparse('out','header'); $appname = $HTTP_POST_VARS['appname']; $install = $HTTP_POST_VARS['install']; @@ -130,8 +131,8 @@ $appdir = PHPGW_SERVER_ROOT . SEP . $appname . SEP . 'setup' . SEP; // Drop newest tables - $terror[$appname]['tables'] = $setup_info[$appname]['tables']; - $phpgw_setup->process_droptables($terror,$DEBUG); + $terror[$appname]['tables'] = $GLOBALS['setup_info'][$appname]['tables']; + $GLOBALS['phpgw_setup']->process_droptables($terror,$DEBUG); $terror[$appname]['tables'] = array(); // Reset tables field to baseline table names @@ -149,38 +150,39 @@ { echo '
Processing ' . $terror[$appname]['name'] . ' to ' . $version[$appname]; - $terror = $phpgw_setup->process_droptables($terror,$DEBUG); - $phpgw_setup->deregister_app($terror[$appname]['name']); + $terror = $GLOBALS['phpgw_setup']->process_droptables($terror,$DEBUG); + $GLOBALS['phpgw_setup']->deregister_app($terror[$appname]['name']); - $terror = $phpgw_setup->process_baseline($terror,$DEBUG); - $terror = $phpgw_setup->process_test_data($terror,$DEBUG); + $terror = $GLOBALS['phpgw_setup']->process_baseline($terror,$DEBUG); + $terror = $GLOBALS['phpgw_setup']->process_test_data($terror,$DEBUG); - $terror = $phpgw_setup->process_upgrade($terror,$DEBUG); + $terror = $GLOBALS['phpgw_setup']->process_upgrade($terror,$DEBUG); } else { echo '
Baseline-only completed for ' . $terror[$appname]['name']; } - echo '
' . $setup_info[$appname]['title'] . ' ' + echo '
' . $GLOBALS['setup_info'][$appname]['title'] . ' ' . lang('tables installed, unless there are errors printed above') . '.'; - $setup_info[$appname]['version'] = $terror[$appname]['version']; - $phpgw_setup->register_app($terror[$appname]['name']); + $GLOBALS['setup_info'][$appname]['version'] = $terror[$appname]['version']; + $GLOBALS['phpgw_setup']->register_app($terror[$appname]['name']); echo '
' . $terror[$appname]['title'] . ' ' . lang('registered') . '.'; } echo '
' . lang('Go back') . ''; - $setup_tpl->pparse('out','footer'); + $GLOBALS['setup_tpl']->pparse('out','footer'); exit; } - if($detail) + if($HTTP_POST_VARS['detail']) { - @ksort($setup_info[$detail]); - @reset($setup_info[$detail]); - $setup_tpl->set_var('description',lang('App details') . ':'); - $setup_tpl->pparse('out','header'); + $detail = $HTTP_POST_VARS['detail']; + @ksort($GLOBALS['setup_info'][$detail]); + @reset($GLOBALS['setup_info'][$detail]); + $GLOBALS['setup_tpl']->set_var('description',lang('App details') . ':'); + $GLOBALS['setup_tpl']->pparse('out','header'); - while (list($key,$val) = each($setup_info[$detail])) + while (list($key,$val) = each($GLOBALS['setup_info'][$detail])) { if ($i) { $i = 0; } else { $i = 1; } @@ -199,32 +201,32 @@ if ($key == 'depends') { $val = parsedep($val); } if (is_array($val)) { $val = implode(',',$val); } - $setup_tpl->set_var('bg_color',$bgcolor[$i]); - $setup_tpl->set_var('name',$key); - $setup_tpl->set_var('details',$val); - $setup_tpl->pparse('out','detail'); + $GLOBALS['setup_tpl']->set_var('bg_color',$bgcolor[$i]); + $GLOBALS['setup_tpl']->set_var('name',$key); + $GLOBALS['setup_tpl']->set_var('details',$val); + $GLOBALS['setup_tpl']->pparse('out','detail'); } echo '
' . lang('Go back') . ''; - $setup_tpl->pparse('out','footer'); + $GLOBALS['setup_tpl']->pparse('out','footer'); exit; } else { - $setup_tpl->set_var('description',lang("Select an app, enter a target version, then submit to process to that version.
If you do not enter a version, only the baseline tables will be installed for the app.
THIS WILL DROP ALL OF THE APPS' TABLES FIRST!")); - $setup_tpl->pparse('out','header'); + $GLOBALS['setup_tpl']->set_var('description',lang("Select an app, enter a target version, then submit to process to that version.
If you do not enter a version, only the baseline tables will be installed for the app.
THIS WILL DROP ALL OF THE APPS' TABLES FIRST!")); + $GLOBALS['setup_tpl']->pparse('out','header'); - $setup_tpl->set_var('appdata',lang('Application Data')); - $setup_tpl->set_var('actions',lang('Actions')); - $setup_tpl->set_var('action_url','schematoy.php'); - $setup_tpl->set_var('app_info',lang('Application Name and Status')); - $setup_tpl->set_var('app_title',lang('Application Title')); - $setup_tpl->set_var('app_version',lang('Target Version')); - $setup_tpl->set_var('app_install',lang('Process')); - $setup_tpl->pparse('out','app_header'); + $GLOBALS['setup_tpl']->set_var('appdata',lang('Application Data')); + $GLOBALS['setup_tpl']->set_var('actions',lang('Actions')); + $GLOBALS['setup_tpl']->set_var('action_url','schematoy.php'); + $GLOBALS['setup_tpl']->set_var('app_info',lang('Application Name and Status')); + $GLOBALS['setup_tpl']->set_var('app_title',lang('Application Title')); + $GLOBALS['setup_tpl']->set_var('app_version',lang('Target Version')); + $GLOBALS['setup_tpl']->set_var('app_install',lang('Process')); + $GLOBALS['setup_tpl']->pparse('out','app_header'); - @reset ($setup_info); - while (list ($key, $value) = each ($setup_info)) + @reset ($GLOBALS['setup_info']); + while (list ($key, $value) = each ($GLOBALS['setup_info'])) { unset($test); if (file_exists(PHPGW_SERVER_ROOT . '/' . $value['name'] . '/setup/tables_update.inc.php')) @@ -242,7 +244,7 @@ { $s .= ''; } - $setup_tpl->set_var('select_version',$s); + $GLOBALS['setup_tpl']->set_var('select_version',$s); if ($value['name']) { @@ -254,25 +256,25 @@ { $i = 1; } - $setup_tpl->set_var('apptitle',$value['title']); - $setup_tpl->set_var('currentver',$value['currentver']); - $setup_tpl->set_var('bg_color',$bgcolor[$i]); + $GLOBALS['setup_tpl']->set_var('apptitle',$value['title']); + $GLOBALS['setup_tpl']->set_var('currentver',$value['currentver']); + $GLOBALS['setup_tpl']->set_var('bg_color',$bgcolor[$i]); - $setup_tpl->set_var('instimg','completed.gif'); - $setup_tpl->set_var('instalt',lang('Completed')); - $setup_tpl->set_var('install',''); + $GLOBALS['setup_tpl']->set_var('instimg','completed.gif'); + $GLOBALS['setup_tpl']->set_var('instalt',lang('Completed')); + $GLOBALS['setup_tpl']->set_var('install',''); $status = lang('OK') . ' - ' . $value['status']; - $setup_tpl->set_var('appinfo',$value['name'] . '-' . $status); - $setup_tpl->set_var('appname',$value['name']); + $GLOBALS['setup_tpl']->set_var('appinfo',$value['name'] . '-' . $status); + $GLOBALS['setup_tpl']->set_var('appname',$value['name']); - $setup_tpl->pparse('out','apps',True); + $GLOBALS['setup_tpl']->pparse('out','apps',True); } } } - $setup_tpl->set_var('submit',lang('Submit')); - $setup_tpl->set_var('cancel',lang('Cancel')); - $setup_tpl->pparse('out','app_footer'); - $setup_tpl->pparse('out','footer'); - $phpgw_setup->show_footer(); + $GLOBALS['setup_tpl']->set_var('submit',lang('Submit')); + $GLOBALS['setup_tpl']->set_var('cancel',lang('Cancel')); + $GLOBALS['setup_tpl']->pparse('out','app_footer'); + $GLOBALS['setup_tpl']->pparse('out','footer'); + $GLOBALS['phpgw_setup']->show_footer(); ?> diff --git a/setup/sqltoarray.php b/setup/sqltoarray.php index bd980b1b38..10a8a40771 100644 --- a/setup/sqltoarray.php +++ b/setup/sqltoarray.php @@ -11,7 +11,7 @@ /* $Id$ */ - $phpgw_info['flags'] = array( + $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => True, 'nonavbar' => True, 'currentapp' => 'home', @@ -62,8 +62,8 @@ } // Check header and authentication - $phpgw_info['setup']['stage']['header'] = $phpgw_setup->check_header(); - if ($phpgw_info['setup']['stage']['header'] != '10') + $GLOBALS['phpgw_info']['setup']['stage']['header'] = $phpgw_setup->check_header(); + if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != '10') { Header("Location: manageheader.php"); exit; @@ -80,83 +80,81 @@ function parse_vars($table,$term) { - global $phpgw_setup,$setup_tpl; + $GLOBALS['setup_tpl']->set_var('table', $table); + $GLOBALS['setup_tpl']->set_var('term',$term); - $setup_tpl->set_var('table', $table); - $setup_tpl->set_var('term',$term); - - list($arr,$pk,$fk,$ix,$uc) = $phpgw_setup->sql_to_array($table); - $setup_tpl->set_var('arr',$arr); + list($arr,$pk,$fk,$ix,$uc) = $GLOBALS['phpgw_setup']->sql_to_array($table); + $GLOBALS['setup_tpl']->set_var('arr',$arr); if (count($pk) > 1) { - $setup_tpl->set_var('pks', "'".implode("','",$pk)."'"); + $GLOBALS['setup_tpl']->set_var('pks', "'".implode("','",$pk)."'"); } elseif($pk && !empty($pk)) { - $setup_tpl->set_var('pks', "'" . $pk[0] . "'"); + $GLOBALS['setup_tpl']->set_var('pks', "'" . $pk[0] . "'"); } else { - $setup_tpl->set_var('pks',''); + $GLOBALS['setup_tpl']->set_var('pks',''); } if (count($fk) > 1) { - $setup_tpl->set_var('fks', "'" . implode("','",$fk) . "'"); + $GLOBALS['setup_tpl']->set_var('fks', "'" . implode("','",$fk) . "'"); } elseif($fk && !empty($fk)) { - $setup_tpl->set_var('fks', "'" . $fk[0] . "'"); + $GLOBALS['setup_tpl']->set_var('fks', "'" . $fk[0] . "'"); } else { - $setup_tpl->set_var('fks',''); + $GLOBALS['setup_tpl']->set_var('fks',''); } if (count($ix) > 1) { - $setup_tpl->set_var('ixs', "'" . implode("','",$ix) . "'"); + $GLOBALS['setup_tpl']->set_var('ixs', "'" . implode("','",$ix) . "'"); } elseif($ix && !empty($ix)) { - $setup_tpl->set_var('ixs', "'" . $ix[0] . "'"); + $GLOBALS['setup_tpl']->set_var('ixs', "'" . $ix[0] . "'"); } else { - $setup_tpl->set_var('ixs',''); + $GLOBALS['setup_tpl']->set_var('ixs',''); } if (count($uc) > 1) { - $setup_tpl->set_var('ucs', "'" . implode("','",$uc) . "'"); + $GLOBALS['setup_tpl']->set_var('ucs', "'" . implode("','",$uc) . "'"); } elseif($uc && !empty($uc)) { - $setup_tpl->set_var('ucs', "'" . $uc[0] . "'"); + $GLOBALS['setup_tpl']->set_var('ucs', "'" . $uc[0] . "'"); } else { - $setup_tpl->set_var('ucs',''); + $GLOBALS['setup_tpl']->set_var('ucs',''); } } function printout($template) { - global $download,$setup_tpl,$appname,$table,$showall; + global $download,$appname,$table,$showall; if ($download) { - $setup_tpl->set_var('appname',$appname); - $string = $setup_tpl->parse('out',$template); + $GLOBALS['setup_tpl']->set_var('appname',$appname); + $string = $GLOBALS['setup_tpl']->parse('out',$template); } else { - $setup_tpl->set_var('appname',$appname); - $setup_tpl->set_var('table',$table); - $setup_tpl->set_var('lang_download','Download'); - $setup_tpl->set_var('showall',$showall); - $setup_tpl->set_var('action_url','sqltoarray.php'); - $setup_tpl->pfp('out',$template); + $GLOBALS['setup_tpl']->set_var('appname',$appname); + $GLOBALS['setup_tpl']->set_var('table',$table); + $GLOBALS['setup_tpl']->set_var('lang_download','Download'); + $GLOBALS['setup_tpl']->set_var('showall',$showall); + $GLOBALS['setup_tpl']->set_var('action_url','sqltoarray.php'); + $GLOBALS['setup_tpl']->pfp('out',$template); } return $string; }