4require_once
"./Services/Object/classes/class.ilObject2GUI.php";
5require_once
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php";
6include_once(
"./Services/Taxonomy/interfaces/interface.ilTaxAssignedItemInfo.php");
40 $this->ctrl =
$DIC->ctrl();
41 $this->lng =
$DIC->language();
42 $this->
user = $DIC->user();
43 $this->tabs =
$DIC->tabs();
44 $this->toolbar =
$DIC->toolbar();
45 $this->tpl =
$DIC[
"tpl"];
46 $this->help =
$DIC[
"ilHelp"];
52 $ilCtrl->saveParameter($this,
"tax_node");
53 $ilCtrl->saveParameter($this,
"tax_id");
55 $lng->loadLanguageModule(
"tax");
75 $this->assigned_object_id = $a_val;
85 return $this->assigned_object_id;
95 $this->multiple = $a_val;
115 $this->list_info = trim($a_val);
125 return $this->list_info;
135 $this->assigned_item_sorting =
true;
136 $this->assigned_item_info_obj = $a_item_info_obj;
137 $this->assigned_item_comp_id = $a_component_id;
138 $this->assigned_item_obj_id = $a_obj_id;
139 $this->assigned_item_type = $a_item_type;
152 $next_class =
$ilCtrl->getNextClass();
154 switch ($next_class) {
156 $cmd =
$ilCtrl->getCmd(
"listTaxonomies");
214 $tax_id = (int)
$_GET[
"tax_id"];
215 if (in_array($tax_id, $tax_ids)) {
258 $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
259 $ilToolbar->addFormButton(
$lng->txt(
"tax_create_node"),
"createTaxNode");
261 $ilToolbar->setCloseFormTag(
false);
268 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
273 (
int)
$_GET[
"tax_node"],
274 $this->getCurrentTaxonomy()
276 $table->setOpenFormTag(
false);
303 return parent::checkPermissionBool($a_perm, $a_cmd,
$a_type, $a_node_id);
318 $ilCtrl->redirect($this,
"listTaxonomies");
321 return parent::cancel();
335 $_REQUEST[
"new_type"] =
"tax";
338 parent::saveObject();
354 $a_new_object->
getId(),
355 $this->getAssignedObject()
357 $ilCtrl->setParameter($this,
"tax_id", $a_new_object->
getId());
358 ilUtil::sendSuccess(
$lng->txt(
"tax_added"),
true);
359 $ilCtrl->redirect($this,
"editSettings");
375 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
377 ?
"listAssignedItems"
386 if (!$tax_exp->handleCommand()) {
388 $tpl->setLeftContent($tax_exp->getHTML() .
" ");
405 $a_root_node_title =
""
407 die(
"ilObjTaxonomyGUI::getTreeHTML is deprecated.");
408 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
416 if (!$tax_exp->handleCommand()) {
417 return $tax_exp->getHTML() .
" ";
435 $ilHelp->setSubScreenId(
"create_node");
438 $tpl->setContent($this->form->getHTML());
452 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
457 $this->form->addItem($ti);
462 $or =
new ilTextInputGUI($this->lng->txt(
"tax_order_nr"),
"order_nr");
463 $or->setMaxLength(5);
465 $this->form->addItem($or);
468 if ($a_mode ==
"edit") {
470 $ti->setValue($node->getTitle());
471 $or->setValue($node->getOrderNr());
475 if ($a_mode ==
"create") {
476 $this->form->addCommandButton(
"saveTaxNode",
$lng->txt(
"save"));
477 $this->form->addCommandButton(
"listNodes",
$lng->txt(
"cancel"));
478 $this->form->setTitle(
$lng->txt(
"tax_new_tax_node"));
480 $this->form->addCommandButton(
"updateTaxNode",
$lng->txt(
"save"));
481 $this->form->addCommandButton(
"listNodes",
$lng->txt(
"cancel"));
482 $this->form->setTitle(
$lng->txt(
"tax_edit_tax_node"));
485 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
499 if ($this->form->checkInput()) {
503 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
505 $node->setTitle($this->form->getInput(
"title"));
509 $order_nr = $this->form->getInput(
"order_nr");
511 if ($order_nr ===
"") {
515 $node->setOrderNr($order_nr);
516 $node->setTaxonomyId($tax->getId());
524 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
525 $ilCtrl->redirect($this,
"listNodes");
527 $this->form->setValuesByPost();
528 $tpl->setContent($this->form->getHtml());
543 if ($this->form->checkInput()) {
546 $node->setTitle($this->form->getInput(
"title"));
550 $node->setOrderNr($this->form->getInput(
"order_nr"));
558 $this->form->setValuesByPost();
559 $tpl->setContent($this->form->getHtml());
574 if (!isset(
$_POST[
"id"])) {
576 $ilCtrl->redirect($this,
"listNodes");
580 $ilHelp->setSubScreenId(
"del_items");
584 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
587 $confirmation_gui->setFormAction(
$ilCtrl->getFormAction($this));
588 $confirmation_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
591 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
593 $confirmation_gui->addItem(
600 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"listNodes");
601 $confirmation_gui->setConfirm(
$lng->txt(
"confirm"),
"confirmedDelete");
603 $tpl->setContent($confirmation_gui->getHTML());
613 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
619 $tax_tree = $tax->getTree();
620 $node_data = $tax_tree->getNodeData(
$id);
621 if (is_object($node)) {
624 if ($tax_tree->isInTree(
$id)) {
625 $tax_tree->deleteTree($node_data);
633 $ilCtrl->redirect($this,
"listNodes");
648 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
649 if (is_array(
$_POST[
"order"])) {
652 foreach (
$_POST[
"order"] as $k => $v) {
659 if (is_array(
$_POST[
"title"])) {
660 foreach (
$_POST[
"title"] as $k => $v) {
669 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"));
670 $ilCtrl->redirect($this,
"listNodes");
684 if (!isset(
$_POST[
"id"])) {
686 $ilCtrl->redirect($this,
"listNodes");
690 $ilHelp->setSubScreenId(
"move_items");
692 $ilToolbar->addButton(
694 $ilCtrl->getLinkTarget($this,
"listNodes")
699 if (is_array(
$_POST[
"id"])) {
700 $ilCtrl->setParameter($this,
"move_ids", implode(
$_POST[
"id"],
","));
707 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
715 if (!$tax_exp->handleCommand()) {
717 $tpl->setContent($tax_exp->getHTML() .
" ");
731 if (
$_GET[
"move_ids"] !=
"") {
732 $move_ids = explode(
",",
$_GET[
"move_ids"]);
734 $tree = $tax->getTree();
736 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
738 foreach ($move_ids as $m_id) {
741 if ($node->getTaxonomyId() == $tax->getId() &&
742 ($target_node->getTaxonomyId() == $tax->getId() ||
743 $target_node->getId() ==
$tree->readRootId())) {
745 if (
$tree->isGrandChild((
int) $m_id, $target_node->getId())) {
747 $this->ctrl->redirect($this,
"listNodes");
753 $tree->moveTree((
int) $m_id, $target_node->getId());
761 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
762 $ilCtrl->redirect($this,
"listNodes");
776 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
778 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
779 $cgui->setHeaderText(
$lng->txt(
"tax_confirm_deletion"));
780 $cgui->setCancel(
$lng->txt(
"cancel"),
"listTaxonomies");
781 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteTaxonomy");
783 $cgui->addItem(
"id[]",
$i, $tax->getTitle());
785 $tpl->setContent($cgui->getHTML());
802 ilUtil::sendSuccess(
$lng->txt(
"tax_tax_deleted"),
true);
803 $ilCtrl->redirect($this,
"listTaxonomies");
820 if (count($tax_ids) == 0 || $this->
getMultiple()) {
821 $ilToolbar->addButton(
822 $lng->txt(
"tax_add_taxonomy"),
823 $ilCtrl->getLinkTarget($this,
"createAssignedTaxonomy")
829 include_once(
"./Services/Taxonomy/classes/class.ilTaxonomyListTableGUI.php");
854 $ilTabs->clearTargets();
856 $ilHelp->setScreenIdComponent(
"tax");
863 $ilTabs->setBackTarget(
865 $ilCtrl->getLinkTarget($this,
"listTaxonomies")
870 $lng->txt(
"tax_nodes"),
871 $ilCtrl->getLinkTarget($this,
"listNodes")
873 if ($this->assigned_item_sorting) {
876 $lng->txt(
"tax_assigned_items"),
877 $ilCtrl->getLinkTarget($this,
"listAssignedItems")
882 $lng->txt(
"settings"),
883 $ilCtrl->getLinkTarget($this,
"editSettings")
886 $ilTabs->activateTab($a_id);
915 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
920 $ti->setMaxLength(200);
922 $ti->setValue($tax->getTitle());
929 $ta->setValue($tax->getDescription());
939 $si->setValue($tax->getSortingMode());
942 if ($this->assigned_item_sorting) {
944 $cb->setChecked($tax->getItemSorting());
948 $form->addCommandButton(
"updateSettings",
$lng->txt(
"save"));
966 if (
$form->checkInput()) {
968 $tax->setTitle(
$form->getInput(
"title"));
969 $tax->setDescription(
$form->getInput(
"description"));
970 $tax->setSortingMode(
$form->getInput(
"sorting"));
971 $tax->setItemSorting(
$form->getInput(
"item_sorting"));
974 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
975 $ilCtrl->redirect($this,
"editSettings");
977 $form->setValuesByPost();
1003 include_once(
"./Services/Taxonomy/classes/class.ilTaxAssignedItemsTableGUI.php");
1006 "listAssignedItems",
1007 (
int)
$_GET[
"tax_node"],
1009 $this->assigned_item_comp_id,
1010 $this->assigned_item_obj_id,
1011 $this->assigned_item_type,
1012 $this->assigned_item_info_obj
1029 include_once(
"./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
1030 if (is_array(
$_POST[
"order"])) {
1031 $order =
$_POST[
"order"];
1034 $tax_node = (int)
$_GET[
"tax_node"];
1035 foreach ($order as $a_item_id => $ord_nr) {
1037 $this->assigned_item_comp_id,
1038 $this->assigned_item_obj_id,
1039 $this->assigned_item_type,
1042 $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
1046 $this->assigned_item_comp_id,
1047 $this->assigned_item_obj_id,
1048 $this->assigned_item_type,
1051 $tax_ass->fixOrderNr($tax_node);
1052 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1054 $ilCtrl->redirect($this,
"listAssignedItems");
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
pasteItems()
Paste items (move operation)
createTaxNode()
Create tax node.
confirmDeleteTaxonomy()
Confirm taxonomy deletion.
saveSorting()
Save settings and sorting.
deleteItems()
Confirm deletion screen for items.
afterSave(ilObject $a_new_object)
After saving,.
listTaxonomies()
List taxonomies.
editSettings()
Edit settings.
executeCommand()
Execute command.
confirmedDelete()
Delete taxonomy nodes.
createAssignedTaxonomy()
Create assigned taxonomy.
__construct($a_id=0)
Execute command.
initCreationForms($a_new_type)
Init creation forms.
setTabs($a_id="")
Set tabs.
updateTaxNode()
Update tax node.
activateAssignedItemSorting(ilTaxAssignedItemInfo $a_item_info_obj, $a_component_id, $a_obj_id, $a_item_type)
Activate sorting mode of assigned objects.
setMultiple($a_val)
Set multiple.
showTree($a_ass_items=false)
Show Editing Tree.
initSettingsForm()
Init form.
deleteTaxonomy()
Delete taxonomy.
updateSettings()
Update taxonomy settings.
static getTreeHTML( $a_tax_id, $a_class, $a_cmd, $a_target_class, $a_target_cmd, $a_root_node_title="")
Get tree html.
saveAssignedItemsSorting()
Save assigned items sorting.
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.
initTaxNodeForm($a_mode="edit")
Init tax node form.
getCurrentTaxonomy()
Get current taxonomy.
getListInfo()
Get list info.
getMultiple()
Get multiple.
setListInfo($a_val)
Set list info.
getCurrentTaxonomyId()
Get current taxonomy id.
listAssignedItems()
List assigned items.
setAssignedObject($a_val)
Set assigned object.
saveTaxNode()
Save tax node form.
getAssignedObject()
Get assigned object.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
New implementation of ilObjectGUI.
create()
Deleted in ilObject.
setTabs()
create tabs (repository/workspace switch)
initCreateForm($a_new_type)
Init object creation form.
Class ilObject Basic functions for all objects.
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
getId()
get object id @access public
TableGUI class for taxonomy list.
Taxonomy node <-> item assignment.
Taxonomy explorer GUI class.
TableGUI class for taxonomy list.
static writeOrderNr($a_node_id, $a_order_nr)
Write order nr.
static fixOrderNumbers($a_tax_id, $a_parent_id)
Fix order numbers.
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.
static writeTitle($a_node_id, $a_title)
Write title.
static _lookupTitle($a_obj_id)
Lookup Title.
static getNextOrderNr($a_tax_id, $a_parent_id)
Put this node into the taxonomy tree.
TableGUI class for taxonomies.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!array_key_exists('StateId', $_REQUEST)) $id
Interface for assigned items of taxonomies.
if(empty($password)) $table
if(isset($_POST['submit'])) $form