/** * Add Advanced Meta Data Information to the Info Screen * * @param ilInfoScreenGUI $info */ protected function parseInfoScreen(ilInfoScreenGUI $info) { include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php'; include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php'; include_once 'Services/ADT/classes/class.ilADTFactory.php'; $type = $this->object->getOrgUnitType(); if (!$type) { return; } $assigned_record_ids = $type->getAssignedAdvancedMDRecordIds(); foreach (ilAdvancedMDValues::getInstancesForObjectId($this->object->getId(), 'orgu') as $record_id => $a_values) { // Skip record ids not assigned to the type if (!in_array($record_id, $assigned_record_ids)) { continue; } // Note that we have to do this because with the instances above the sub-type and sub-id are missing... $a_values = new ilAdvancedMDValues($record_id, $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId()); // this correctly binds group and definitions $a_values->read(); $info->addSection(ilAdvancedMDRecord::_lookupTitle($record_id)); $defs = $a_values->getDefinitions(); foreach ($a_values->getADTGroup()->getElements() as $element_id => $element) { if (!$element->isNull()) { $info->addProperty($defs[$element_id]->getTitle(), ilADTFactory::getInstance()->getPresentationBridgeForInstance($element)->getHTML()); } } } }