ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjTaxonomyGUI Class Reference

Taxonomy GUI class. More...

+ Inheritance diagram for ilObjTaxonomyGUI:
+ Collaboration diagram for ilObjTaxonomyGUI:

Public Member Functions

 __construct ($a_id=0)
 Execute command. More...
 
 getType ()
 Get type. More...
 
 setAssignedObject ($a_val)
 Set assigned object. More...
 
 getAssignedObject ()
 Get assigned object. More...
 
 setMultiple ($a_val)
 Set multiple. More...
 
 getMultiple ()
 Get multiple. More...
 
 setListInfo ($a_val)
 Set list info. More...
 
 getListInfo ()
 Get list info. More...
 
 activateAssignedItemSorting (ilTaxAssignedItemInfo $a_item_info_obj, $a_component_id, $a_obj_id, $a_item_type)
 Activate sorting mode of assigned objects. More...
 
 executeCommand ()
 Execute command. More...
 
 editAOTaxonomySettings ()
 
 getCurrentTaxonomyId ()
 Get current taxonomy id. More...
 
 getCurrentTaxonomy ()
 Get current taxonomy. More...
 
 listNodes ()
 List items. More...
 
 createAssignedTaxonomy ()
 Create assigned taxonomy. More...
 
 cancel ()
 Cancel creation. More...
 
 save ()
 Save taxonomy. More...
 
 showTree ($a_ass_items=false)
 Show Editing Tree. More...
 
 createTaxNode ()
 Create tax node. More...
 
 initTaxNodeForm ($a_mode="edit")
 Init tax node form. More...
 
 saveTaxNode ()
 Save tax node form. More...
 
 updateTaxNode ()
 Update tax node. More...
 
 deleteItems ()
 Confirm deletion screen for items. More...
 
 confirmedDelete ()
 Delete taxonomy nodes. More...
 
 saveSorting ()
 Save settings and sorting. More...
 
 moveItems ()
 Move items. More...
 
 pasteItems ()
 Paste items (move operation) More...
 
 confirmDeleteTaxonomy ()
 Confirm taxonomy deletion. More...
 
 deleteTaxonomy ()
 Delete taxonomy. More...
 
 listTaxonomies ()
 List taxonomies. More...
 
 setTabs ($a_id="")
 Set tabs. More...
 
 editSettings ()
 Edit settings. More...
 
 initSettingsForm ()
 Init form. More...
 
 updateSettings ()
 Update taxonomy settings. More...
 
 listAssignedItems ()
 List assigned items. More...
 
 saveAssignedItemsSorting ()
 Save assigned items sorting. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static getTreeHTML ( $a_tax_id, $a_class, $a_cmd, $a_target_class, $a_target_cmd, $a_root_node_title="")
 Get tree html. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation forms. More...
 
 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. More...
 
 afterSave (ilObject $a_new_object)
 After saving,. More...
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabs
 
 $help
 
 $multiple = false
 
 $assigned_item_sorting = false
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Taxonomy GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilObjTaxonomyGUI:

Definition at line 18 of file class.ilObjTaxonomyGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjTaxonomyGUI::__construct (   $a_id = 0)

Execute command.

Definition at line 36 of file class.ilObjTaxonomyGUI.php.

References $DIC, ilObjectGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), help(), ilObject2GUI\OBJECT_ID, and user().

37  {
38  global $DIC;
39 
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"];
47  $ilCtrl = $DIC->ctrl();
48  $lng = $DIC->language();
49 
51 
52  $ilCtrl->saveParameter($this, "tax_node");
53  $ilCtrl->saveParameter($this, "tax_id");
54 
55  $lng->loadLanguageModule("tax");
56  }
user()
Definition: user.php:4
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ activateAssignedItemSorting()

ilObjTaxonomyGUI::activateAssignedItemSorting ( ilTaxAssignedItemInfo  $a_item_info_obj,
  $a_component_id,
  $a_obj_id,
  $a_item_type 
)

Activate sorting mode of assigned objects.

Parameters
object$a_item_info_objinformation object of assigned items

Definition at line 133 of file class.ilObjTaxonomyGUI.php.

134  {
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;
140  }

◆ afterSave()

ilObjTaxonomyGUI::afterSave ( ilObject  $a_new_object)
protected

After saving,.

Parameters

Definition at line 347 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, getAssignedObject(), ilObject\getId(), and ilObjTaxonomy\saveUsage().

348  {
349  $ilCtrl = $this->ctrl;
350  $lng = $this->lng;
351 
352  if ($this->getAssignedObject() > 0) {
354  $a_new_object->getId(),
355  $this->getAssignedObject()
356  );
357  $ilCtrl->setParameter($this, "tax_id", $a_new_object->getId());
358  ilUtil::sendSuccess($lng->txt("tax_added"), true);
359  $ilCtrl->redirect($this, "editSettings");
360  }
361  }
getId()
get object id public
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ cancel()

ilObjTaxonomyGUI::cancel ( )

Cancel creation.

Parameters

Definition at line 313 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, and getAssignedObject().

314  {
315  $ilCtrl = $this->ctrl;
316 
317  if ($this->getAssignedObject() > 0) {
318  $ilCtrl->redirect($this, "listTaxonomies");
319  }
320 
321  return parent::cancel();
322  }
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ checkPermissionBool()

