From 81006779bea399a49f92674a6a4dbee980cce924 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 29 Mar 2005 16:13:44 +0000 Subject: [PATCH] use generic parseHtml() function to generate HTML output --- lam/templates/profedit/profilepage.php | 122 +------------------------ 1 file changed, 3 insertions(+), 119 deletions(-) diff --git a/lam/templates/profedit/profilepage.php b/lam/templates/profedit/profilepage.php index 24eddadb..747f9264 100644 --- a/lam/templates/profedit/profilepage.php +++ b/lam/templates/profedit/profilepage.php @@ -93,6 +93,7 @@ echo "\n
\n"; // index for tab order (1 is LDAP suffix) $tabindex = 2; +$tabindexLink = 1000; // links are at the end // display module options $modules = array_keys($options); @@ -101,21 +102,8 @@ for ($m = 0; $m < sizeof($modules); $m++) { if (sizeof($options[$modules[$m]]) < 1) continue; echo "
\n"; echo "" . getModuleAlias($modules[$m], $type) . "\n"; - echo "\n"; - for ($l = 0; $l < sizeof($options[$modules[$m]]); $l++) { // option lines - echo "\n"; - for ($o = 0; $o < sizeof($options[$modules[$m]][$l]); $o++) { // line parts - echo ""; - print_option($options[$modules[$m]][$l][$o], $modules[$m], $old_options, $tabindex); - echo "\n"; - } - echo "\n"; - } - echo "
\n"; + $profileTypes = parseHtml($modules[$m], $options[$modules[$m]], $old_options, true, $tabindex, $tabindexLink, $type); + $_SESSION['profile_types'] = array_merge($profileTypes, $_SESSION['profile_types']); echo "
\n"; echo "
"; } @@ -145,108 +133,4 @@ echo "\n"; echo ("\n"); -/** -* prints out the row of a section table including the option name, values and help -* -* @param array $values an array formated as module option -* @param string $module_name the name of the module the options belong to -* @param array $old_options a hash array with the values from the loaded profile -* @param integer $tabindex current value for tabulator order -*/ -function print_option($values, $modulename, $old_options, &$tabindex) { - switch ($values['kind']) { - // text value - case 'text': - echo $values['text'] . "\n"; - break; - // help link - case 'help': - echo "" . _('Help') . "\n"; - break; - // input field - case 'input': - if (($values['type'] == 'text') || ($values['type'] == 'checkbox')) { - if ($values['type'] == 'text') { - $output = "\n"; - $_SESSION['profile_types'][$values['name']] = "multiselect"; - } - else { - echo "\n"; - $tabindex++; - break; - // subtable - case 'table': - echo "\n"; - for ($l = 0; $l < sizeof($values['value']); $l++) { // option lines - echo "\n"; - for ($o = 0; $o < sizeof($values['value'][$l]); $o++) { // line parts - echo "\n"; - } - echo "\n"; - } - echo "
"; - print_option($values['value'][$l][$o], $values['value'], $old_options, $tabindex); - echo "
\n"; - break; - // print error message for invalid types - default: - echo "Unrecognized type" . ": " . $values['kind'] . "\n"; - break; - } -} - ?>