protected static function getActiveTaxonomiesForParentRefId($a_parent_ref_id) { global $tree; if (!isset(self::$valid_tax_map[$a_parent_ref_id])) { include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php"; include_once "Services/Taxonomy/classes/class.ilObjTaxonomy.php"; include_once "Modules/Category/classes/class.ilObjCategoryGUI.php"; $prefix = ilObjCategoryGUI::CONTAINER_SETTING_TAXBLOCK; $all_valid = array(); foreach ($tree->getPathFull($a_parent_ref_id) as $node) { if ($node["type"] == "cat") { $node_valid = array(); if (ilContainer::_lookupContainerSetting($node["obj_id"], ilObjectServiceSettingsGUI::TAXONOMIES, false)) { $all_valid = array_merge($all_valid, ilObjTaxonomy::getUsageOfObject($node["obj_id"])); $active = array(); foreach (ilContainer::_getContainerSettings($node["obj_id"]) as $keyword => $value) { if (substr($keyword, 0, strlen($prefix)) == $prefix && (bool) $value) { $active[] = substr($keyword, strlen($prefix)); } } $node_valid = array_intersect($all_valid, $active); } if (sizeof($node_valid)) { foreach ($node_valid as $idx => $node_id) { // #15268 - deleted taxonomy? if (ilObject::_lookupType($node_id) != "tax") { unset($node_valid[$idx]); } } } self::$valid_tax_map[$node["ref_id"]] = $node_valid; } } } return sizeof(self::$valid_tax_map[$a_parent_ref_id]); }
protected function getActiveBlocks() { $res = array(); $prefix = self::CONTAINER_SETTING_TAXBLOCK; foreach (ilContainer::_getContainerSettings($this->object->getId()) as $keyword => $value) { if (substr($keyword, 0, strlen($prefix)) == $prefix && (bool) $value) { $res[] = substr($keyword, strlen($prefix)); } } return $res; }