ilObjTaxonomyGUI::checkPermissionBool (   $a_perm,
  $a_cmd = "",
  $a_type = "",
  $a_node_id = null 
)
protected

If we run under an assigned object, the permission should be checked on the upper level.

Definition at line 298 of file class.ilObjTaxonomyGUI.php.

References getAssignedObject().

299  {
300  if ($this->getAssignedObject() > 0) {
301  return true;
302  } else {
303  return parent::checkPermissionBool($a_perm, $a_cmd, $a_type, $a_node_id);
304  }
305  }
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ confirmDeleteTaxonomy()

ilObjTaxonomyGUI::confirmDeleteTaxonomy ( )

Confirm taxonomy deletion.

Definition at line 792 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, $i, ilObjectGUI\$lng, ilObjectGUI\$tpl, and getCurrentTaxonomy().

793  {
794  $ilCtrl = $this->ctrl;
795  $tpl = $this->tpl;
796  $lng = $this->lng;
797 
798  $tax = $this->getCurrentTaxonomy();
799 
800  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
801  $cgui = new ilConfirmationGUI();
802  $cgui->setFormAction($ilCtrl->getFormAction($this));
803  $cgui->setHeaderText($lng->txt("tax_confirm_deletion"));
804  $cgui->setCancel($lng->txt("cancel"), "listTaxonomies");
805  $cgui->setConfirm($lng->txt("delete"), "deleteTaxonomy");
806 
807  $cgui->addItem("id[]", $i, $tax->getTitle());
808 
809  $tpl->setContent($cgui->getHTML());
810  }
getCurrentTaxonomy()
Get current taxonomy.
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmedDelete()

ilObjTaxonomyGUI::confirmedDelete ( )

Delete taxonomy nodes.

Definition at line 632 of file class.ilObjTaxonomyGUI.php.

References $_POST, ilObjectGUI\$ctrl, ilObject2\delete(), ilTaxonomyNode\fixOrderNumbers(), ilObjTaxonomy\getTree(), and ilUtil\sendInfo().

