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