From 1e1ff9f1a9f04c3d50480f7840f5f7b693befc1d Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 28 Apr 2011 17:42:47 +0000 Subject: [PATCH] removed old meta HTML support --- lam/docs/devel/upgrade.htm | 4 + lam/lib/modules.inc | 345 +------------------------------------ 2 files changed, 10 insertions(+), 339 deletions(-) diff --git a/lam/docs/devel/upgrade.htm b/lam/docs/devel/upgrade.htm index b46d3c76..02d03bdf 100644 --- a/lam/docs/devel/upgrade.htm +++ b/lam/docs/devel/upgrade.htm @@ -1,6 +1,7 @@ + Upgrade notes @@ -18,8 +19,11 @@ This is a list of API changes for all LAM releases.
+

3.4.0 -> 3.5.0

The old meta HTML code is no longer supported. Please use the new solution based on htmlElement (see lib/html.inc).
+

3.3.0 -> 3.4.0

+ Module interface:
-*
-*
-* Example: -* -* array( -* array( -* array("kind" => "text", "text" => "This is an example", "td" => array("colspan" => 3)) -* ), -* array( -* array("kind" => "text", "text" => "Input:"), -* array("kind" => "input", "name" => "myinput", "type" => "text"), -* array("kind" => "help", "value" => "42") -* ), -* array( -* array("kind" => "input", "name" => 'form_subpage_myModule_attributes_back', "value" => _("Back")) -* ) -*) -* -* +* meta HTML code. This allows to have a common design for all module pages. * * @param string $module Name of account module * @param mixed $input htmlElement or array of htmlElement elements @@ -705,213 +571,14 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, $scope) { if ($input instanceof htmlElement) { return $input->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); } - $ret = array(); if (is_array($input) && (sizeof($input) > 0)) { - // check for array of metaHTML objects - if ($input[0] instanceof htmlElement) { - $return = array(); - for ($i = 0; $i < sizeof($input); $i++) { - $return = array_merge($return, $input[$i]->generateHTML($module, $input, $values, $restricted, $tabindex, $scope)); - } - return $return; + $return = array(); + for ($i = 0; $i < sizeof($input); $i++) { + $return = array_merge($return, $input[$i]->generateHTML($module, $input, $values, $restricted, $tabindex, $scope)); } - echo "\n"; - for ($i=0; $i\n"; - for ($j=0; $j\n"; - switch ($input[$i][$j]['kind']) { - // plain text - case 'text': - if (isset($input[$i][$j]['text'])) echo $input[$i][$j]['text']; - break; - // input fields - case 'input': - $type = $input[$i][$j]['type']; - if ($restricted && (($type == "submit") || ($type == "reset"))) break; // no buttons in restricted mode - $output = ""; - if (isset($values[$input[$i][$j]['name']])) { - echo htmlspecialchars(implode("\r\n", $values[$input[$i][$j]['name']]), ENT_QUOTES, "UTF-8"); - } - else { - if (isset($input[$i][$j]['value'])) { - echo htmlspecialchars($input[$i][$j]['value'], ENT_QUOTES, "UTF-8"); - } - } - echo ""; - $ret[$input[$i][$j]['name']] = 'textarea'; // save type - break; - // inner fieldset - case 'fieldset': - $styleClass = ''; - if (isset($scope) && ($scope != '')) { - $styleClass = ' class="' . $scope . 'edit"'; - } - echo "\n"; - if ($input[$i][$j]['legend']!='') echo "" . $input[$i][$j]['legend'] . "\n"; - $retTemp = parseHtml($module, $input[$i][$j]['value'], $values, $restricted, $tabindex, $scope); - $ret = array_merge($ret, $retTemp); - echo "\n"; - break; - // selection - case 'select': - if (! isset($input[$i][$j]['size'])) $input[$i][$j]['size'] = 1; // correct size if needed - if (isset($input[$i][$j]['multiple'])) { - echo "\n"; - break; - // sub table - case 'table': - $retTemp = parseHtml($module, $input[$i][$j]['value'], $values, $restricted, $tabindex, $scope); - $ret = array_merge($ret, $retTemp); - break; - // help link - case 'help': - $helpEntry = getHelp($module, $input[$i][$j]['value'], $scope); - printHelpLink($helpEntry, $input[$i][$j]['value'], $module, $scope); - break; - // status message - case 'message': - StatusMessage($input[$i][$j]['type'], $input[$i][$j]['headline'], $input[$i][$j]['text']); - break; - // image - case 'image': - echo "\n"; - break; - // error, unknown type - default: - echo "Unrecognized type: " . $input[$i][$j]['kind'] . "\n"; - break; - } - echo "\n"; - } - echo "\n"; - } - echo "
\n"; + return $return; } - return $ret; + return array(); } /**