Example #1
0
 /**
  * Constructor
  *
  * @param mixed $item fragment of html for list item or record
  * @param object &$parent reference to parent of this item
  * @param string $attributes attributes for li tag
  * @param boolean $display whether this item is displayed. Some items may be loaded so we have a complete
  *                              structure in memory to work with for actions but are not displayed.
  * @return list_item
  */
 function list_item($item, &$parent, $attributes = '', $display = true)
 {
     $this->item = $item;
     if (is_object($this->item)) {
         $this->id = $this->item->id;
         $this->name = $this->item->{$this->fieldnamesname};
     }
     $this->set_parent($parent);
     $this->attributes = $attributes;
     $parentlistclass = get_class($parent);
     $this->children =& new $parentlistclass($parent->type, $parent->attributes, $parent->editable, $parent->pageurl, 0);
     $this->children->set_parent($this);
     $this->display = $display;
 }