app = $app; $this->class = $class; } function view(GenadInstance $inst, GenadInstanceList $rel_lst) { // view page header $this->printHeader(); // view instance header $name = $inst->getName(); echo "

Main $name instance

"; $listView = new ListView($this->app); $inst_lst = new GenadInstanceList($this->app, $this->class); $inst_arr = array($inst); $inst_lst->setList($inst_arr); $listView->viewList($inst_lst, false); echo "
"; // check for relation attribute $att_arr = $inst->getAttributeList(); $selectedIdList = array(); $rel_cls = $rel_lst->getClassId(); foreach ($att_arr as $att) { if ($att->getRelatedClass() == $rel_cls) $selectedIdList = $att->getList(); } // TODO: Kann ich hier "leere Liste" von "keine Liste" unterscheiden? //if (!$selectedIdList) // throw new Exception("Related attribute list not found"); // view list of releated instances $name = $rel_lst->getClassName(); $inst_arr = $rel_lst->getList(); $appclass = $this->app." ".$inst->getClassId(); $id = $inst->getId(); $mod = $inst->getMod(); echo <<Edit related $name list
START; // fetch 1st instance $i = $inst_arr[0]; $atts = $i->getAttributeList(); echo ""; foreach ($atts as $att) { // print header line echo ""; } echo "\n"; foreach ($inst_arr as $i) { $selected = false; $id = $i->getId(); // TODO hasElement verwenden if (array_search($id, $selectedIdList)) $selected = "yes"; // TODO richtige checkbox setzen echo ""; $atts = $i->getAttributeList(); foreach ($atts as $att) { echo ""; } echo "\n"; } echo "
". $this->getGuiString($att->getName()) ."
".$att."
\n"; $appclass = $this->app." ".$inst->getClassId(); echo <<

LISTEND; } }