00001 <?php
00005 class XFormsGroup extends SObject {
00006
00007 protected $label;
00008 protected $controls = array();
00009
00018 public function setLabel($l) {
00019 $this->label = $l;
00020 }
00021
00030 public function setControls($c) {
00031 $this->controls = $c;
00032 }
00033
00042 public function addControl($c) {
00043 if ($c == null) return;
00044 array_push($this->controls, $c);
00045 }
00046
00054 public function getLabel() {
00055 return $this->label;
00056 }
00057
00065 public function getControls() {
00066 return $this->controls;
00067 }
00068
00076 public function isRequired() {
00077 $cs = $this->getControls();
00078 foreach ($cs as $c) {
00079 if ($c->isRequired()) return true;
00080 }
00081 return false;
00082 }
00083
00091 public function generateTK() {
00092 $b = new TKVBox();
00093 $cs = $this->getControls();
00094 foreach ($cs as $c) {
00095 $b->add($c->generateTK());
00096 }
00097 return $b;
00098 }
00099
00107 public function render() {
00108 $tk = $this->generateTK();
00109 if ($tk != null) return $tk->render();
00110 }
00111 }
00112 ?>