From 4ef07f8d6782037e77a0378405b63e9357c023a0 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Fri, 21 Sep 2001 20:14:04 +0000 Subject: [PATCH] Now using the same template files as the admin/config.php - only api/admin/prefs templates are included, and all are saved in the config table as appname='phpgwapi'. --- admin/templates/default/config.tpl | 155 ++++++++++++++++++++++- phpgwapi/templates/default/config.tpl | 82 ++++++++++++ preferences/templates/default/config.tpl | 8 +- setup/config.php | 87 ++++++++++++- 4 files changed, 321 insertions(+), 11 deletions(-) create mode 100644 phpgwapi/templates/default/config.tpl diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index 984c6f110d..08352d7f10 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -1,15 +1,160 @@ - - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {title}
 
{lang_Authentication_/_Accounts}
Select which type of authentication you are using: + +
{lang_Select_where_you_want_to_store/retrieve_user_accounts}: + +
{lang_Select_where_you_want_to_store/retrieve_filesystem_information}: + +
{lang_Minimum_account_id_(e.g._500_or_100,_etc.)}:
{lang_Maximum_account_id_(e.g._65535_or_1000000)}:
{lang_If_using_LDAP,_do_you_want_to_manage_homedirectory_and_loginshell_attributes?}: + +
   {lang_LDAP_Default_homedirectory_prefix_(e.g._/home_for_/home/username)}:
   {lang_LDAP_Default_shell_(e.g._/bin/bash)}:
{lang_Auto_create_account_records_for_authenticated_users}: + +
{lang_Add_auto-created_users_to_this_group_('Default'_will_be_attempted_if_this_is_empty.)}:
{lang_If_no_ACL_records_for_user_or_any_group_the_user_is_a_member_of}: + +
{lang_LDAP_host}:
{lang_LDAP_accounts_context}:
{lang_LDAP_groups_context}:
{lang_LDAP_rootdn}:
{lang_LDAP_root_password}:
{lang_LDAP_encryption_type}: + +
{lang_Enter_some_random_text_for_app_session_
encryption_(requires_mcrypt)}:
 
- - + +
- + diff --git a/phpgwapi/templates/default/config.tpl b/phpgwapi/templates/default/config.tpl new file mode 100644 index 0000000000..ec7f7464b4 --- /dev/null +++ b/phpgwapi/templates/default/config.tpl @@ -0,0 +1,82 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {title}
 {lang_Path_information}
{lang_Enter_the_full_path_for_temporary_files.
Examples:_/tmp,_C:\TEMP}:
{lang_Enter_the_full_path_for_users_and_group_files.
Examples:_/files,_E:\FILES}:
{lang_Enter_the_location_of_phpGroupWare's_URL.
Example:_http://www.domain.com/phpgroupware_ _or_ _/phpgroupware
No_trailing_slash}:
 
 {lang_Host_information}
{lang_Enter_the_hostname_of_the_machine_on_which_this_server_is_running}:
{lang_Enter_your_default_FTP_server}:
{lang_Attempt_to_use_correct_mimetype_for_FTP_instead_of_default_'application/octet-stream'}: + +
{lang_Enter_your_HTTP_proxy_server}:
{lang_Enter_your_HTTP_proxy_server_port}:
+  +
+ + +
+
+ diff --git a/preferences/templates/default/config.tpl b/preferences/templates/default/config.tpl index 982be84f96..23a24a4b66 100644 --- a/preferences/templates/default/config.tpl +++ b/preferences/templates/default/config.tpl @@ -10,8 +10,8 @@   - -  {lang_Preferences} + + {lang_Preferences} @@ -99,7 +99,7 @@ - {lang_Would_you_like_phpGroupWare_to_cache_the_phpgw_info_array ?}: + {lang_Would_you_like_phpGroupWare_to_cache_the_phpgw_info_array_?}: diff --git a/setup/config.php b/setup/config.php index 86dee41ee6..901b48c0ed 100644 --- a/setup/config.php +++ b/setup/config.php @@ -41,7 +41,8 @@ } $phpgw_setup->loaddb(); - /* Guessing default paths. */ + /* Guessing default values. */ + $GLOBALS['current_config']['hostname'] = $HTTP_HOST; $GLOBALS['current_config']['files_dir'] = ereg_replace('/setup','/files',dirname($SCRIPT_FILENAME)); if (is_dir('/tmp')) { @@ -142,7 +143,89 @@ $setup_tpl->pparse('out','T_config_pre_script'); - $phpgw_setup->execute_script('config',array('phpgwapi','admin','preferences')); /* ;,'preferences','email','nntp')); */ + /* Now parse each of the templates we want to show here */ + class phpgw + { + var $common; + var $accounts; + var $applications; + var $db; + } + $phpgw = new phpgw; + $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->set_unknowns('keep'); + $t->set_file(array('config' => 'config.tpl')); + $t->set_block('config','body','body'); + $t->set_var('th_bg', '486591'); + $t->set_var('th_text', 'FFFFFF'); + $t->set_var('row_on', 'DDDDDD'); + $t->set_var('row_off', 'EEEEEE'); + + $vars = $t->get_undefined('body'); + $phpgw->common->hook_single('config',$cfg_app); + + while (list($null,$value) = each($vars)) + { + $valarray = explode('_',$value); + $type = $valarray[0]; + $new = $newval = ''; + + while($chunk = next($valarray)) + { + $new[] = $chunk; + } + $newval = implode(' ',$new); + + switch ($type) + { + case 'lang': + $t->set_var($value,lang($newval)); + break; + case 'value': + $newval = ereg_replace(' ','_',$newval); + $t->set_var($value,$current_config[$newval]); + break; + case 'selected': + $configs = array(); + $config = ''; + $newvals = explode(' ',$newval); + $setting = end($newvals); + for ($i=0;$i<(count($newvals) - 1); $i++) + { + $configs[] = $newvals[$i]; + } + $config = implode('_',$configs); + /* echo $config . '=' . $current_config[$config]; */ + if ($current_config[$config] == $setting) + { + $t->set_var($value,' selected'); + } + else + { + $t->set_var($value,''); + } + break; + case 'hook': + $newval = ereg_replace(' ','_',$newval); + $t->set_var($value,$newval($current_config)); + break; + default: + $t->set_var($value,''); + break; + } + } + + $t->pfp('out','body'); + unset($t); + } + + //$phpgw_setup->execute_script('config',array('phpgwapi','admin','preferences')); /* ;,'preferences','email','nntp')); */ $setup_tpl->set_var('more_configs',lang('Please login to phpgroupware and run the admin application for additional site configuration') . '.'); $setup_tpl->set_var('lang_submit',lang('submit'));