4 require_once
"./Services/Object/classes/class.ilObject2GUI.php";
5 require_once
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php";
6 include_once(
"./Services/Taxonomy/interfaces/interface.ilTaxAssignedItemInfo.php");
32 $ilCtrl->saveParameter($this,
"tax_node");
33 $ilCtrl->saveParameter($this,
"tax_id");
35 $lng->loadLanguageModule(
"tax");
55 $this->assigned_object_id = $a_val;
65 return $this->assigned_object_id;
75 $this->multiple = $a_val;
95 $this->list_info = trim($a_val);
105 return $this->list_info;
115 $this->assigned_item_sorting =
true;
116 $this->assigned_item_info_obj = $a_item_info_obj;
117 $this->assigned_item_comp_id = $a_component_id;
118 $this->assigned_item_obj_id = $a_obj_id;
119 $this->assigned_item_type = $a_item_type;
130 $next_class = $ilCtrl->getNextClass();
135 $cmd = $ilCtrl->getCmd(
"listTaxonomies");
192 $tax_id = (int)
$_GET[
"tax_id"];
193 if (in_array($tax_id, $tax_ids))
235 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
236 $ilToolbar->addFormButton($lng->txt(
"tax_create_node"),
"createTaxNode");
238 $ilToolbar->setCloseFormTag(
false);
245 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
250 $tpl->setContent($table->getHTML());
278 return parent::checkPermissionBool($a_perm, $a_cmd,
$a_type, $a_node_id);
294 $ilCtrl->redirect($this,
"listTaxonomies");
297 return parent::cancel();
312 $_REQUEST[
"new_type"] =
"tax";
315 parent::saveObject();
332 $ilCtrl->setParameter($this,
"tax_id", $a_new_object->
getId());
334 $ilCtrl->redirect($this,
"editSettings");
347 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
349 ?
"listAssignedItems" 352 "ilobjtaxonomygui",
$cmd);
353 if (!$tax_exp->handleCommand())
356 $tpl->setLeftContent($tax_exp->getHTML().
" ");
368 $a_target_class, $a_target_cmd, $a_root_node_title =
"")
370 die(
"ilObjTaxonomyGUI::getTreeHTML is deprecated.");
371 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
373 $a_target_class, $a_target_cmd);
374 if (!$tax_exp->handleCommand())
376 return $tax_exp->getHTML().
" ";
390 global
$tpl, $ilHelp;
393 $ilHelp->setSubScreenId(
"create_node");
396 $tpl->setContent($this->form->getHTML());
409 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
414 $this->form->addItem($ti);
420 $or =
new ilTextInputGUI($this->lng->txt(
"tax_order_nr"),
"order_nr");
423 $this->form->addItem($or);
426 if ($a_mode ==
"edit")
429 $ti->setValue($node->getTitle());
430 $or->setValue($node->getOrderNr());
434 if ($a_mode ==
"create")
436 $this->form->addCommandButton(
"saveTaxNode", $lng->txt(
"save"));
437 $this->form->addCommandButton(
"listNodes", $lng->txt(
"cancel"));
438 $this->form->setTitle($lng->txt(
"tax_new_tax_node"));
442 $this->form->addCommandButton(
"updateTaxNode", $lng->txt(
"save"));
443 $this->form->addCommandButton(
"listNodes", $lng->txt(
"cancel"));
444 $this->form->setTitle($lng->txt(
"tax_edit_tax_node"));
447 $this->form->setFormAction($ilCtrl->getFormAction($this));
460 if ($this->form->checkInput())
465 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
467 $node->setTitle($this->form->getInput(
"title"));
472 $order_nr = $this->form->getInput(
"order_nr");
474 if ($order_nr ===
"")
479 $node->setOrderNr($order_nr);
480 $node->setTaxonomyId($tax->getId());
489 $ilCtrl->redirect($this,
"listNodes");
493 $this->form->setValuesByPost();
494 $tpl->setContent($this->form->getHtml());
507 if ($this->form->checkInput())
511 $node->setTitle($this->form->getInput(
"title"));
516 $node->setOrderNr($this->form->getInput(
"order_nr"));
522 $ilCtrl->redirect($this,
"");
526 $this->form->setValuesByPost();
527 $tpl->setContent($this->form->getHtml());
541 $ilCtrl->redirect($this,
"listNodes");
545 $ilHelp->setSubScreenId(
"del_items");
549 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
552 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
553 $confirmation_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
556 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
557 foreach(
$_POST[
"id"] as $id)
559 $confirmation_gui->addItem(
"id[]", $id,
563 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"listNodes");
564 $confirmation_gui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
566 $tpl->setContent($confirmation_gui->getHTML());
576 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
579 foreach (
$_POST[
"id"] as $id)
584 $node_data = $tax_tree->getNodeData($id);
585 if (is_object($node))
589 if($tax_tree->isInTree($id))
591 $tax_tree->deleteTree($node_data);
599 $ilCtrl->redirect($this,
"listNodes");
613 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
614 if (is_array(
$_POST[
"order"]))
618 foreach (
$_POST[
"order"] as $k => $v)
626 if (is_array(
$_POST[
"title"]))
628 foreach (
$_POST[
"title"] as $k => $v)
637 $ilCtrl->redirect($this,
"listNodes");
650 $ilCtrl->redirect($this,
"listNodes");
654 $ilHelp->setSubScreenId(
"move_items");
656 $ilToolbar->addButton($lng->txt(
"cancel"),
657 $ilCtrl->getLinkTarget($this,
"listNodes"));
661 if (is_array(
$_POST[
"id"]))
663 $ilCtrl->setParameter($this,
"move_ids", implode(
$_POST[
"id"],
","));
667 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
669 "ilobjtaxonomygui",
"pasteItems");
670 if (!$tax_exp->handleCommand())
673 $tpl->setContent($tax_exp->getHTML().
" ");
686 if (
$_GET[
"move_ids"] !=
"")
688 $move_ids = explode(
",",
$_GET[
"move_ids"]);
690 $tree = $tax->getTree();
692 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
694 foreach ($move_ids as $m_id)
698 if ($node->getTaxonomyId() == $tax->getId() &&
699 ($target_node->getTaxonomyId() == $tax->getId() ||
700 $target_node->getId() ==
$tree->readRootId()))
703 if(
$tree->isGrandChild((
int) $m_id, $target_node->getId()))
706 $this->ctrl->redirect($this,
"listNodes");
713 $tree->moveTree((
int) $m_id, $target_node->getId());
722 $ilCtrl->redirect($this,
"listNodes");
734 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
736 $cgui->setFormAction($ilCtrl->getFormAction($this));
737 $cgui->setHeaderText($lng->txt(
"tax_confirm_deletion"));
738 $cgui->setCancel($lng->txt(
"cancel"),
"listTaxonomies");
739 $cgui->setConfirm($lng->txt(
"delete"),
"deleteTaxonomy");
741 $cgui->addItem(
"id[]", $i, $tax->getTitle());
743 $tpl->setContent($cgui->getHTML());
760 $ilCtrl->redirect($this,
"listTaxonomies");
776 $ilToolbar->addButton($lng->txt(
"tax_add_taxonomy"),
777 $ilCtrl->getLinkTarget($this,
"createAssignedTaxonomy"));
784 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyListTableGUI.php");
789 $tpl->setContent(
$tab->getHTML());
801 $ilTabs->clearTargets();
803 $ilHelp->setScreenIdComponent(
"tax");
810 $ilTabs->setBackTarget($lng->txt(
"back"),
811 $ilCtrl->getLinkTarget($this,
"listTaxonomies"));
813 $ilTabs->addTab(
"list_items", $lng->txt(
"tax_nodes"),
814 $ilCtrl->getLinkTarget($this,
"listNodes"));
815 if ($this->assigned_item_sorting)
817 $ilTabs->addTab(
"ass_items", $lng->txt(
"tax_assigned_items"),
818 $ilCtrl->getLinkTarget($this,
"listAssignedItems"));
820 $ilTabs->addTab(
"settings", $lng->txt(
"settings"),
821 $ilCtrl->getLinkTarget($this,
"editSettings"));
823 $ilTabs->activateTab($a_id);
839 $tpl->setContent($form->getHTML());
851 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
858 $ti->setValue($tax->getTitle());
865 $ta->
setValue($tax->getDescription());
875 $si->setValue($tax->getSortingMode());
878 if ($this->assigned_item_sorting)
885 $form->addCommandButton(
"updateSettings", $lng->txt(
"save"));
887 $form->setTitle($lng->txt(
"settings"));
888 $form->setFormAction($ilCtrl->getFormAction($this));
901 if ($form->checkInput())
904 $tax->setTitle($form->getInput(
"title"));
905 $tax->setDescription($form->getInput(
"description"));
906 $tax->setSortingMode($form->getInput(
"sorting"));
907 $tax->setItemSorting($form->getInput(
"item_sorting"));
911 $ilCtrl->redirect($this,
"editSettings");
915 $form->setValuesByPost();
916 $tpl->setContent($form->getHtml());
938 include_once(
"./Services/Taxonomy/classes/class.ilTaxAssignedItemsTableGUI.php");
941 $this->assigned_item_obj_id, $this->assigned_item_type, $this->assigned_item_info_obj);
943 $tpl->setContent($table->getHTML());
956 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
957 if (is_array(
$_POST[
"order"]))
962 $tax_node = (int)
$_GET[
"tax_node"];
963 foreach ($order as $a_item_id => $ord_nr)
966 $this->assigned_item_obj_id,
968 $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
972 $this->assigned_item_obj_id,
974 $tax_ass->fixOrderNr($tax_node);
977 $ilCtrl->redirect($this,
"listAssignedItems");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
deleteTaxonomy()
Delete taxonomy.
setMultiple($a_val)
Set multiple.
__construct($a_id=0)
Execute command.
Taxonomy node <-> item assignment.
static getNextOrderNr($a_tax_id, $a_parent_id)
Put this node into the taxonomy tree.
static writeTitle($a_node_id, $a_title)
Write title.
setAssignedObject($a_val)
Set assigned object.
editSettings()
Edit settings.
deleteItems()
Confirm deletion screen for items.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
saveTaxNode()
Save tax node form.
New implementation of ilObjectGUI.
updateSettings()
Update taxonomy settings.
getMultiple()
Get multiple.
Class ilObject Basic functions for all objects.
listTaxonomies()
List taxonomies.
TableGUI class for taxonomy list.
createTaxNode()
Create tax node.
Taxonomy explorer GUI class.
create()
Deleted in ilObject.
activateAssignedItemSorting(ilTaxAssignedItemInfo $a_item_info_obj, $a_component_id, $a_obj_id, $a_item_type)
Activate sorting mode of assigned objects.
setValue($a_value)
Set Value.
executeCommand()
Execute command.
static _lookupTitle($a_id)
lookup object title
saveAssignedItemsSorting()
Save assigned items sorting.
initSettingsForm()
Init form.
createAssignedTaxonomy()
Create assigned taxonomy.
static _lookupTitle($a_obj_id)
Lookup Title.
confirmDeleteTaxonomy()
Confirm taxonomy deletion.
afterSave(ilObject $a_new_object)
After saving,.
getCurrentTaxonomyId()
Get current taxonomy id.
static writeOrderNr($a_node_id, $a_order_nr)
Write order nr.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options
getId()
get object id public
setTabs($a_id="")
Set tabs.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
TableGUI class for taxonomies.
pasteItems()
Paste items (move operation)
This class represents a text property in a property form.
updateTaxNode()
Update tax node.
setMaxLength($a_maxlength)
Set Max Length.
initCreateForm($a_new_type)
Init object creation form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setListInfo($a_val)
Set list info.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
If we run under an assigned object, the permission should be checked on the upper level...
confirmedDelete()
Delete taxonomy nodes.
setTabs()
create tabs (repository/workspace switch)
Interface for assigned items of taxonomies.
listAssignedItems()
List assigned items.
static getTreeHTML($a_tax_id, $a_class, $a_cmd, $a_target_class, $a_target_cmd, $a_root_node_title="")
Get tree html.
initCreationForms($a_new_type)
Init creation forms.
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
initTaxNodeForm($a_mode="edit")
Init tax node form.
static putInTree($a_tax_id, $a_node, $a_parent_id="", $a_target_node_id="", $a_order_nr=0)
Put this node into the taxonomy tree.
This class represents a text area property in a property form.
saveSorting()
Save settings and sorting.
setOpenFormTag($a_val)
Set open form tag.
getCurrentTaxonomy()
Get current taxonomy.
TableGUI class for taxonomy list.
showTree($a_ass_items=false)
Show Editing Tree.
getAssignedObject()
Get assigned object.
static fixOrderNumbers($a_tax_id, $a_parent_id)
Fix order numbers.
Confirmation screen class.
getListInfo()
Get list info.