ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjTaxonomyGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ()
 
 getType ()
 
 setAssignedObject (int $a_val)
 
 getAssignedObject ()
 
 setMultiple (bool $a_val)
 Set multiple. More...
 
 getMultiple ()
 
 setModifier (?\ILIAS\Taxonomy\TaxonomyModifierGUI $modifier)
 
 setListInfo (string $a_val)
 
 getListInfo ()
 
 activateAssignedItemSorting (ilTaxAssignedItemInfo $a_item_info_obj, string $a_component_id, int $a_obj_id, string $a_item_type)
 Activate sorting mode of assigned objects. More...
 
 executeCommand ()
 Execute command. More...
 
 editAOTaxonomySettings ()
 
 getCurrentTaxonomyId ()
 
 getCurrentTaxonomy ()
 
 listNodes ()
 List items. More...
 
 createAssignedTaxonomy ()
 Create assigned taxonomy. More...
 
 cancel ()
 Cancel creation. More...
 
 save ()
 
 showTree (bool $a_ass_items=false)
 
 createTaxNode ()
 Create tax node. More...
 
 initTaxNodeForm (string $a_mode="edit")
 
 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...
 
 editSettings ()
 Edit settings. More...
 
 initSettingsForm ()
 
 updateSettings ()
 Update taxonomy settings. More...
 
 listAssignedItems ()
 List assigned items. More...
 
 saveAssignedItemsSorting ()
 Save assigned items sorting. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 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 (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 initCreationForms (string $a_new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 afterSave (ilObject $a_new_object)
 After saving,. More...
 
 getSettingsBackUrl ()
 
 returnToSettingsParent ()
 
 setTabs ($a_id="")
 
- 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 ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ILIAS Taxonomy Settings ModifierGUIInterface $modifier = null
 
ILIAS DI UIServices $ui
 
ILIAS Taxonomy InternalGUIService $gui
 
ILIAS Taxonomy InternalDomainService $domain
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
bool $multiple = false
 
bool $assigned_item_sorting = false
 
int $assigned_object_id = 0
 
ilTaxAssignedItemInfo $assigned_item_info_obj
 
string $assigned_item_comp_id = ""
 
int $assigned_item_obj_id = 0
 
string $assigned_item_type = ""
 
string $list_info = ''
 
int $current_tax_node = 0
 
int $requested_tax_id = 0
 
string $requested_move_ids = ""
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- 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 ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Taxonomy GUI class

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilObjTaxonomyGUI: ilObjTaxonomyGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilObjTaxonomyGUI::__construct ( )

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

References $DIC, $params, $service, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilObject2GUI\OBJECT_ID, ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

48  {
49  global $DIC;
50 
51  $service = $DIC->taxonomy()->internal();
52  $this->gui = $gui = $service->gui();
53  $this->domain = $domain = $service->domain();
54 
55  $this->ctrl = $gui->ctrl();
56  $this->tabs = $gui->tabs();
57  $this->toolbar = $gui->toolbar();
58  $this->tpl = $gui->ui()->mainTemplate();
59  $this->help = $gui->help();
60  // @todo introduce request wrapper
61  $this->request = $gui->http()->request();
62 
63  $this->lng = $domain->lng();
64  $this->user = $domain->user();
65  $this->ui = $gui->ui();
66 
67 
69 
70  $this->ctrl->saveParameter($this, "tax_node");
71  $this->ctrl->saveParameter($this, "tax_id");
72 
73  $this->lng->loadLanguageModule("tax");
74 
75  // @todo introduce request wrapper
76  $params = $this->request->getQueryParams();
77  $this->current_tax_node = (int) ($params["tax_node"] ?? null);
78  $this->requested_tax_id = (int) ($params["tax_id"] ?? null);
79  $this->requested_move_ids = (string) ($params["move_ids"] ?? "");
80  }
ILIAS Taxonomy InternalDomainService $domain
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
ILIAS Taxonomy InternalGUIService $gui
$service
Definition: ltiservices.php:43
+ Here is the call graph for this function:

Member Function Documentation

◆ activateAssignedItemSorting()

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

Activate sorting mode of assigned objects.

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

137  : void {
138  $this->assigned_item_sorting = true;
139  $this->assigned_item_info_obj = $a_item_info_obj;
140  $this->assigned_item_comp_id = $a_component_id;
141  $this->assigned_item_obj_id = $a_obj_id;
142  $this->assigned_item_type = $a_item_type;
143  }

◆ afterSave()

ilObjTaxonomyGUI::afterSave ( ilObject  $a_new_object)
protected

After saving,.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, getAssignedObject(), ilObject\getId(), ilObjTaxonomy\saveUsage(), and ilLanguage\txt().

285  : void
286  {
287  $ilCtrl = $this->ctrl;
288  $lng = $this->lng;
289 
290  if ($this->getAssignedObject() > 0) {
292  $a_new_object->getId(),
293  $this->getAssignedObject()
294  );
295  $ilCtrl->setParameter($this, "tax_id", $a_new_object->getId());
296  $this->tpl->setOnScreenMessage('success', $lng->txt("tax_added"), true);
297  $ilCtrl->redirect($this, "editSettings");
298  }
299  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static saveUsage(int $a_tax_id, int $a_obj_id)
+ Here is the call graph for this function:

◆ cancel()

ilObjTaxonomyGUI::cancel ( )

Cancel creation.

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

References ilObject2GUI\$ctrl, getAssignedObject(), getSettingsBackUrl(), and ilCtrl\redirectToURL().

265  : void
266  {
267  $ilCtrl = $this->ctrl;
268  if ($this->getAssignedObject() > 0) {
269  $ilCtrl->redirectToURL($this->getSettingsBackUrl());
270  }
271  parent::cancel();
272  }
redirectToURL(string $target_url)
+ Here is the call graph for this function:

◆ checkPermissionBool()

ilObjTaxonomyGUI::checkPermissionBool ( string  $perm,
string  $cmd = "",
string  $type = "",
?int  $node_id = null 
)
protected

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

References ilObject2GUI\$node_id, ilObject2GUI\$type, and getAssignedObject().

254  : bool {
255  if ($this->getAssignedObject() > 0) {
256  return true;
257  } else {
258  return parent::checkPermissionBool($perm, $cmd, $type, $node_id);
259  }
260  }
+ Here is the call graph for this function:

◆ confirmDeleteTaxonomy()

ilObjTaxonomyGUI::confirmDeleteTaxonomy ( )

Confirm taxonomy deletion.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$tpl, getCurrentTaxonomy(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

669  : void
670  {
671  $ilCtrl = $this->ctrl;
672  $tpl = $this->tpl;
673  $lng = $this->lng;
674 
675  $tax = $this->getCurrentTaxonomy();
676 
677  $cgui = new ilConfirmationGUI();
678  $cgui->setFormAction($ilCtrl->getFormAction($this));
679  $cgui->setHeaderText($lng->txt("tax_confirm_deletion"));
680  $cgui->setCancel($lng->txt("cancel"), "returnToSettingsParent");
681  $cgui->setConfirm($lng->txt("delete"), "deleteTaxonomy");
682 
683  $cgui->addItem("id[]", 0, $tax->getTitle());
684 
685  $tpl->setContent($cgui->getHTML());
686  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ confirmedDelete()

ilObjTaxonomyGUI::confirmedDelete ( )

Delete taxonomy nodes.

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

References ilObject2GUI\$ctrl, ilObjectGUI\$id, ilObject2\delete(), ilTaxonomyNode\fixOrderNumbers(), ilObjTaxonomy\getTree(), and ILIAS\Repository\lng().

524  : void
525  {
526  $ilCtrl = $this->ctrl;
527  $body = $this->request->getParsedBody();
528 
529  // delete all selected objects
530  foreach ($body["id"] as $id) {
531  $node = new ilTaxonomyNode($id);
532  $tax = new ilObjTaxonomy($node->getTaxonomyId());
533  $tax_tree = $tax->getTree();
534  $node_data = $tax_tree->getNodeData($id);
535  if (is_object($node)) {
536  $node->delete();
537  }
538  if ($tax_tree->isInTree($id)) {
539  $tax_tree->deleteTree($node_data);
540  }
541  ilTaxonomyNode::fixOrderNumbers($node->getTaxonomyId(), $node_data["parent"]);
542  }
543 
544  // feedback
545  $this->tpl->setOnScreenMessage('info', $this->lng->txt("info_deleted"), true);
546 
547  $ilCtrl->redirect($this, "listNodes");
548  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static fixOrderNumbers(int $a_tax_id, int $a_parent_id)
+ Here is the call graph for this function:

◆ createAssignedTaxonomy()

ilObjTaxonomyGUI::createAssignedTaxonomy ( )

Create assigned taxonomy.

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

References ilObject2GUI\create().

244  : void
245  {
246  $this->create();
247  }
+ Here is the call graph for this function:

◆ createTaxNode()

ilObjTaxonomyGUI::createTaxNode ( )

Create tax node.

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

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

351  : void
352  {
353  $tpl = $this->tpl;
354  $ilHelp = $this->help;
355 
356  $this->setTabs("list_items");
357  $ilHelp->setSubScreenId("create_node");
358 
359  $form = $this->initTaxNodeForm("create");
360  $tpl->setContent($form->getHTML());
361  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
setTabs()
create tabs (repository/workspace switch)
initTaxNodeForm(string $a_mode="edit")
+ Here is the call graph for this function:

◆ deleteItems()

ilObjTaxonomyGUI::deleteItems ( )

Confirm deletion screen for items.

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

References ilObject2GUI\$ctrl, $help, ilObjectGUI\$id, ilObject2GUI\$lng, ilObject2GUI\$tpl, ilTaxonomyNode\_lookupTitle(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), ilObject2GUI\setTabs(), and ilLanguage\txt().

483  : void
484  {
485  $lng = $this->lng;
486  $tpl = $this->tpl;
487  $ilCtrl = $this->ctrl;
488  $ilHelp = $this->help;
489  $body = $this->request->getParsedBody();
490 
491  if (!isset($body["id"])) {
492  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
493  $ilCtrl->redirect($this, "listNodes");
494  }
495 
496  $this->setTabs("list_items");
497  $ilHelp->setSubScreenId("del_items");
498 
499  // $ilTabs->clearTargets();
500 
501  $confirmation_gui = new ilConfirmationGUI();
502 
503  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
504  $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
505 
506  // Add items to delete
507  foreach ($body["id"] as $id) {
508  $confirmation_gui->addItem(
509  "id[]",
510  $id,
512  );
513  }
514 
515  $confirmation_gui->setCancel($lng->txt("cancel"), "listNodes");
516  $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
517 
518  $tpl->setContent($confirmation_gui->getHTML());
519  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
static _lookupTitle(int $a_obj_id)
ilGlobalTemplateInterface $tpl
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ deleteTaxonomy()

ilObjTaxonomyGUI::deleteTaxonomy ( )

Delete taxonomy.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, getCurrentTaxonomy(), returnToSettingsParent(), and ilLanguage\txt().

691  : void
692  {
693  $ilCtrl = $this->ctrl;
694  $lng = $this->lng;
695 
696  $tax = $this->getCurrentTaxonomy();
697  $tax->delete();
698 
699  $this->tpl->setOnScreenMessage('success', $lng->txt("tax_tax_deleted"), true);
700  $this->returnToSettingsParent();
701  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ editAOTaxonomySettings()

ilObjTaxonomyGUI::editAOTaxonomySettings ( )

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

References listTaxonomies().

172  : void
173  {
174  $this->listTaxonomies();
175  }
listTaxonomies()
List taxonomies.
+ Here is the call graph for this function:

◆ editSettings()

ilObjTaxonomyGUI::editSettings ( )

Edit settings.

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

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

791  : void
792  {
793  $tpl = $this->tpl;
794 
795  $this->setTabs("settings");
796 
797  $form = $this->initSettingsForm();
798  $tpl->setContent($form->getHTML());
799  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjTaxonomyGUI::executeCommand ( )

Execute command.

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

References ilObject2GUI\$ctrl, and ILIAS\Repository\tabs().

148  : void
149  {
150  $ilCtrl = $this->ctrl;
151  $this->tabs->activateSubTab("tax_settings");
152 
153  $cmd = $ilCtrl->getCmd("listTaxonomies");
154  $this->$cmd();
155  }
+ Here is the call graph for this function:

◆ getAssignedObject()

ilObjTaxonomyGUI::getAssignedObject ( )

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

References $assigned_object_id.

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

95  : int
96  {
98  }
+ Here is the caller graph for this function:

◆ getCurrentTaxonomy()

ilObjTaxonomyGUI::getCurrentTaxonomy ( )

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

References getCurrentTaxonomyId().

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

187  : ?ilObjTaxonomy
188  {
189  $tax_id = $this->getCurrentTaxonomyId();
190  if ($tax_id > 0) {
191  return new ilObjTaxonomy($tax_id);
192  }
193  return null;
194  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentTaxonomyId()

ilObjTaxonomyGUI::getCurrentTaxonomyId ( )

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

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

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

177  : ?int
178  {
180  $tax_id = $this->requested_tax_id;
181  if (in_array($tax_id, $tax_ids)) {
182  return $tax_id;
183  }
184  return null;
185  }
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getListInfo()

ilObjTaxonomyGUI::getListInfo ( )

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

References $list_info.

Referenced by listTaxonomies().

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

◆ getMultiple()

ilObjTaxonomyGUI::getMultiple ( )

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

References $multiple.

Referenced by listTaxonomies().

109  : bool
110  {
111  return $this->multiple;
112  }
+ Here is the caller graph for this function:

◆ getSettingsBackUrl()

ilObjTaxonomyGUI::getSettingsBackUrl ( )
protected

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

References ILIAS\Repository\ctrl().

Referenced by cancel(), returnToSettingsParent(), and setTabs().

733  : string
734  {
735  return $this->ctrl->getParentReturn($this);
736  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilObjTaxonomyGUI::getType ( )

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

82  : string
83  {
84  return "tax";
85  }

◆ initCreationForms()

ilObjTaxonomyGUI::initCreationForms ( string  $a_new_type)
protected

Init creation forms.

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

References ilObjectGUI\initCreateForm().

160  : array
161  {
162  return array(
163  self::CFORM_NEW => $this->initCreateForm("tax")
164  );
165  }
initCreateForm(string $new_type)
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjTaxonomyGUI::initSettingsForm ( )

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, getCurrentTaxonomy(), ilSelectInputGUI\setOptions(), ilTextAreaInputGUI\setValue(), ilObjTaxonomy\SORT_ALPHABETICAL, ilObjTaxonomy\SORT_MANUAL, and ilLanguage\txt().

Referenced by editSettings(), and updateSettings().

802  {
803  $lng = $this->lng;
804  $ilCtrl = $this->ctrl;
805 
806  $tax = $this->getCurrentTaxonomy();
807 
808  $form = new ilPropertyFormGUI();
809 
810  // title
811  $ti = new ilTextInputGUI($lng->txt("title"), "title");
812  $ti->setMaxLength(200);
813 
814  $form->addItem($ti);
815  $ti->setValue($tax->getTitle());
816 
817  // description
818  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
819  //$ta->setCols();
820  //$ta->setRows();
821  $form->addItem($ta);
822  $ta->setValue($tax->getDescription());
823 
824  // sorting
825  $options = array(
826  ilObjTaxonomy::SORT_ALPHABETICAL => $lng->txt("tax_alphabetical"),
827  ilObjTaxonomy::SORT_MANUAL => $lng->txt("tax_manual")
828  );
829  $si = new ilSelectInputGUI($lng->txt("tax_node_sorting"), "sorting");
830 
831  $si->setOptions($options);
832  $form->addItem($si);
833  $si->setValue($tax->getSortingMode());
834 
835  // assigned item sorting
836  if ($this->assigned_item_sorting) {
837  $cb = new ilCheckboxInputGUI($lng->txt("tax_item_sorting"), "item_sorting");
838  $cb->setChecked($tax->getItemSorting());
839  $form->addItem($cb);
840  }
841 
842  $form->addCommandButton("updateSettings", $lng->txt("save"));
843 
844  $form->setTitle($lng->txt("settings"));
845  $form->setFormAction($ilCtrl->getFormAction($this));
846 
847  return $form;
848  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setOptions(array $a_options)
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTaxNodeForm()

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

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, getCurrentTaxonomy(), ILIAS\Repository\lng(), ilObjTaxonomy\SORT_MANUAL, and ilLanguage\txt().

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

365  {
366  $lng = $this->lng;
367  $ilCtrl = $this->ctrl;
368 
369  $form = new ilPropertyFormGUI();
370 
371  // title
372  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
373  $form->addItem($ti);
374 
375  // order nr
376  $tax = $this->getCurrentTaxonomy();
377  $or = null;
378  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) {
379  $or = new ilTextInputGUI($this->lng->txt("tax_order_nr"), "order_nr");
380  $or->setMaxLength(5);
381  $or->setSize(5);
382  $form->addItem($or);
383  }
384 
385  if ($a_mode == "edit") {
386  $node = new ilTaxonomyNode($this->current_tax_node);
387  $ti->setValue($node->getTitle());
388  if (is_object($or)) {
389  $or->setValue($node->getOrderNr());
390  }
391  }
392 
393  // save and cancel commands
394  if ($a_mode == "create") {
395  $form->addCommandButton("saveTaxNode", $lng->txt("save"));
396  $form->addCommandButton("listNodes", $lng->txt("cancel"));
397  $form->setTitle($lng->txt("tax_new_tax_node"));
398  } else {
399  $form->addCommandButton("updateTaxNode", $lng->txt("save"));
400  $form->addCommandButton("listNodes", $lng->txt("cancel"));
401  $form->setTitle($lng->txt("tax_edit_tax_node"));
402  }
403 
404  $form->setFormAction($ilCtrl->getFormAction($this));
405 
406  return $form;
407  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listAssignedItems()

ilObjTaxonomyGUI::listAssignedItems ( )

List assigned items.

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

References ilObject2GUI\$tpl, getCurrentTaxonomy(), ilGlobalTemplateInterface\setContent(), ilObject2GUI\setTabs(), and showTree().

879  : void
880  {
881  $tpl = $this->tpl;
882 
883  $this->setTabs("ass_items");
884 
885  // show tree
886  $this->showTree(true);
887 
888  // list assigned items
889  $table = new ilTaxAssignedItemsTableGUI(
890  $this,
891  "listAssignedItems",
892  $this->current_tax_node,
893  $this->getCurrentTaxonomy(),
894  $this->assigned_item_comp_id,
895  $this->assigned_item_obj_id,
896  $this->assigned_item_type,
897  $this->assigned_item_info_obj
898  );
899 
900  $tpl->setContent($table->getHTML());
901  }
showTree(bool $a_ass_items=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ listNodes()

ilObjTaxonomyGUI::listNodes ( )

List items.

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

References ilObject2GUI\$ctrl, $current_tax_node, ilObject2GUI\$lng, ilObject2GUI\$toolbar, ilObject2GUI\$tpl, ilObjectGUI\$tree, getCurrentTaxonomy(), ilTree\readRootId(), ilGlobalTemplateInterface\setContent(), ilTable2GUI\setOpenFormTag(), ilObject2GUI\setTabs(), showTree(), and ilLanguage\txt().

199  : void
200  {
201  $tpl = $this->tpl;
202  $ilToolbar = $this->toolbar;
203  $lng = $this->lng;
204  $ilCtrl = $this->ctrl;
205 
206  $tax = $this->getCurrentTaxonomy();
207 
208  $this->setTabs("list_items");
209 
210  // show toolbar
211  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
212  $ilToolbar->addFormButton($lng->txt("tax_create_node"), "createTaxNode");
213 
214  $ilToolbar->setCloseFormTag(false);
215 
216  // show tree
217  $this->showTree();
218 
219  $tax_node = $this->current_tax_node;
220  if ($tax_node === 0) {
221  $tax = $this->getCurrentTaxonomy();
222  if ($tax) {
223  $tree = $tax->getTree();
224  $tax_node = $tree->readRootId();
225  }
226  }
227 
228  // show subitems
229  $table = new ilTaxonomyTableGUI(
230  $this,
231  "listNodes",
232  $tax->getTree(),
233  $tax_node,
234  $this->getCurrentTaxonomy()
235  );
236  $table->setOpenFormTag(false);
237 
238  $tpl->setContent($table->getHTML());
239  }
showTree(bool $a_ass_items=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilToolbarGUI $toolbar
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
setTabs()
create tabs (repository/workspace switch)
setOpenFormTag(bool $a_val)
+ Here is the call graph for this function:

◆ listTaxonomies()

ilObjTaxonomyGUI::listTaxonomies ( )

List taxonomies.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$toolbar, ilObject2GUI\$tpl, getAssignedObject(), getListInfo(), getMultiple(), ilObjTaxonomy\getUsageOfObject(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

Referenced by editAOTaxonomySettings().

706  : void
707  {
708  $tpl = $this->tpl;
709  $ilToolbar = $this->toolbar;
710  $lng = $this->lng;
711  $ilCtrl = $this->ctrl;
712 
714  if (count($tax_ids) == 0 || $this->getMultiple()) {
715  $ilToolbar->addButton(
716  $lng->txt("tax_add_taxonomy"),
717  $ilCtrl->getLinkTarget($this, "createAssignedTaxonomy")
718  );
719  } else {
720  $this->tpl->setOnScreenMessage('info', $lng->txt("tax_max_one_tax"));
721  }
722 
723  $tab = new ilTaxonomyListTableGUI(
724  $this,
725  "listTaxonomies",
726  $this->getAssignedObject(),
727  $this->getListInfo()
728  );
729 
730  $tpl->setContent($tab->getHTML());
731  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
ilToolbarGUI $toolbar
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveItems()

ilObjTaxonomyGUI::moveItems ( )

Move items.

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

References ilObject2GUI\$ctrl, $help, ilObject2GUI\$lng, ilObject2GUI\$toolbar, ilObject2GUI\$tpl, getCurrentTaxonomy(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), ilObject2GUI\setTabs(), and ilLanguage\txt().

583  : void
584  {
585  $ilCtrl = $this->ctrl;
586  $lng = $this->lng;
587  $ilToolbar = $this->toolbar;
588  $ilHelp = $this->help;
589  $body = $this->request->getParsedBody();
590 
591  if (!isset($body["id"])) {
592  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
593  $ilCtrl->redirect($this, "listNodes");
594  }
595 
596  $this->setTabs("list_items");
597  $ilHelp->setSubScreenId("move_items");
598 
599  $ilToolbar->addButton(
600  $lng->txt("cancel"),
601  $ilCtrl->getLinkTarget($this, "listNodes")
602  );
603 
604  $this->tpl->setOnScreenMessage('info', $lng->txt("tax_please_select_target"));
605 
606  if (is_array($body["id"])) {
607  $ilCtrl->setParameter($this, "move_ids", implode(",", $body["id"]));
608 
609  $tpl = $this->tpl;
610 
611  $tax_exp = new ilTaxonomyExplorerGUI(
612  $this,
613  "moveItems",
614  $this->getCurrentTaxonomy()->getId(),
615  "ilobjtaxonomygui",
616  "pasteItems"
617  );
618  if (!$tax_exp->handleCommand()) {
619  //$tpl->setLeftNavContent($tax_exp->getHTML());
620  $tpl->setContent($tax_exp->getHTML() . " ");
621  }
622  }
623  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilToolbarGUI $toolbar
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ pasteItems()

ilObjTaxonomyGUI::pasteItems ( )

Paste items (move operation)

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$parent_id, ilObjectGUI\$tree, ILIAS\Repository\ctrl(), ilTaxonomyNode\fixOrderNumbers(), getCurrentTaxonomy(), ilTree\getParentId(), ilTree\isGrandChild(), ilTree\moveTree(), ilTree\readRootId(), and ilLanguage\txt().

628  : void
629  {
630  $lng = $this->lng;
631  $ilCtrl = $this->ctrl;
632  if ($this->requested_move_ids != "") {
633  $move_ids = explode(",", $this->requested_move_ids);
634  $tax = $this->getCurrentTaxonomy();
635  $tree = $tax->getTree();
636 
637  $target_node = new ilTaxonomyNode($this->current_tax_node);
638  foreach ($move_ids as $m_id) {
639  // cross check taxonomy
640  $node = new ilTaxonomyNode((int) $m_id);
641  if ($node->getTaxonomyId() == $tax->getId() &&
642  ($target_node->getTaxonomyId() == $tax->getId() ||
643  $target_node->getId() == $tree->readRootId())) {
644  // check if target is not within the selected nodes
645  if ($tree->isGrandChild((int) $m_id, $target_node->getId()) ||
646  $m_id == $target_node->getId()) {
647  $this->tpl->setOnScreenMessage('failure', $lng->txt("tax_target_within_nodes"), true);
648  $this->ctrl->redirect($this, "listNodes");
649  }
650 
651  // if target is not current place, move
652  $parent_id = $tree->getParentId((int) $m_id);
653  if ($parent_id != $target_node->getId()) {
654  $tree->moveTree((int) $m_id, $target_node->getId());
655  ilTaxonomyNode::fixOrderNumbers($tax->getId(), $target_node->getId());
657  }
658  }
659  }
660  }
661 
662  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
663  $ilCtrl->redirect($this, "listNodes");
664  }
moveTree(int $a_source_id, int $a_target_id, int $a_location=self::POS_LAST_NODE)
Move Tree Implementation public.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
isGrandChild(int $a_startnode_id, int $a_querynode_id)
checks if a node is in the path of an other node
getParentId(int $a_node_id)
get parent id of given node
static fixOrderNumbers(int $a_tax_id, int $a_parent_id)
+ Here is the call graph for this function:

◆ returnToSettingsParent()

ilObjTaxonomyGUI::returnToSettingsParent ( )
protected

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

References ILIAS\Repository\ctrl(), and getSettingsBackUrl().

Referenced by deleteTaxonomy().

738  : void
739  {
740  $this->ctrl->redirectToURL($this->getSettingsBackUrl());
741  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjTaxonomyGUI::save ( )

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

References getAssignedObject().

274  : void
275  {
276  if ($this->getAssignedObject() > 0) {
277  $this->requested_new_type = "tax";
278  }
279  parent::saveObject();
280  }
+ Here is the call graph for this function:

◆ saveAssignedItemsSorting()

ilObjTaxonomyGUI::saveAssignedItemsSorting ( )

Save assigned items sorting.

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

References ilObject2GUI\$ctrl, $current_tax_node, ilObject2GUI\$lng, getCurrentTaxonomyId(), and ilLanguage\txt().

906  : void
907  {
908  $lng = $this->lng;
909  $ilCtrl = $this->ctrl;
910  $body = $this->request->getParsedBody();
911 
912  if (is_array($body["order"])) {
913  $order = $body["order"];
914  $tax_node = $this->current_tax_node;
915  foreach ($order as $a_item_id => $ord_nr) {
916  $tax_ass = new ilTaxNodeAssignment(
917  $this->assigned_item_comp_id,
918  $this->assigned_item_obj_id,
919  $this->assigned_item_type,
920  (int) $this->getCurrentTaxonomyId()
921  );
922  $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
923  }
924  $tax_ass = new ilTaxNodeAssignment(
925  $this->assigned_item_comp_id,
926  $this->assigned_item_obj_id,
927  $this->assigned_item_type,
928  $this->getCurrentTaxonomyId()
929  );
930  $tax_ass->fixOrderNr($tax_node);
931  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
932  }
933  $ilCtrl->redirect($this, "listAssignedItems");
934  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ saveSorting()

ilObjTaxonomyGUI::saveSorting ( )

Save settings and sorting.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilTaxonomyNode\fixOrderNumbers(), getCurrentTaxonomyId(), ilUtil\stripSlashes(), ilLanguage\txt(), ilTaxonomyNode\writeOrderNr(), and ilTaxonomyNode\writeTitle().

553  : void
554  {
555  $ilCtrl = $this->ctrl;
556  $lng = $this->lng;
557  $body = $this->request->getParsedBody();
558 
559  // save sorting
560  if (is_array($body["order"] ?? false)) {
561  foreach ($body["order"] as $k => $v) {
563  }
564  ilTaxonomyNode::fixOrderNumbers($this->getCurrentTaxonomyId(), $this->current_tax_node);
565  }
566 
567  // save titles
568  if (is_array($body["title"] ?? false)) {
569  foreach ($body["title"] as $k => $v) {
571  (int) $k,
573  );
574  }
575  }
576  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"));
577  $ilCtrl->redirect($this, "listNodes");
578  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static writeTitle(int $a_node_id, string $a_title)
Write title.
static writeOrderNr(int $a_node_id, int $a_order_nr)
static fixOrderNumbers(int $a_tax_id, int $a_parent_id)
+ Here is the call graph for this function:

◆ saveTaxNode()

ilObjTaxonomyGUI::saveTaxNode ( )

Save tax node form.

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

References ilObject2GUI\$ctrl, $current_tax_node, ilObject2GUI\$lng, ilObject2GUI\$tpl, ilTaxonomyNode\fixOrderNumbers(), getCurrentTaxonomy(), ilTaxonomyNode\getNextOrderNr(), initTaxNodeForm(), ilTaxonomyNode\putInTree(), ilGlobalTemplateInterface\setContent(), ilObjTaxonomy\SORT_MANUAL, and ilLanguage\txt().

412  : void
413  {
414  $tpl = $this->tpl;
415  $lng = $this->lng;
416  $ilCtrl = $this->ctrl;
417 
418  $form = $this->initTaxNodeForm("create");
419  if ($form->checkInput()) {
420  // create node
421  $node = new ilTaxonomyNode();
422  $node->setTitle($form->getInput("title"));
423 
424  $tax = $this->getCurrentTaxonomy();
425  $order_nr = "";
426  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) {
427  $order_nr = $form->getInput("order_nr");
428  }
429  if ($order_nr === "") {
430  $order_nr = ilTaxonomyNode::getNextOrderNr($tax->getId(), $this->current_tax_node);
431  }
432  //echo $order_nr; exit;
433  $node->setOrderNr($order_nr);
434  $node->setTaxonomyId($tax->getId());
435  $node->create();
436 
437  // put in tree
438  ilTaxonomyNode::putInTree($tax->getId(), $node, $this->current_tax_node);
439 
441 
442  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
443  $ilCtrl->redirect($this, "listNodes");
444  } else {
445  $form->setValuesByPost();
446  $tpl->setContent($form->getHTML());
447  }
448  }
static getNextOrderNr(int $a_tax_id, int $a_parent_id)
Put this node into the taxonomy tree.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
static putInTree(int $a_tax_id, ilTaxonomyNode $a_node, int $a_parent_id=0, int $a_target_node_id=0, int $a_order_nr=0)
initTaxNodeForm(string $a_mode="edit")
static fixOrderNumbers(int $a_tax_id, int $a_parent_id)
+ Here is the call graph for this function:

◆ setAssignedObject()

ilObjTaxonomyGUI::setAssignedObject ( int  $a_val)
Parameters
int$a_valobject id

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

90  : void
91  {
92  $this->assigned_object_id = $a_val;
93  }

◆ setListInfo()

ilObjTaxonomyGUI::setListInfo ( string  $a_val)

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

119  : void
120  {
121  $this->list_info = trim($a_val);
122  }

◆ setModifier()

ilObjTaxonomyGUI::setModifier ( ?\ILIAS\Taxonomy\TaxonomyModifierGUI  $modifier)

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

References $modifier.

114  : void
115  {
116  $this->modifier = $modifier;
117  }
ILIAS Taxonomy Settings ModifierGUIInterface $modifier

◆ setMultiple()

ilObjTaxonomyGUI::setMultiple ( bool  $a_val)

Set multiple.

Parameters
bool$a_valmultiple

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

References ILIAS\UI\examples\Input\Field\File\multiple().

104  : void
105  {
106  $this->multiple = $a_val;
107  }
multiple()
description: > The example shows the behaviour of multiple File Field's inside the same Form Contain...
Definition: multiple.php:20
+ Here is the call graph for this function:

◆ setTabs()

ilObjTaxonomyGUI::setTabs (   $a_id = "")
protected

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

References ilObject2GUI\$ctrl, $help, ilObject2GUI\$lng, $tabs, ilObject2GUI\$tpl, ilObject\_lookupDescription(), ilObject\_lookupTitle(), getCurrentTaxonomyId(), ilUtil\getImagePath(), getSettingsBackUrl(), ilGlobalTemplateInterface\setDescription(), ilHelpGUI\setScreenIdComponent(), ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), and ilLanguage\txt().

746  : void
747  {
748  $ilTabs = $this->tabs;
749  $ilCtrl = $this->ctrl;
750  $tpl = $this->tpl;
751  $lng = $this->lng;
752  $ilHelp = $this->help;
753 
754  $ilTabs->clearTargets();
755 
756  $ilHelp->setScreenIdComponent("tax");
757 
760  $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_tax.svg"));
761 
762  $ilTabs->setBackTarget(
763  $lng->txt("back"),
764  $this->getSettingsBackUrl()
765  );
766 
767  $ilTabs->addTab(
768  "list_items",
769  $lng->txt("tax_nodes"),
770  $ilCtrl->getLinkTarget($this, "listNodes")
771  );
772  if ($this->assigned_item_sorting) {
773  $ilTabs->addTab(
774  "ass_items",
775  $lng->txt("tax_assigned_items"),
776  $ilCtrl->getLinkTarget($this, "listAssignedItems")
777  );
778  }
779  $ilTabs->addTab(
780  "settings",
781  $lng->txt("settings"),
782  $ilCtrl->getLinkTarget($this, "editSettings")
783  );
784 
785  $ilTabs->activateTab($a_id);
786  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
static _lookupTitle(int $obj_id)
setScreenIdComponent(string $a_comp)
ilGlobalTemplateInterface $tpl
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
static _lookupDescription(int $obj_id)
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:

◆ showTree()

ilObjTaxonomyGUI::showTree ( bool  $a_ass_items = false)

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

References ilObject2GUI\$ctrl, $DIC, ilCtrl\getCurrentClassPath(), 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().

301  : void
302  {
303  global $DIC;
304 
305  $tax = $this->getCurrentTaxonomy();
306  $ctrl = $this->ctrl;
307 
308  $cmd = $a_ass_items
309  ? "listAssignedItems"
310  : "listNodes";
311 
312  $DIC->globalScreen()->tool()->context()->current()
313  ->addAdditionalData(
315  true
316  );
317  $DIC->globalScreen()->tool()->context()->current()
318  ->addAdditionalData(
321  );
322  $DIC->globalScreen()->tool()->context()->current()
323  ->addAdditionalData(
325  $tax->getId()
326  );
327  $DIC->globalScreen()->tool()->context()->current()
328  ->addAdditionalData(
330  $cmd
331  );
332  $DIC->globalScreen()->tool()->context()->current()
333  ->addAdditionalData(
335  "showTree"
336  );
337 
338  $tax_exp = new ilTaxonomyExplorerGUI(
339  $this,
340  "showTree",
341  $tax->getId(),
342  "ilobjtaxonomygui",
343  $cmd
344  );
345  $tax_exp->handleCommand();
346  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handleCommand()
Handle explorer internal command.
global $DIC
Definition: feed.php:28
getCurrentClassPath()
+ 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 853 of file class.ilObjTaxonomyGUI.php.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$tpl, getCurrentTaxonomy(), initSettingsForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

853  : void
854  {
855  $tpl = $this->tpl;
856  $lng = $this->lng;
857  $ilCtrl = $this->ctrl;
858 
859  $form = $this->initSettingsForm();
860  if ($form->checkInput()) {
861  $tax = $this->getCurrentTaxonomy();
862  $tax->setTitle($form->getInput("title"));
863  $tax->setDescription($form->getInput("description"));
864  $tax->setSortingMode((int) $form->getInput("sorting"));
865  $tax->setItemSorting((bool) $form->getInput("item_sorting"));
866  $tax->update();
867 
868  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
869  $ilCtrl->redirect($this, "editSettings");
870  } else {
871  $form->setValuesByPost();
872  $tpl->setContent($form->getHTML());
873  }
874  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ updateTaxNode()

ilObjTaxonomyGUI::updateTaxNode ( )

Update tax node.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$tpl, getCurrentTaxonomy(), initTaxNodeForm(), ilGlobalTemplateInterface\setContent(), ilObjTaxonomy\SORT_MANUAL, and ilLanguage\txt().

453  : void
454  {
455  $lng = $this->lng;
456  $ilCtrl = $this->ctrl;
457  $tpl = $this->tpl;
458 
459  $form = $this->initTaxNodeForm("edit");
460  if ($form->checkInput()) {
461  // create node
462  $node = new ilTaxonomyNode($this->current_tax_node);
463  $node->setTitle($form->getInput("title"));
464 
465  $tax = $this->getCurrentTaxonomy();
466  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL) {
467  $node->setOrderNr($form->getInput("order_nr"));
468  }
469 
470  $node->update();
471 
472  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_obj_modified"), true);
473  $ilCtrl->redirect($this, "");
474  } else {
475  $form->setValuesByPost();
476  $tpl->setContent($form->getHTML());
477  }
478  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
initTaxNodeForm(string $a_mode="edit")
+ Here is the call graph for this function:

Field Documentation

◆ $assigned_item_comp_id

string ilObjTaxonomyGUI::$assigned_item_comp_id = ""
protected

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

◆ $assigned_item_info_obj

ilTaxAssignedItemInfo ilObjTaxonomyGUI::$assigned_item_info_obj
protected

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

◆ $assigned_item_obj_id

int ilObjTaxonomyGUI::$assigned_item_obj_id = 0
protected

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

◆ $assigned_item_sorting

bool ilObjTaxonomyGUI::$assigned_item_sorting = false
protected

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

◆ $assigned_item_type

string ilObjTaxonomyGUI::$assigned_item_type = ""
protected

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

◆ $assigned_object_id

int ilObjTaxonomyGUI::$assigned_object_id = 0
protected

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

Referenced by getAssignedObject().

◆ $current_tax_node

int ilObjTaxonomyGUI::$current_tax_node = 0
protected

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

Referenced by listNodes(), saveAssignedItemsSorting(), and saveTaxNode().

◆ $domain

ILIAS Taxonomy InternalDomainService ilObjTaxonomyGUI::$domain
protected

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

◆ $gui

ILIAS Taxonomy InternalGUIService ilObjTaxonomyGUI::$gui
protected

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

◆ $help

ilHelpGUI ilObjTaxonomyGUI::$help
protected

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

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

◆ $list_info

string ilObjTaxonomyGUI::$list_info = ''
protected

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

Referenced by getListInfo().

◆ $modifier

ILIAS Taxonomy Settings ModifierGUIInterface ilObjTaxonomyGUI::$modifier = null
protected

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

Referenced by setModifier().

◆ $multiple

bool ilObjTaxonomyGUI::$multiple = false
protected

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

Referenced by getMultiple().

◆ $requested_move_ids

string ilObjTaxonomyGUI::$requested_move_ids = ""
protected

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

◆ $requested_tax_id

int ilObjTaxonomyGUI::$requested_tax_id = 0
protected

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

Referenced by getCurrentTaxonomyId().

◆ $tabs

ilTabsGUI ilObjTaxonomyGUI::$tabs
protected

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

Referenced by setTabs().

◆ $ui

ILIAS DI UIServices ilObjTaxonomyGUI::$ui
protected

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


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