4 include_once(
"Services/Classification/classes/class.ilClassificationProvider.php");
20 public static function isActive($a_parent_ref_id, $a_parent_obj_id, $a_parent_obj_type)
22 return (
bool) self::getActiveTaxonomiesForParentRefId($a_parent_ref_id);
27 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
29 foreach (self::$valid_tax_map[$this->parent_ref_id] as $tax_id) {
31 $tax_exp->setSkipRootNode(
true);
32 $tax_exp->setOnClick(
"il.Classification.toggle({tax_node: '{NODE_CHILD}'});");
34 if (is_array($this->selection)) {
35 foreach ($this->selection as $node_id) {
36 $tax_exp->setPathOpen($node_id);
37 $tax_exp->setNodeSelected($node_id);
41 if (!$tax_exp->handleCommand()) {
44 "html" => $tax_exp->getHTML()
52 $incoming_id = (int) $_REQUEST[
"tax_node"];
54 if (is_array($a_saved)) {
55 foreach ($a_saved as $idx => $node_id) {
56 if ($node_id == $incoming_id) {
57 unset($a_saved[$idx]);
61 $a_saved[] = $incoming_id;
64 return array($incoming_id);
71 $this->selection = $a_value;
78 $tree = $DIC->repositoryTree();
80 if (!isset(self::$valid_tax_map[$a_parent_ref_id])) {
81 include_once
"Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
82 include_once
"Services/Taxonomy/classes/class.ilObjTaxonomy.php";
83 include_once
"Modules/Category/classes/class.ilObjCategoryGUI.php";
88 foreach ($tree->getPathFull($a_parent_ref_id) as $node) {
89 if ($node[
"type"] ==
"cat") {
90 $node_valid =
array();
97 $all_valid = array_merge(
104 if (substr($keyword, 0, strlen($prefix)) == $prefix && (
bool) $value) {
105 $active[] = substr($keyword, strlen($prefix));
109 $node_valid = array_intersect($all_valid, $active);
112 if (
sizeof($node_valid)) {
113 foreach ($node_valid as $idx => $node_id) {
116 unset($node_valid[$idx]);
121 self::$valid_tax_map[$node[
"ref_id"]] = $node_valid;
126 if (is_array(self::$valid_tax_map[$a_parent_ref_id])) {
127 return sizeof(self::$valid_tax_map[$a_parent_ref_id]);
135 include_once
"Services/Taxonomy/classes/class.ilTaxonomyTree.php";
136 include_once
"Services/Taxonomy/classes/class.ilTaxNodeAssignment.php";
137 include_once
"Services/Taxonomy/classes/class.ilTaxonomyNode.php";
139 $tax_obj_ids = $tax_map =
array();
142 foreach ($this->selection as $node_id) {
144 $tax_map[$node->getTaxonomyId()][] = $node_id;
147 foreach ($tax_map as $tax_id => $node_ids) {
151 $tax_nodes =
array();
152 foreach ($node_ids as $node_id) {
153 $tax_nodes = array_merge($tax_nodes, $tax_tree->getSubTreeIds($node_id));
154 $tax_nodes[] = $node_id;
162 foreach ($tax_obj_ids as $tax_objs) {
163 if ($obj_ids === null) {
164 $obj_ids = $tax_objs;
166 $obj_ids = array_intersect($obj_ids, $tax_objs);
170 return (
array) $obj_ids;
importPostData($a_saved=null)
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
Taxonomy explorer GUI class.
const CONTAINER_SETTING_TAXBLOCK
Taxonomy classification provider.
static _lookupTitle($a_id)
lookup object title
static findObjectsByNode($a_tax_id, array $a_node_ids, $a_item_type)
Find object which have assigned nodes.
static isActive($a_parent_ref_id, $a_parent_obj_id, $a_parent_obj_type)
static _getContainerSettings($a_id)
static getActiveTaxonomiesForParentRefId($a_parent_ref_id)
render(array &$a_html, $a_parent_gui)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.