From dc081827a6c37bc70980cf8d48dc77ed0f498e9a Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 25 Apr 2005 17:54:22 +0000 Subject: [PATCH] use modules.inc to parse meta HTML code --- lam/templates/config/confmain.php | 130 ++---------------------------- 1 file changed, 7 insertions(+), 123 deletions(-) diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index 3b5675f3..96464655 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -141,6 +141,7 @@ if (isset($_GET["modulesback"])) { // index for tab order $tabindex = 1; +$tabindexLink = 1000; echo $_SESSION['header']; @@ -261,26 +262,13 @@ $_SESSION['config_scopes'] = $scopes; // display module boxes $modules = array_keys($options); -for ($m = 0; $m < sizeof($modules); $m++) { - // ignore empty values - if (!is_array($options[$modules[$m]]) || (sizeof($options[$modules[$m]]) < 1)) continue; +$_SESSION['config_types'] = array(); +for ($i = 0; $i < sizeof($modules); $i++) { + if (sizeof($options[$modules[$i]]) < 1) continue; echo "
\n"; - echo "" . $moduleDescriptions['legend'][$modules[$m]] . "\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"; + echo "" . $moduleDescriptions['legend'][$modules[$i]] . "\n"; + $configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, true, $tabindex, $tabindexLink, 'config'); + $_SESSION['config_types'] = array_merge($configTypes, $_SESSION['config_types']); echo "
\n"; echo "
"; } @@ -455,109 +443,5 @@ 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['config_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; - } -} - - ?>