633  {
634  $ilCtrl = $this->ctrl;
635 
636  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
637 
638  // delete all selected objects
639  foreach ($_POST["id"] as $id) {
640  $node = new ilTaxonomyNode($id);
641  $tax = new ilObjTaxonomy($node->getTaxonomyId());
642  $tax_tree = $tax->getTree();
643  $node_data = $tax_tree->getNodeData($id);
644  if (is_object($node)) {
645  $node->delete();
646  }
647  if ($tax_tree->isInTree($id)) {
648  $tax_tree->deleteTree($node_data);
649  }
650  ilTaxonomyNode::fixOrderNumbers($node->getTaxonomyId(), $node_data["parent"]);
651  }
652 
653  // feedback
654  ilUtil::sendInfo($this->lng->txt("info_deleted"), true);
655 
656  $ilCtrl->redirect($this, "listNodes");
657  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
static fixOrderNumbers($a_tax_id, $a_parent_id)
Fix order numbers.
+ Here is the call graph for this function:

◆ createAssignedTaxonomy()

ilObjTaxonomyGUI::createAssignedTaxonomy ( )

Create assigned taxonomy.

Parameters

Definition at line 288 of file class.ilObjTaxonomyGUI.php.

References ilObject2GUI\create().

289  {
290  $this->create();
291  }
create()
Deleted in ilObject.
+ Here is the call graph for this function:

◆ createTaxNode()

ilObjTaxonomyGUI::createTaxNode ( )

Create tax node.

Parameters

Definition at line 452 of file class.ilObjTaxonomyGUI.php.

References $help, ilObjectGUI\$tpl, initTaxNodeForm(), and ilObject2GUI\setTabs().

453  {
454  $tpl = $this->tpl;
455  $ilHelp = $this->help;
456 
457  $this->setTabs("list_items");
458  $ilHelp->setSubScreenId("create_node");
459 
460  $this->initTaxNodeForm("create");
461  $tpl->setContent($this->form->getHTML());
462  }
setTabs()
create tabs (repository/workspace switch)
initTaxNodeForm($a_mode="edit")
Init tax node form.
+ Here is the call graph for this function:

◆ deleteItems()

ilObjTaxonomyGUI::deleteItems ( )

Confirm deletion screen for items.

Definition at line 589 of file class.ilObjTaxonomyGUI.php.

References $_POST, ilObjectGUI\$ctrl, $help, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilTaxonomyNode\_lookupTitle(), ilUtil\sendFailure(), and ilObject2GUI\setTabs().

590  {
591  $lng = $this->lng;
592  $tpl = $this->tpl;
593  $ilCtrl = $this->ctrl;
594  $ilTabs = $this->tabs;
595  $ilHelp = $this->help;
596 
597  if (!isset($_POST["id"])) {
598  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
599  $ilCtrl->redirect($this, "listNodes");
600  }
601 
602  $this->setTabs("list_items");
603  $ilHelp->setSubScreenId("del_items");
604 
605  // $ilTabs->clearTargets();
606 
607  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
608  $confirmation_gui = new ilConfirmationGUI();
609 
610  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
611  $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
612 
613  // Add items to delete
614  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
615  foreach ($_POST["id"] as $id) {
616  $confirmation_gui->addItem(
617  "id[]",
618  $id,
620  );
621  }
622 
623  $confirmation_gui->setCancel($lng->txt("cancel"), "listNodes");
624  $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
625 
626  $tpl->setContent($confirmation_gui->getHTML());
627  }
static _lookupTitle($a_obj_id)
Lookup Title.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setTabs()
create tabs (repository/workspace switch)
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteTaxonomy()

ilObjTaxonomyGUI::deleteTaxonomy ( )

Delete taxonomy.

Parameters

Definition at line 818 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, and getCurrentTaxonomy().

819  {
820  $ilCtrl = $this->ctrl;
821  $lng = $this->lng;
822 
823  $tax = $this->getCurrentTaxonomy();
824  $tax->delete();
825 
826  ilUtil::sendSuccess($lng->txt("tax_tax_deleted"), true);
827  $ilCtrl->redirect($this, "listTaxonomies");
828  }
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:

◆ editAOTaxonomySettings()

ilObjTaxonomyGUI::editAOTaxonomySettings ( )
Parameters

Definition at line 185 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$toolbar, and listTaxonomies().

186  {
187  $ilToolbar = $this->toolbar;
188  $ilCtrl = $this->ctrl;
189  $lng = $this->lng;
190 
191 
192  // if (count($tax_ids) != 0 && !$this->getMultiple())
193  // {
194  // $this->listNodes();
195  // }
196  // else if ($this->getMultiple())
197  // {
198  $this->listTaxonomies();
199  // }
200 
201  // currently we support only one taxonomy, otherwise we may need to provide
202  // a list here
203  }
listTaxonomies()
List taxonomies.
+ Here is the call graph for this function:

◆ editSettings()

ilObjTaxonomyGUI::editSettings ( )

Edit settings.

Parameters

Definition at line 918 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$tpl, initSettingsForm(), and ilObject2GUI\setTabs().

919  {
920  $tpl = $this->tpl;
921 
922  $this->setTabs("settings");
923 
924  $form = $this->initSettingsForm();
925  $tpl->setContent($form->getHTML());
926  }
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjTaxonomyGUI::executeCommand ( )

Execute command.

Definition at line 146 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, $ilUser, $tabs, and ilObjectGUI\$user.

147  {
148  $ilCtrl = $this->ctrl;
150  $ilTabs = $this->tabs;
151 
152  $next_class = $ilCtrl->getNextClass();
153 
154  switch ($next_class) {
155  default:
156  $cmd = $ilCtrl->getCmd("listTaxonomies");
157  $this->$cmd();
158  break;
159  }
160  }
$ilUser
Definition: imgupload.php:18

◆ getAssignedObject()

ilObjTaxonomyGUI::getAssignedObject ( )

Get assigned object.

Returns
int object id

Definition at line 83 of file class.ilObjTaxonomyGUI.php.

Referenced by afterSave(), cancel(), checkPermissionBool(), getCurrentTaxonomyId(), listTaxonomies(), and save().

84  {
85  return $this->assigned_object_id;
86  }
+ Here is the caller graph for this function:

◆ getCurrentTaxonomy()

ilObjTaxonomyGUI::getCurrentTaxonomy ( )

Get current taxonomy.

Parameters

Definition at line 228 of file class.ilObjTaxonomyGUI.php.

References getCurrentTaxonomyId().

Referenced by confirmDeleteTaxonomy(), deleteTaxonomy(), initSettingsForm(), initTaxNodeForm(), listAssignedItems(), listNodes(), moveItems(), pasteItems(), saveTaxNode(), showTree(), updateSettings(), and updateTaxNode().

229  {
230  $tax_id = $this->getCurrentTaxonomyId();
231  if ($tax_id > 0) {
232  $tax = new ilObjTaxonomy($tax_id);
233  return $tax;
234  }
235 
236  return false;
237  }
getCurrentTaxonomyId()
Get current taxonomy id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentTaxonomyId()

ilObjTaxonomyGUI::getCurrentTaxonomyId ( )

Get current taxonomy id.

Parameters

Definition at line 211 of file class.ilObjTaxonomyGUI.php.

References $_GET, getAssignedObject(), and ilObjTaxonomy\getUsageOfObject().

Referenced by getCurrentTaxonomy(), saveAssignedItemsSorting(), saveSorting(), and setTabs().

212  {
214  $tax_id = (int) $_GET["tax_id"];
215  if (in_array($tax_id, $tax_ids)) {
216  return $tax_id;
217  }
218  return false;
219  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
$_GET["client_id"]
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListInfo()

ilObjTaxonomyGUI::getListInfo ( )

Get list info.

Returns
string

Definition at line 123 of file class.ilObjTaxonomyGUI.php.

Referenced by listTaxonomies().

124  {
125  return $this->list_info;
126  }
+ Here is the caller graph for this function:

◆ getMultiple()

ilObjTaxonomyGUI::getMultiple ( )

Get multiple.

Returns
bool multiple

Definition at line 103 of file class.ilObjTaxonomyGUI.php.

References $multiple.

Referenced by listTaxonomies().

104  {
105  return $this->multiple;
106  }
+ Here is the caller graph for this function:

◆ getTreeHTML()

static ilObjTaxonomyGUI::getTreeHTML (   $a_tax_id,
  $a_class,
  $a_cmd,
  $a_target_class,
  $a_target_cmd,
  $a_root_node_title = "" 
)
static

Get tree html.

Parameters

Definition at line 422 of file class.ilObjTaxonomyGUI.php.

429  {
430  die("ilObjTaxonomyGUI::getTreeHTML is deprecated.");
431  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
432  $tax_exp = new ilTaxonomyExplorerGUI(
433  $a_class,
434  $a_cmd,
435  $a_tax_id,
436  $a_target_class,
437  $a_target_cmd
438  );
439  if (!$tax_exp->handleCommand()) {
440  return $tax_exp->getHTML() . " ";
441  }
442  return;
443  }
Taxonomy explorer GUI class.

◆ getType()

ilObjTaxonomyGUI::getType ( )

Get type.

Returns
string type

Definition at line 63 of file class.ilObjTaxonomyGUI.php.

64  {
65  return "tax";
66  }

◆ initCreationForms()

ilObjTaxonomyGUI::initCreationForms (   $a_new_type)
protected

Init creation forms.

Definition at line 165 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\initCreateForm().

166  {
167  $forms = array(
168  self::CFORM_NEW => $this->initCreateForm("tax")
169  );
170 
171  return $forms;
172  }
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjTaxonomyGUI::initSettingsForm ( )

Init form.

Definition at line 931 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, $si, getCurrentTaxonomy(), ilCheckboxInputGUI\setChecked(), ilTextAreaInputGUI\setValue(), ilObjTaxonomy\SORT_ALPHABETICAL, and ilObjTaxonomy\SORT_MANUAL.

Referenced by editSettings(), and updateSettings().

932  {
933  $lng = $this->lng;
934  $ilCtrl = $this->ctrl;
935 
936  $tax = $this->getCurrentTaxonomy();
937 
938  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
939  $form = new ilPropertyFormGUI();
940 
941  // title
942  $ti = new ilTextInputGUI($lng->txt("title"), "title");
943  $ti->setMaxLength(200);
944  $form->addItem($ti);
945  $ti->setValue($tax->getTitle());
946 
947  // description
948  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
949  //$ta->setCols();
950  //$ta->setRows();
951  $form->addItem($ta);
952  $ta->setValue($tax->getDescription());
953 
954  // sorting
955  $options = array(
956  ilObjTaxonomy::SORT_ALPHABETICAL => $lng->txt("tax_alphabetical"),
957  ilObjTaxonomy::SORT_MANUAL => $lng->txt("tax_manual")
958  );
959  $si = new ilSelectInputGUI($lng->txt("tax_node_sorting"), "sorting");
960  $si->setOptions($options);
961  $form->addItem($si);
962  $si->setValue($tax->getSortingMode());
963 
964  // assigned item sorting
965  if ($this->assigned_item_sorting) {
966  $cb = new ilCheckboxInputGUI($lng->txt("tax_item_sorting"), "item_sorting");
967  $cb->setChecked($tax->getItemSorting());
968  $form->addItem($cb);
969  }
970 
971  $form->addCommandButton("updateSettings", $lng->txt("save"));
972 
973  $form->setTitle($lng->txt("settings"));
974  $form->setFormAction($ilCtrl->getFormAction($this));
975 
976  return $form;
977  }
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
This class represents a text area property in a property form.
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTaxNodeForm()

ilObjTaxonomyGUI::initTaxNodeForm (   $a_mode = "edit")

Init tax node form.

Parameters
int$a_modeEdit Mode

Definition at line 470 of file class.ilObjTaxonomyGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, getCurrentTaxonomy(), and ilObjTaxonomy\SORT_MANUAL.

Referenced by createTaxNode(), saveTaxNode(), and updateTaxNode().

471  {
472  $lng = $this->lng;
473  $ilCtrl = $this->ctrl;
474 
475  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
476  $this->form = new ilPropertyFormGUI();
477 
478  // title
479  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
480  $this->form->addItem($ti);
481 
482  // order nr
483  $tax = $this->getCurrentTaxonomy();
484  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) {
485  $or = new ilTextInputGUI($this->lng->txt("tax_order_nr"), "order_nr");
486  $or->setMaxLength(5);
487  $or->setSize(5);
488  $this->form->addItem($or);
489  }
490 
491  if ($a_mode == "edit") {
492  $node = new ilTaxonomyNode((int) $_GET["tax_node"]);
493  $ti->setValue($node->getTitle());
494  $or->setValue($node->getOrderNr());
495  }
496 
497  // save and cancel commands
498  if ($a_mode == "create") {
499  $this->form->addCommandButton("saveTaxNode", $lng->txt("save"));
500  $this->form->addCommandButton("listNodes", $lng->txt("cancel"));
501  $this->form->setTitle($lng->txt("tax_new_tax_node"));
502  } else {
503  $this->form->addCommandButton("updateTaxNode", $lng->txt("save"));
504  $this->form->addCommandButton("listNodes", $lng->txt("cancel"));
505  $this->form->setTitle($lng->txt("tax_edit_tax_node"));
506  }
507 
508  $this->form->setFormAction($ilCtrl->getFormAction($this));
509  }
This class represents a property form user interface.
$_GET["client_id"]
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listAssignedItems()

ilObjTaxonomyGUI::listAssignedItems ( )

List assigned items.

Parameters

Definition at line 1011 of file class.ilObjTaxonomyGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, getCurrentTaxonomy(), ilObject2GUI\setTabs(), and showTree().

1012  {
1013  $tpl = $this->tpl;
1014  $ilToolbar = $this->toolbar;
1015  $lng = $this->lng;
1016  $ilCtrl = $this->ctrl;
1017 
1018  $tax = $this->getCurrentTaxonomy();
1019 
1020  $this->setTabs("ass_items");
1021 
1022  // show tree
1023  $this->showTree(true);
1024 
1025  // list assigned items
1026  include_once("./Services/Taxonomy/classes/class.ilTaxAssignedItemsTableGUI.php");
1027  $table = new ilTaxAssignedItemsTableGUI(
1028  $this,
1029  "listAssignedItems",
1030  (int) $_GET["tax_node"],
1031  $this->getCurrentTaxonomy(),
1032  $this->assigned_item_comp_id,
1033  $this->assigned_item_obj_id,
1034  $this->assigned_item_type,
1035  $this->assigned_item_info_obj
1036  );
1037 
1038  $tpl->setContent($table->getHTML());
1039  }
$_GET["client_id"]
TableGUI class for taxonomy list.
setTabs()
create tabs (repository/workspace switch)
getCurrentTaxonomy()
Get current taxonomy.
showTree($a_ass_items=false)
Show Editing Tree.
+ Here is the call graph for this function:

◆ listNodes()

ilObjTaxonomyGUI::listNodes ( )

List items.

Parameters

Definition at line 246 of file class.ilObjTaxonomyGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, getCurrentTaxonomy(), ilTable2GUI\setOpenFormTag(), ilObject2GUI\setTabs(), and showTree().

247  {
248  $tpl = $this->tpl;
249  $ilToolbar = $this->toolbar;
250  $lng = $this->lng;
251  $ilCtrl = $this->ctrl;
252 
253  $tax = $this->getCurrentTaxonomy();
254 
255  $this->setTabs("list_items");
256 
257  // show toolbar
258  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
259  $ilToolbar->addFormButton($lng->txt("tax_create_node"), "createTaxNode");
260 
261  $ilToolbar->setCloseFormTag(false);
262 
263 
264  // show tree
265  $this->showTree();
266 
267  // show subitems
268  include_once("./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
269  $table = new ilTaxonomyTableGUI(
270  $this,
271  "listNodes",
272  $tax->getTree(),
273  (int) $_GET["tax_node"],
274  $this->getCurrentTaxonomy()
275  );
276  $table->setOpenFormTag(false);
277 
278  $tpl->setContent($table->getHTML());
279  }
$_GET["client_id"]
TableGUI class for taxonomies.
setTabs()
create tabs (repository/workspace switch)
setOpenFormTag($a_val)
Set open form tag.
getCurrentTaxonomy()
Get current taxonomy.
showTree($a_ass_items=false)
Show Editing Tree.
+ Here is the call graph for this function:

◆ listTaxonomies()

ilObjTaxonomyGUI::listTaxonomies ( )

List taxonomies.

Parameters

Definition at line 836 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, getAssignedObject(), getListInfo(), getMultiple(), ilObjTaxonomy\getUsageOfObject(), and ilUtil\sendInfo().

Referenced by editAOTaxonomySettings().

837  {
838  $tpl = $this->tpl;
839  $ilToolbar = $this->toolbar;
840  $lng = $this->lng;
841  $ilCtrl = $this->ctrl;
842 
844  if (count($tax_ids) == 0 || $this->getMultiple()) {
845  $ilToolbar->addButton(
846  $lng->txt("tax_add_taxonomy"),
847  $ilCtrl->getLinkTarget($this, "createAssignedTaxonomy")
848  );
849  } else {
850  ilUtil::sendInfo($lng->txt("tax_max_one_tax"));
851  }
852 
853  include_once("./Services/Taxonomy/classes/class.ilTaxonomyListTableGUI.php");
854 
855  $tab = new ilTaxonomyListTableGUI(
856  $this,
857  "listTaxonomies",
858  $this->getAssignedObject(),
859  $this->getListInfo()
860  );
861 
862  $tpl->setContent($tab->getHTML());
863  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
getMultiple()
Get multiple.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
TableGUI class for taxonomy list.
getAssignedObject()
Get assigned object.
getListInfo()
Get list info.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveItems()

ilObjTaxonomyGUI::moveItems ( )

Move items.

Definition at line 699 of file class.ilObjTaxonomyGUI.php.

References $_POST, ilObjectGUI\$ctrl, $help, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilObjectGUI\$user, getCurrentTaxonomy(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilObject2GUI\setTabs().

700  {
701  $tpl = $this->tpl;
702  $ilCtrl = $this->ctrl;
703  $lng = $this->lng;
704  $ilToolbar = $this->toolbar;
705  $ilHelp = $this->help;
706 
707  if (!isset($_POST["id"])) {
708  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
709  $ilCtrl->redirect($this, "listNodes");
710  }
711 
712  $this->setTabs("list_items");
713  $ilHelp->setSubScreenId("move_items");
714 
715  $ilToolbar->addButton(
716  $lng->txt("cancel"),
717  $ilCtrl->getLinkTarget($this, "listNodes")
718  );
719 
720  ilUtil::sendInfo($lng->txt("tax_please_select_target"));
721 
722  if (is_array($_POST["id"])) {
723  $ilCtrl->setParameter($this, "move_ids", implode(",", $_POST["id"]));
724 
726  $tpl = $this->tpl;
727  $ilCtrl = $this->ctrl;
728  $lng = $this->lng;
729 
730  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
731  $tax_exp = new ilTaxonomyExplorerGUI(
732  $this,
733  "moveItems",
734  $this->getCurrentTaxonomy()->getId(),
735  "ilobjtaxonomygui",
736  "pasteItems"
737  );
738  if (!$tax_exp->handleCommand()) {
739  //$tpl->setLeftNavContent($tax_exp->getHTML());
740  $tpl->setContent($tax_exp->getHTML() . " ");
741  }
742  }
743  }
Taxonomy explorer GUI class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setTabs()
create tabs (repository/workspace switch)
getCurrentTaxonomy()
Get current taxonomy.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ pasteItems()

ilObjTaxonomyGUI::pasteItems ( )

Paste items (move operation)

Definition at line 748 of file class.ilObjTaxonomyGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObject2GUI\$parent_id, ilObjectGUI\$tree, ilTaxonomyNode\fixOrderNumbers(), getCurrentTaxonomy(), and ilUtil\sendFailure().

749  {
750  $lng = $this->lng;
751  $ilCtrl = $this->ctrl;
752  //var_dump($_GET);
753  //var_dump($_POST);
754  if ($_GET["move_ids"] != "") {
755  $move_ids = explode(",", $_GET["move_ids"]);
756  $tax = $this->getCurrentTaxonomy();
757  $tree = $tax->getTree();
758 
759  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
760  $target_node = new ilTaxonomyNode((int) $_GET["tax_node"]);
761  foreach ($move_ids as $m_id) {
762  // cross check taxonomy
763  $node = new ilTaxonomyNode((int) $m_id);
764  if ($node->getTaxonomyId() == $tax->getId() &&
765  ($target_node->getTaxonomyId() == $tax->getId() ||
766  $target_node->getId() == $tree->readRootId())) {
767  // check if target is not within the selected nodes
768  if ($tree->isGrandChild((int) $m_id, $target_node->getId()) ||
769  $m_id == $target_node->getId()) {
770  ilUtil::sendFailure($lng->txt("tax_target_within_nodes"), true);
771  $this->ctrl->redirect($this, "listNodes");
772  }
773 
774  // if target is not current place, move
775  $parent_id = $tree->getParentId((int) $m_id);
776  if ($parent_id != $target_node->getId()) {
777  $tree->moveTree((int) $m_id, $target_node->getId());
778  ilTaxonomyNode::fixOrderNumbers($tax->getId(), $target_node->getId());
780  }
781  }
782  }
783  }
784 
785  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
786  $ilCtrl->redirect($this, "listNodes");
787  }
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getCurrentTaxonomy()
Get current taxonomy.
static fixOrderNumbers($a_tax_id, $a_parent_id)
Fix order numbers.
+ Here is the call graph for this function:

◆ save()

ilObjTaxonomyGUI::save ( )

Save taxonomy.

Parameters

Definition at line 330 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, and getAssignedObject().

331  {
332  $ilCtrl = $this->ctrl;
333 
334  if ($this->getAssignedObject() > 0) {
335  $_REQUEST["new_type"] = "tax";
336  }
337 
338  parent::saveObject();
339  }
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ saveAssignedItemsSorting()

ilObjTaxonomyGUI::saveAssignedItemsSorting ( )

Save assigned items sorting.

Parameters

Definition at line 1047 of file class.ilObjTaxonomyGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, and getCurrentTaxonomyId().

1048  {
1049  $lng = $this->lng;
1050  $ilCtrl = $this->ctrl;
1051 
1052  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
1053  if (is_array($_POST["order"])) {
1054  $order = $_POST["order"];
1055  //asort($order, SORT_NUMERIC);
1056  //$cnt = 10;
1057  $tax_node = (int) $_GET["tax_node"];
1058  foreach ($order as $a_item_id => $ord_nr) {
1059  $tax_ass = new ilTaxNodeAssignment(
1060  $this->assigned_item_comp_id,
1061  $this->assigned_item_obj_id,
1062  $this->assigned_item_type,
1063  $this->getCurrentTaxonomyId()
1064  );
1065  $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
1066  //$cnt+= 10;
1067  }
1068  $tax_ass = new ilTaxNodeAssignment(
1069  $this->assigned_item_comp_id,
1070  $this->assigned_item_obj_id,
1071  $this->assigned_item_type,
1072  $this->getCurrentTaxonomyId()
1073  );
1074  $tax_ass->fixOrderNr($tax_node);
1075  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1076  }
1077  $ilCtrl->redirect($this, "listAssignedItems");
1078  }
Taxonomy node <-> item assignment.
$_GET["client_id"]
getCurrentTaxonomyId()
Get current taxonomy id.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSorting()

ilObjTaxonomyGUI::saveSorting ( )

Save settings and sorting.

Parameters

Definition at line 665 of file class.ilObjTaxonomyGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilTaxonomyNode\fixOrderNumbers(), getCurrentTaxonomyId(), ilUtil\stripSlashes(), ilTaxonomyNode\writeOrderNr(), and ilTaxonomyNode\writeTitle().

666  {
667  $ilCtrl = $this->ctrl;
668  $lng = $this->lng;
669 
670  // save sorting
671  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
672  if (is_array($_POST["order"])) {
673  // asort($_POST["order"]);
674  // $cnt = 10;
675  foreach ($_POST["order"] as $k => $v) {
677  }
678  ilTaxonomyNode::fixOrderNumbers($this->getCurrentTaxonomyId(), (int) $_GET["tax_node"]);
679  }
680 
681  // save titles
682  if (is_array($_POST["title"])) {
683  foreach ($_POST["title"] as $k => $v) {
685  (int) $k,
687  );
688  }
689  }
690 
691 
692  ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
693  $ilCtrl->redirect($this, "listNodes");
694  }
static writeTitle($a_node_id, $a_title)
Write title.
$_GET["client_id"]
getCurrentTaxonomyId()
Get current taxonomy id.
static writeOrderNr($a_node_id, $a_order_nr)
Write order nr.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
static fixOrderNumbers($a_tax_id, $a_parent_id)
Fix order numbers.
+ Here is the call graph for this function:

◆ saveTaxNode()

ilObjTaxonomyGUI::saveTaxNode ( )

Save tax node form.

Definition at line 515 of file class.ilObjTaxonomyGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilTaxonomyNode\fixOrderNumbers(), getCurrentTaxonomy(), ilTaxonomyNode\getNextOrderNr(), initTaxNodeForm(), ilTaxonomyNode\putInTree(), and ilObjTaxonomy\SORT_MANUAL.

516  {
517  $tpl = $this->tpl;
518  $lng = $this->lng;
519  $ilCtrl = $this->ctrl;
520 
521  $this->initTaxNodeForm("create");
522  if ($this->form->checkInput()) {
523  $tax = $this->getCurrentTaxonomy();
524 
525  // create node
526  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
527  $node = new ilTaxonomyNode();
528  $node->setTitle($this->form->getInput("title"));
529 
530  $tax = $this->getCurrentTaxonomy();
531  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) {
532  $order_nr = $this->form->getInput("order_nr");
533  }
534  if ($order_nr === "") {
535  $order_nr = ilTaxonomyNode::getNextOrderNr($tax->getId(), (int) $_GET["tax_node"]);
536  }
537  //echo $order_nr; exit;
538  $node->setOrderNr($order_nr);
539  $node->setTaxonomyId($tax->getId());
540  $node->create();
541 
542  // put in tree
543  ilTaxonomyNode::putInTree($tax->getId(), $node, (int) $_GET["tax_node"]);
544 
545  ilTaxonomyNode::fixOrderNumbers($tax->getId(), (int) $_GET["tax_node"]);
546 
547  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
548  $ilCtrl->redirect($this, "listNodes");
549  } else {
550  $this->form->setValuesByPost();
551  $tpl->setContent($this->form->getHtml());
552  }
553  }
static getNextOrderNr($a_tax_id, $a_parent_id)
Put this node into the taxonomy tree.
$_GET["client_id"]
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.
initTaxNodeForm($a_mode="edit")
Init tax node form.
getCurrentTaxonomy()
Get current taxonomy.
static fixOrderNumbers($a_tax_id, $a_parent_id)
Fix order numbers.
+ Here is the call graph for this function:

◆ setAssignedObject()

ilObjTaxonomyGUI::setAssignedObject (   $a_val)

Set assigned object.

Parameters
int$a_valobject id

Definition at line 73 of file class.ilObjTaxonomyGUI.php.

74  {
75  $this->assigned_object_id = $a_val;
76  }

◆ setListInfo()

ilObjTaxonomyGUI::setListInfo (   $a_val)

Set list info.

Parameters
string$a_val

Definition at line 113 of file class.ilObjTaxonomyGUI.php.

114  {
115  $this->list_info = trim($a_val);
116  }

◆ setMultiple()

ilObjTaxonomyGUI::setMultiple (   $a_val)

Set multiple.

Parameters
bool$a_valmultiple

Definition at line 93 of file class.ilObjTaxonomyGUI.php.

References multiple().

94  {
95  $this->multiple = $a_val;
96  }
multiple()
Definition: multiple.php:5
+ Here is the call graph for this function:

◆ setTabs()

ilObjTaxonomyGUI::setTabs (   $a_id = "")

Set tabs.

Parameters
$a_idstring tab id to be activated

Definition at line 870 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, $help, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilObject\_lookupDescription(), ilObject\_lookupTitle(), getCurrentTaxonomyId(), and ilUtil\getImagePath().

871  {
872  $ilTabs = $this->tabs;
873  $ilCtrl = $this->ctrl;
874  $tpl = $this->tpl;
875  $lng = $this->lng;
876  $ilHelp = $this->help;
877 
878  $ilTabs->clearTargets();
879 
880  $ilHelp->setScreenIdComponent("tax");
881 
882  $tpl->setTitle(ilObject::_lookupTitle($this->getCurrentTaxonomyId()));
883  $tpl->setDescription(ilObject::_lookupDescription($this->getCurrentTaxonomyId()));
884  $tpl->setTitleIcon(ilUtil::getImagePath("icon_tax.svg"));
885 
886  $ilTabs->setBackTarget(
887  $lng->txt("back"),
888  $ilCtrl->getLinkTarget($this, "listTaxonomies")
889  );
890 
891  $ilTabs->addTab(
892  "list_items",
893  $lng->txt("tax_nodes"),
894  $ilCtrl->getLinkTarget($this, "listNodes")
895  );
896  if ($this->assigned_item_sorting) {
897  $ilTabs->addTab(
898  "ass_items",
899  $lng->txt("tax_assigned_items"),
900  $ilCtrl->getLinkTarget($this, "listAssignedItems")
901  );
902  }
903  $ilTabs->addTab(
904  "settings",
905  $lng->txt("settings"),
906  $ilCtrl->getLinkTarget($this, "editSettings")
907  );
908 
909  $ilTabs->activateTab($a_id);
910  }
static _lookupTitle($a_id)
lookup object title
getCurrentTaxonomyId()
Get current taxonomy id.
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
+ Here is the call graph for this function:

◆ showTree()

ilObjTaxonomyGUI::showTree (   $a_ass_items = false)

Show Editing Tree.

Parameters
bool$a_ass_items
Exceptions
ilCtrlException

Definition at line 368 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, $DIC, getCurrentTaxonomy(), ilExplorerBaseGUI\handleCommand(), ilTaxonomyGSToolProvider\SHOW_TAX_TREE, ilTaxonomyGSToolProvider\TAX_ID, ilTaxonomyGSToolProvider\TAX_TREE_CMD, ilTaxonomyGSToolProvider\TAX_TREE_GUI_PATH, and ilTaxonomyGSToolProvider\TAX_TREE_PARENT_CMD.

Referenced by listAssignedItems(), and listNodes().

369  {
370  global $DIC;
371 
372  $tax = $this->getCurrentTaxonomy();
373  $ctrl = $this->ctrl;
374 
375  $cmd = $a_ass_items
376  ? "listAssignedItems"
377  : "listNodes";
378 
379  $DIC->globalScreen()->tool()->context()->current()
380  ->addAdditionalData(
382  true
383  );
384  $DIC->globalScreen()->tool()->context()->current()
385  ->addAdditionalData(
387  $ctrl->getCurrentClassPath()
388  );
389  $DIC->globalScreen()->tool()->context()->current()
390  ->addAdditionalData(
392  $tax->getId()
393  );
394  $DIC->globalScreen()->tool()->context()->current()
395  ->addAdditionalData(
397  $cmd
398  );
399  $DIC->globalScreen()->tool()->context()->current()
400  ->addAdditionalData(
402  "showTree"
403  );
404 
405  $tax_exp = new ilTaxonomyExplorerGUI(
406  $this,
407  "showTree",
408  $tax->getId(),
409  "ilobjtaxonomygui",
410  $cmd
411  );
412  $tax_exp->handleCommand();
413  return;
414  }
Taxonomy explorer GUI class.
handleCommand()
Handle explorer internal command.
global $DIC
Definition: goto.php:24
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSettings()

ilObjTaxonomyGUI::updateSettings ( )

Update taxonomy settings.

Definition at line 982 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, getCurrentTaxonomy(), and initSettingsForm().

983  {
984  $tpl = $this->tpl;
985  $lng = $this->lng;
986  $ilCtrl = $this->ctrl;
987 
988  $form = $this->initSettingsForm();
989  if ($form->checkInput()) {
990  $tax = $this->getCurrentTaxonomy();
991  $tax->setTitle($form->getInput("title"));
992  $tax->setDescription($form->getInput("description"));
993  $tax->setSortingMode($form->getInput("sorting"));
994  $tax->setItemSorting($form->getInput("item_sorting"));
995  $tax->update();
996 
997  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
998  $ilCtrl->redirect($this, "editSettings");
999  } else {
1000  $form->setValuesByPost();
1001  $tpl->setContent($form->getHtml());
1002  }
1003  }
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:

◆ updateTaxNode()

ilObjTaxonomyGUI::updateTaxNode ( )

Update tax node.

Definition at line 559 of file class.ilObjTaxonomyGUI.php.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, getCurrentTaxonomy(), initTaxNodeForm(), ilUtil\sendInfo(), and ilObjTaxonomy\SORT_MANUAL.

560  {
561  $lng = $this->lng;
562  $ilCtrl = $this->ctrl;
563  $tpl = $this->tpl;
564 
565  $this->initTaxNodeForm("edit");
566  if ($this->form->checkInput()) {
567  // create node
568  $node = new ilTaxonomyNode($_GET["tax_node"]);
569  $node->setTitle($this->form->getInput("title"));
570 
571  $tax = $this->getCurrentTaxonomy();
572  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) {
573  $node->setOrderNr($this->form->getInput("order_nr"));
574  }
575 
576  $node->update();
577 
578  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
579  $ilCtrl->redirect($this, "");
580  } else {
581  $this->form->setValuesByPost();
582  $tpl->setContent($this->form->getHtml());
583  }
584  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initTaxNodeForm($a_mode="edit")
Init tax node form.
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:

Field Documentation

◆ $assigned_item_sorting

ilObjTaxonomyGUI::$assigned_item_sorting = false
protected

Definition at line 31 of file class.ilObjTaxonomyGUI.php.

◆ $help

ilObjTaxonomyGUI::$help
protected

Definition at line 28 of file class.ilObjTaxonomyGUI.php.

Referenced by createTaxNode(), deleteItems(), moveItems(), and setTabs().

◆ $multiple

ilObjTaxonomyGUI::$multiple = false
protected

Definition at line 30 of file class.ilObjTaxonomyGUI.php.

Referenced by getMultiple().

◆ $tabs

ilObjTaxonomyGUI::$tabs
protected

Definition at line 23 of file class.ilObjTaxonomyGUI.php.

Referenced by deleteItems(), executeCommand(), and setTabs().


The documentation for this class was generated from the following file: