5 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
6 include_once(
"./Services/Taxonomy/exceptions/class.ilTaxonomyException.php");
29 $a_include_please_select =
true 33 $this->lng = $DIC->language();
34 $lng = $DIC->language();
36 $lng->loadLanguageModule(
"tax");
38 $this->include_please_select = $a_include_please_select;
41 $a_title =
$lng->txt(
"tax_taxonomy");
44 if ($a_postvar ==
"") {
45 $a_postvar =
"tax_node_assign";
48 parent::__construct($a_title, $a_postvar);
51 if ((
int) $a_taxonomy_id == 0) {
52 throw new ilTaxonomyExceptions(
"No taxonomy ID passed to ilTaxAssignInputGUI.");
65 $this->taxononmy_id = $a_val;
75 return $this->taxononmy_id;
85 throw new ilTaxonomyExceptions(
"setOptions: Not supported for ilTaxAssignInputGUI.");
97 if ($this->include_please_select) {
101 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
104 $nodes = $tax_tree->getSubtree($tax_tree->getNodeData($tax_tree->readRootId()));
105 foreach ($nodes as
$n) {
106 if ($n[
"type"] ==
"taxn") {
107 $options[$n[
"child"]] = str_repeat(
" ", ($n[
"depth"] - 2) * 2) . $n[
"title"];
120 public function saveInput($a_component_id, $a_obj_id, $a_item_type, $a_item_id)
122 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
129 } elseif (!is_array(
$post)) {
136 $current_ass = $tax_node_ass->getAssignmentsOfItem($a_item_id);
138 foreach ($current_ass as $ca) {
139 if (!in_array($ca[
"node_id"],
$post)) {
140 $tax_node_ass->deleteAssignment($ca[
"node_id"], $a_item_id);
142 $exising[] = $ca[
"node_id"];
146 foreach (
$post as $p) {
147 if (!in_array($p, $exising)) {
161 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
163 $ass = $tax_node_ass->getAssignmentsOfItem($a_item_id);
166 foreach ($ass as $a) {
167 $nodes[] = $a[
"node_id"];
Taxonomy node <-> item assignment.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.