name = $name; $this->id = preg_replace('/[^0-9A-Za-z]+/', '', $name); // Legacy handling: only assume second parameter as title if its a string, // otherwise it might be a formfield instance if(isset($args[0]) && is_string($args[0])) { $title = array_shift($args); } $this->title = (isset($title)) ? $title : FormField::name_to_label($name); parent::__construct($args); } public function id() { return $this->tabSet->id() . '_' . $this->id; } public function Fields() { return $this->children; } public function setTabSet($val) { $this->tabSet = $val; } /** * Returns the named field */ public function fieldByName($name) { foreach($this->children as $child) { if($name == $child->Name()) return $child; } } } ?>