From 7fa9d49d1e501d35fba6706c170d2fdba402cdc6 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 14 Mar 2004 15:34:53 +0000 Subject: [PATCH] fixed HTML errors, added option types --- lam/templates/profedit/profilepage.php | 31 +++++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/lam/templates/profedit/profilepage.php b/lam/templates/profedit/profilepage.php index 704c2a4b..345634fc 100644 --- a/lam/templates/profedit/profilepage.php +++ b/lam/templates/profedit/profilepage.php @@ -40,6 +40,9 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) { exit; } +// empty list of attribute types +$_SESSION['profile_types'] = array(); + // print header echo $_SESSION['header']; echo "\n\n"; @@ -110,7 +113,6 @@ echo ("\n"); // $module_name: The name of the module the options belong to // $old_profile: A hash array with the values from the loaded profile function print_option($values, $modulename, $old_profile) { - echo ""; switch ($values['kind']) { // text value case 'text': @@ -118,39 +120,46 @@ function print_option($values, $modulename, $old_profile) { break; // help link case 'help': - echo "" . _('Help') . "\n"; + echo "" . _('Help') . "\n"; break; // input field case 'input': if (($values['type'] == 'text') || ($values['type'] == 'checkbox')) { if ($values['type'] == 'text') { - $output = "\n"; + if ($values['multiple']) { + echo "\n"; + $_SESSION['profile_types'][$values['name']] = "select"; + } // option values for ($i = 0; $i < sizeof($values['options']); $i++) { // use values from old profile if given @@ -174,11 +183,11 @@ function print_option($values, $modulename, $old_profile) { } echo "\n"; break; + // print error message for invalid types default: - echo "" . _("Unrecognized type") . ": " . $values['kind'] . "\n"; + echo _("Unrecognized type") . ": " . $values['kind'] . "\n"; break; } - echo ""; } ?>