diff --git a/lam/lib/html.inc b/lam/lib/html.inc index c05fe3a8..fb123646 100644 --- a/lam/lib/html.inc +++ b/lam/lib/html.inc @@ -2437,6 +2437,71 @@ class htmlHorizontalLine extends htmlElement { return $return; } +} + +/** + * Creates a simple DIV element. + * + * @package metaHTML + */ +class htmlDiv extends htmlElement { + + /** unique ID */ + private $id = null; + /** htmlElement that generates inner content */ + private $content = null; + /** CSS classes */ + private $classes = array(); + + /** + * Constructor. + * + * @param String $id unique ID + * @param htmlElement $content inner content + * @param array $classes CSS classes + */ + function __construct($id, $content, $classes = array()) { + $this->id = htmlspecialchars($id); + $this->content = $content; + $this->classes = $classes; + } + + /** + * Prints the HTML code for this element. + * + * @param string $module Name of account module + * @param array $input List of meta-HTML elements + * @param array $values List of values which override the defaults in $input (name => value) + * @param boolean $restricted If true then no buttons will be displayed + * @param integer $tabindex Start value of tabulator index for input fields + * @param string $scope Account type + * @return array List of input field names and their type (name => type) + */ + function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) { + $return = array(); + $idValue = ''; + if ($this->id != null) { + $idValue = ' id="' . $this->id . '"'; + } + $classesValue = ''; + if (($this->classes != null) && (sizeof($this->classes) > 0)) { + $classesValue = ' class="'; + for ($i = 0; $i < sizeof($this->classes); $i++) { + $classesValue .= htmlspecialchars($this->classes[$i]) . ' '; + } + $classesValue .= '"'; + } + echo ''; + if ($this->content != null) { + $return = $this->content->generateHTML($module, $input, $values, $restricted, $tabindex, $scope); + } + echo ''; + return $return; + } + + + + } ?> diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index e9eeded3..bcc2411e 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -132,87 +132,86 @@ echo "

 

\n"; echo "
\n"; -echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -echo "
\n"; - echo '' . _("Account type") . ':'; - echo "\n"; - echo "\n"; - echo "
\n"; - echo '' . _('Selected modules') . ':'; - echo "\n"; - // generate one DIV for each account type - $counter = 0; - foreach ($sortedTypes as $type => $label) { - $style = 'style="display:none;"'; - if ((!isset($_REQUEST['type']) && ($counter == 0)) || (isset($_REQUEST['type']) && ($_REQUEST['type'] == $type))) { - // show first account type or last selected one - $style = ''; - } - echo "
\n"; - echo ""; - $modules = $_SESSION['config']->get_AccountModules($type); - for ($m = 0; $m < sizeof($modules); $m++) { - if ($m%3 == 0) { - echo "\n"; - } - echo ""; - if (($m%3 == 2) && ($m != (sizeof($modules) - 1))) { - echo "\n"; - } - } - echo ""; - echo "
"; - $module = new $modules[$m]($type); - $iconImage = $module->getIcon(); - echo '' . $iconImage . ''; - echo "\n"; - if (is_base_module($modules[$m], $type)) { - echo ""; - } - else { - $checked = 'checked'; - if (isset($_POST['submit']) && !isset($_POST[$type . '_' . $modules[$m]])) { - $checked = ''; - } - echo ""; - } - echo getModuleAlias($modules[$m], $type); - echo "      
\n"; - echo "
\n"; - $counter++; - } - echo "
\n"; - echo "\n"; - ?> - -
\n"; + $typeDiv = new htmlDiv($types[$i], $innerTable, $divClasses); + $moduleGroup->addElement($typeDiv); +} +$table->addElement($moduleGroup, true); + +// ok button +$table->addElement(new htmlSpacer(null, '20px'), true); +$table->addElement(new htmlButton('submit', _('Ok')), true); + +parseHtml(null, $table, array(), false, $tabindex, 'user'); +?> + +\n"; echo '';