From c2aee2eade2f28634888a0a7f1cc7241c1252c41 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 19 Feb 2006 20:55:06 +0000 Subject: [PATCH] - Reworking list_item() to allow for multiple types of fields (and proper changes made to row_list()) - Added row_checkbox() --- printer.php | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/printer.php b/printer.php index e10df53..4d12075 100644 --- a/printer.php +++ b/printer.php @@ -799,7 +799,7 @@ JS; { global $listitem; - $listitem[] = "\n\t"; + $listitem["$value"] = array('name' => $name, 'selected' => $selected); } // ################################################################### @@ -817,16 +817,40 @@ JS; { global $listitem; - foreach ($listitem AS $option) + foreach ($listitem AS $value => $option) { - $optionlist .= $option; + $optionlist .= "\n\t"; } - $listitem = ''; + $listitem = array(); $this->row_text($label, "\n" . (($is_jump) ? "\nregistry->modules['localize']->string('Go') . " \" accesskey=\"g\" />" : '') . "\n", $colspan); } + // ################################################################### + /** + * Assembles a list of checkboxes from list_item() items + * + * @access public + * + * @param string Label text + * @param string Name of the s + * @param integer Colspan attribute + */ + function row_checkbox($label, $name, $colspan = 2) + { + global $listitem; + + foreach ($listitem AS $value => $box) + { + $optionlist[] = "\n\t $box[name]"; + } + + $listitem = array(); + + $this->row_text($label, "\n" . implode('
', $optionlist) . "\n", $colspan); + } + // ################################################################### /** * Creates a row with two radio buttons: yes and now -- 2.22.5