app = $app; $this->classList = GenadClassList::getInstance($app); } include 'name_map.php'; } // shows the start page of an MOC public function view(GenadInstanceList $instList) { $this->class = $instList->getClassId(); $this->vie_sel_pa1(); $list = $this->getGuiString("List"); $className = $this->getGuiString($instList->getClassName())." $list"; print "

$className

"; $this->viewList($instList); print ""; } private function vie_sel_pa1() { $app = $this->app; $this->printHeader(); $this->printAdditionalNavigation(); $classSelection = $this->getGuiString("Class Selection"); $select = $this->getGuiString("Select"); echo <<Administration
$classSelection: "; echo "
\n"; } // shows the admin page only with the class selection item public function ViewSelection() { $this->vie_sel_pa1(); print ""; } /* * viewList shows a list of instances * $genAdList: the list of instances * $showIcons: add the detail/edit/copy/delete-icons to each line * $selectList: add a selection icon in the front. * $fk_name: name of foreign key attribute * $multiselect: selection icons are radio buttons (false) or check boxes (true) */ public function viewList(GenadInstanceList $genAdList, $showIcons = true, GenadInstanceList $selectList = null, $fk_name = "", $multiselect = true) { if ($selectList) $selection = true; else $selection = false; $inst_arr = $genAdList->getList(); if (count($inst_arr) == 0) { $text = $this->getGuiString("NO_INSTANCE"); echo "

$text

"; if ($showIcons && $this->classList->hasProperty($this->class, new ClassProperty(ClassProperty::CP_CREATE))) { $appclass = $this->app . "+" . $this->class; echo << Add

ADDKNOPF; } return; } echo ""; echo "\n"; // fetch 1st instance $inst = $inst_arr[0]; $atts = $inst->getAttributeList(); if ($selection) echo ""; foreach ($atts as $att) { // print header line echo ""; } echo "\n"; if ($selection) $this->printSelection($fk_name, $inst->getId(), $selectList, $multiselect); // print attribute values of 1st instance foreach ($atts as $att) { if ($att->isEditable()) $editable = ' class="edit"'; else $editable = ''; if ($att->isBool()) { if ($att->getValue() == "true") $checked = " checked "; else $checked = ""; echo "'; } else echo "".$att.""; } if ($showIcons) $this->printIcons($inst->getId(), $inst->getMod()); echo "\n"; // print further instances for ($i=1; $igetAttributeList(); if ($selection) $this->printSelection($fk_name, $inst->getId(), $selectList, $multiselect); foreach ($atts as $att) { if ($att->isEditable()) $editable = ' class="edit"'; else $editable = ''; if ($att->isBool()) { if ($att->getValue() == "true") $checked = " checked "; else $checked = ""; echo "'; } else echo "".$att.""; } if ($showIcons) $this->printIcons($inst->getId(), $inst->getMod()); echo "\n"; } if ($showIcons) { $appclass = $this->app . "+" . $this->class; echo <<
". $this->getGuiString($att->getName()) ."
".'
".'
LISTEND1; if ($this->classList->hasProperty($this->class, new ClassProperty(ClassProperty::CP_CREATE))) echo "\"Add\""; echo <<
LISTEND; } else { echo ""; } } private function printSelection($fk_name, $id, GenadInstanceList $selectList, $multiselect) { echo 'containsId($id)) echo " checked "; echo "/>"; } private function printIcons($id, $mod) { $appclass = $this->app . "+" . $this->class; echo<< Info ICONS; if ($this->classList->hasProperty($this->class, new ClassProperty(ClassProperty::CP_SET))) echo "\"Edit\""; if ($this->classList->hasProperty($this->class, new ClassProperty(ClassProperty::CP_CREATE))) echo "\"Copy\""; if ($this->classList->hasProperty($this->class, new ClassProperty(ClassProperty::CP_DELETE))) echo "\"Delete\""; echo ""; } // Delete public function printAdditionalNavigation() { // require 'GenericAdmin/gui/view/NavBar.php'; } }