selectName = $selectName; $this->items = array(); $this->defaultPadding = $defaultPadding; $this->description = $description; $this->formName = $formName; $this->pixelWidth = $pixelWidth; $this->itemSelected = $itemSelected; $this->numItems = 0; // initialization } /* add item to the dropdown box ** purpose: adds an item to the select box's container for later output */ function addItem($nestLevel,$label,$value) { $itemInfo['label'] = $label; $itemInfo['nestLevel'] = $nestLevel; $itemInfo['value'] = $value; $this->items[$this->numItems] = $itemInfo; $this->numItems++; } /* get the html/javaScript selectbox output ** purpose: outputs the contents of the select box's container */ function get() { $retval .= "\n"; return $retval; } } /* testcode $ddsb = new dropDownSelectBox('name','formname','description',150); $ddsb->addItem(0,'test1',1); $ddsb->addItem(1,'test1-1',2); $ddsb->addItem(2,'test2-1',4); $ddsb->addItem(1,'test1-2',5); $ddsb->addItem(0,'test2',3); echo $ddsb->get(); /**/ ?>