ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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 ()
 
 isVisible ()
 
 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...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 editObject ()
 edit object More...
 
 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

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 ()
 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...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 prepareOutput ()
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings ($column_gui)
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 showMountWebfolderIcon ()
 
 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...
 
 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...
 
 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)
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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

 $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
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
 
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 COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $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 26 of file class.ilObjTaxonomyGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilObject2GUI\OBJECT_ID.

27  {
28  global $ilCtrl, $lng;
29 
30  parent::__construct($a_id, ilObject2GUI::OBJECT_ID);
31 
32  $ilCtrl->saveParameter($this, "tax_node");
33  $ilCtrl->saveParameter($this, "tax_id");
34 
35  $lng->loadLanguageModule("tax");
36  }
global $ilCtrl
Definition: ilias.php:18

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 113 of file class.ilObjTaxonomyGUI.php.

114  {
115  $this->assigned_item_sorting = true;
116  $this->assigned_item_info_obj = $a_item_info_obj;
117  $this->assigned_item_comp_id = $a_component_id;
118  $this->assigned_item_obj_id = $a_obj_id;
119  $this->assigned_item_type = $a_item_type;
120  }

◆ afterSave()

ilObjTaxonomyGUI::afterSave ( ilObject  $a_new_object)
protected

After saving,.

Parameters

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

References $ilCtrl, ilObjectGUI\$lng, getAssignedObject(), ilObject\getId(), ilObjTaxonomy\saveUsage(), and ilUtil\sendSuccess().

327  {
328  global $ilCtrl, $lng;
329 
330  if ($this->getAssignedObject() > 0)
331  {
332  ilObjTaxonomy::saveUsage($a_new_object->getId(),
333  $this->getAssignedObject());
334  $ilCtrl->setParameter($this, "tax_id", $a_new_object->getId());
335  ilUtil::sendSuccess($lng->txt("tax_added"), true);
336  $ilCtrl->redirect($this, "editSettings");
337  }
338  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
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 290 of file class.ilObjTaxonomyGUI.php.

References $ilCtrl, and getAssignedObject().

291  {
292  global $ilCtrl;
293 
294  if ($this->getAssignedObject() > 0)
295  {
296  $ilCtrl->redirect($this, "listTaxonomies");
297  }
298 
299  return parent::cancel();
300  }
global $ilCtrl
Definition: ilias.php:18
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 272 of file class.ilObjTaxonomyGUI.php.

References getAssignedObject().

273  {
274  if ($this->getAssignedObject() > 0)
275  {
276  return true;
277  }
278  else
279  {
280  return parent::checkPermissionBool($a_perm, $a_cmd, $a_type, $a_node_id);
281  }
282  }
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ confirmDeleteTaxonomy()

ilObjTaxonomyGUI::confirmDeleteTaxonomy ( )

Confirm taxonomy deletion.

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

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

732  {
733  global $ilCtrl, $tpl, $lng;
734 
735  $tax = $this->getCurrentTaxonomy();
736 
737  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
738  $cgui = new ilConfirmationGUI();
739  $cgui->setFormAction($ilCtrl->getFormAction($this));
740  $cgui->setHeaderText($lng->txt("tax_confirm_deletion"));
741  $cgui->setCancel($lng->txt("cancel"), "listTaxonomies");
742  $cgui->setConfirm($lng->txt("delete"), "deleteTaxonomy");
743 
744  $cgui->addItem("id[]", $i, $tax->getTitle());
745 
746  $tpl->setContent($cgui->getHTML());
747  }
global $ilCtrl
Definition: ilias.php:18
getCurrentTaxonomy()
Get current taxonomy.
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmedDelete()

ilObjTaxonomyGUI::confirmedDelete ( )

Delete taxonomy nodes.

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

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

575  {
576  global $ilCtrl;
577 
578  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
579 
580  // delete all selected objects
581  foreach ($_POST["id"] as $id)
582  {
583  $node = new ilTaxonomyNode($id);
584  $tax = new ilObjTaxonomy($node->getTaxonomyId());
585  $tax_tree = $tax->getTree();
586  $node_data = $tax_tree->getNodeData($id);
587  if (is_object($node))
588  {
589  $node->delete();
590  }
591  if($tax_tree->isInTree($id))
592  {
593  $tax_tree->deleteTree($node_data);
594  }
595  ilTaxonomyNode::fixOrderNumbers($node->getTaxonomyId(), $node_data["parent"]);
596  }
597 
598  // feedback
599  ilUtil::sendInfo($this->lng->txt("info_deleted"),true);
600 
601  $ilCtrl->redirect($this, "listNodes");
602  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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 262 of file class.ilObjTaxonomyGUI.php.

References ilObject2GUI\create().

263  {
264  $this->create();
265  }
create()
Deleted in ilObject.
+ Here is the call graph for this function:

◆ createTaxNode()

ilObjTaxonomyGUI::createTaxNode ( )

Create tax node.

Parameters

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

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

391  {
392  global $tpl, $ilHelp;
393 
394  $this->setTabs("list_items");
395  $ilHelp->setSubScreenId("create_node");
396 
397  $this->initTaxNodeForm("create");
398  $tpl->setContent($this->form->getHTML());
399  }
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 536 of file class.ilObjTaxonomyGUI.php.

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

537  {
538  global $lng, $tpl, $ilCtrl, $ilTabs, $ilHelp;
539 
540  if(!isset($_POST["id"]))
541  {
542  ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
543  $ilCtrl->redirect($this, "listNodes");
544  }
545 
546  $this->setTabs("list_items");
547  $ilHelp->setSubScreenId("del_items");
548 
549 // $ilTabs->clearTargets();
550 
551  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
552  $confirmation_gui = new ilConfirmationGUI();
553 
554  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
555  $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
556 
557  // Add items to delete
558  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
559  foreach($_POST["id"] as $id)
560  {
561  $confirmation_gui->addItem("id[]", $id,
563  }
564 
565  $confirmation_gui->setCancel($lng->txt("cancel"), "listNodes");
566  $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
567 
568  $tpl->setContent($confirmation_gui->getHTML());
569  }
$_POST['username']
Definition: cron.php:12
static _lookupTitle($a_obj_id)
Lookup Title.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setTabs()
create tabs (repository/workspace switch)
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteTaxonomy()

ilObjTaxonomyGUI::deleteTaxonomy ( )

Delete taxonomy.

Parameters

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

References $ilCtrl, ilObjectGUI\$lng, getCurrentTaxonomy(), and ilUtil\sendSuccess().

756  {
757  global $ilCtrl, $lng;
758 
759  $tax = $this->getCurrentTaxonomy();
760  $tax->delete();
761 
762  ilUtil::sendSuccess($lng->txt("tax_tax_deleted"), true);
763  $ilCtrl->redirect($this, "listTaxonomies");
764  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:

◆ editAOTaxonomySettings()

ilObjTaxonomyGUI::editAOTaxonomySettings ( )
Parameters

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

References $ilCtrl, ilObjectGUI\$lng, and listTaxonomies().

167  {
168  global $ilToolbar, $ilCtrl, $lng;
169 
170 
171 // if (count($tax_ids) != 0 && !$this->getMultiple())
172 // {
173 // $this->listNodes();
174 // }
175 // else if ($this->getMultiple())
176 // {
177  $this->listTaxonomies();
178 // }
179 
180  // currently we support only one taxonomy, otherwise we may need to provide
181  // a list here
182 
183  }
listTaxonomies()
List taxonomies.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ editSettings()

ilObjTaxonomyGUI::editSettings ( )

Edit settings.

Parameters

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

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

835  {
836  global $tpl;
837 
838  $this->setTabs("settings");
839 
840  $form = $this->initSettingsForm();
841  $tpl->setContent($form->getHTML());
842  }
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjTaxonomyGUI::executeCommand ( )

Execute command.

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

References $cmd, $ilCtrl, and $ilUser.

127  {
128  global $ilCtrl, $ilUser, $ilTabs;
129 
130  $next_class = $ilCtrl->getNextClass();
131 
132  switch ($next_class)
133  {
134  default:
135  $cmd = $ilCtrl->getCmd("listTaxonomies");
136  $this->$cmd();
137  break;
138  }
139  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

◆ getAssignedObject()

ilObjTaxonomyGUI::getAssignedObject ( )

Get assigned object.

Returns
int object id

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

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

64  {
65  return $this->assigned_object_id;
66  }
+ Here is the caller graph for this function:

◆ getCurrentTaxonomy()

ilObjTaxonomyGUI::getCurrentTaxonomy ( )

Get current taxonomy.

Parameters

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

References getCurrentTaxonomyId().

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

210  {
211  $tax_id = $this->getCurrentTaxonomyId();
212  if ($tax_id > 0)
213  {
214  $tax = new ilObjTaxonomy($tax_id);
215  return $tax;
216  }
217 
218  return false;
219  }
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 191 of file class.ilObjTaxonomyGUI.php.

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

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

192  {
194  $tax_id = (int) $_GET["tax_id"];
195  if (in_array($tax_id, $tax_ids))
196  {
197  return $tax_id;
198  }
199  return false;
200  }
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 103 of file class.ilObjTaxonomyGUI.php.

Referenced by listTaxonomies().

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

◆ getMultiple()

ilObjTaxonomyGUI::getMultiple ( )

Get multiple.

Returns
bool multiple

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

References $multiple.

Referenced by listTaxonomies().

84  {
85  return $this->multiple;
86  }
+ 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 369 of file class.ilObjTaxonomyGUI.php.

Referenced by ilGlossaryPresentationGUI\showTaxonomy().

371  {
372 die("ilObjTaxonomyGUI::getTreeHTML is deprecated.");
373  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
374  $tax_exp = new ilTaxonomyExplorerGUI($a_class, $a_cmd, $a_tax_id,
375  $a_target_class, $a_target_cmd);
376  if (!$tax_exp->handleCommand())
377  {
378  return $tax_exp->getHTML()." ";
379  }
380  return;
381  }
Taxonomy explorer GUI class.
+ Here is the caller graph for this function:

◆ getType()

ilObjTaxonomyGUI::getType ( )

Get type.

Returns
string type

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

44  {
45  return "tax";
46  }

◆ initCreationForms()

ilObjTaxonomyGUI::initCreationForms ( )
protected

Init creation forms.

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

References ilObjectGUI\initCreateForm().

145  {
146  $forms = array();
147 
148  $forms = array(
149  self::CFORM_NEW => $this->initCreateForm("tax")
150  );
151 
152  return $forms;
153  }
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjTaxonomyGUI::initSettingsForm ( )

Init form.

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

References $ilCtrl, ilObjectGUI\$lng, $options, $si, getCurrentTaxonomy(), ilCheckboxInputGUI\setChecked(), ilTextInputGUI\setMaxLength(), ilSelectInputGUI\setOptions(), ilTextAreaInputGUI\setValue(), ilObjTaxonomy\SORT_ALPHABETICAL, and ilObjTaxonomy\SORT_MANUAL.

Referenced by editSettings(), and updateSettings().

848  {
849  global $lng, $ilCtrl;
850 
851  $tax = $this->getCurrentTaxonomy();
852 
853  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
854  $form = new ilPropertyFormGUI();
855 
856  // title
857  $ti = new ilTextInputGUI($lng->txt("title"), "title");
858  $ti->setMaxLength(200);
859  $form->addItem($ti);
860  $ti->setValue($tax->getTitle());
861 
862  // description
863  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
864  //$ta->setCols();
865  //$ta->setRows();
866  $form->addItem($ta);
867  $ta->setValue($tax->getDescription());
868 
869  // sorting
870  $options = array(
871  ilObjTaxonomy::SORT_ALPHABETICAL => $lng->txt("tax_alphabetical"),
872  ilObjTaxonomy::SORT_MANUAL => $lng->txt("tax_manual")
873  );
874  $si = new ilSelectInputGUI($lng->txt("tax_node_sorting"), "sorting");
875  $si->setOptions($options);
876  $form->addItem($si);
877  $si->setValue($tax->getSortingMode());
878 
879  // assigned item sorting
880  if ($this->assigned_item_sorting)
881  {
882  $cb = new ilCheckboxInputGUI($lng->txt("tax_item_sorting"), "item_sorting");
883  $cb->setChecked($tax->getItemSorting());
884  $form->addItem($cb);
885  }
886 
887  $form->addCommandButton("updateSettings", $lng->txt("save"));
888 
889  $form->setTitle($lng->txt("settings"));
890  $form->setFormAction($ilCtrl->getFormAction($this));
891 
892  return $form;
893  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
setValue($a_value)
Set Value.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setChecked($a_checked)
Set Checked.
if(!is_array($argv)) $options
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setOptions($a_options)
Set Options.
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 407 of file class.ilObjTaxonomyGUI.php.

References $_GET, $ilCtrl, ilObjectGUI\$lng, getCurrentTaxonomy(), ilTextInputGUI\setMaxLength(), and ilObjTaxonomy\SORT_MANUAL.

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

408  {
409  global $lng, $ilCtrl;
410 
411  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
412  $this->form = new ilPropertyFormGUI();
413 
414  // title
415  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
416  $this->form->addItem($ti);
417 
418  // order nr
419  $tax = $this->getCurrentTaxonomy();
420  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
421  {
422  $or = new ilTextInputGUI($this->lng->txt("tax_order_nr"), "order_nr");
423  $or->setMaxLength(5);
424  $or->setSize(5);
425  $this->form->addItem($or);
426  }
427 
428  if ($a_mode == "edit")
429  {
430  $node = new ilTaxonomyNode((int) $_GET["tax_node"]);
431  $ti->setValue($node->getTitle());
432  $or->setValue($node->getOrderNr());
433  }
434 
435  // save and cancel commands
436  if ($a_mode == "create")
437  {
438  $this->form->addCommandButton("saveTaxNode", $lng->txt("save"));
439  $this->form->addCommandButton("listNodes", $lng->txt("cancel"));
440  $this->form->setTitle($lng->txt("tax_new_tax_node"));
441  }
442  else
443  {
444  $this->form->addCommandButton("updateTaxNode", $lng->txt("save"));
445  $this->form->addCommandButton("listNodes", $lng->txt("cancel"));
446  $this->form->setTitle($lng->txt("tax_edit_tax_node"));
447  }
448 
449  $this->form->setFormAction($ilCtrl->getFormAction($this));
450 
451  }
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
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 928 of file class.ilObjTaxonomyGUI.php.

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

929  {
930  global $tpl, $ilToolbar, $lng, $ilCtrl;
931 
932  $tax = $this->getCurrentTaxonomy();
933 
934  $this->setTabs("ass_items");
935 
936  // show tree
937  $this->showTree(true);
938 
939  // list assigned items
940  include_once("./Services/Taxonomy/classes/class.ilTaxAssignedItemsTableGUI.php");
941  $table = new ilTaxAssignedItemsTableGUI($this, "listAssignedItems",
942  (int) $_GET["tax_node"], $this->getCurrentTaxonomy(), $this->assigned_item_comp_id,
943  $this->assigned_item_obj_id, $this->assigned_item_type, $this->assigned_item_info_obj);
944 
945  $tpl->setContent($table->getHTML());
946  }
$_GET["client_id"]
TableGUI class for taxonomy list.
global $ilCtrl
Definition: ilias.php:18
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 228 of file class.ilObjTaxonomyGUI.php.

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

229  {
230  global $tpl, $ilToolbar, $lng, $ilCtrl;
231 
232  $tax = $this->getCurrentTaxonomy();
233 
234  $this->setTabs("list_items");
235 
236  // show toolbar
237  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
238  $ilToolbar->addFormButton($lng->txt("tax_create_node"), "createTaxNode");
239 
240  $ilToolbar->setCloseFormTag(false);
241 
242 
243  // show tree
244  $this->showTree();
245 
246  // show subitems
247  include_once("./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
248  $table = new ilTaxonomyTableGUI($this, "listNodes", $tax->getTree(),
249  (int) $_GET["tax_node"], $this->getCurrentTaxonomy());
250  $table->setOpenFormTag(false);
251 
252  $tpl->setContent($table->getHTML());
253  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 772 of file class.ilObjTaxonomyGUI.php.

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

Referenced by editAOTaxonomySettings().

773  {
774  global $tpl, $ilToolbar, $lng, $ilCtrl;
775 
777  if (count($tax_ids) == 0 || $this->getMultiple())
778  {
779  $ilToolbar->addButton($lng->txt("tax_add_taxonomy"),
780  $ilCtrl->getLinkTarget($this, "createAssignedTaxonomy"));
781  }
782  else
783  {
784  ilUtil::sendInfo($lng->txt("tax_max_one_tax"));
785  }
786 
787  include_once("./Services/Taxonomy/classes/class.ilTaxonomyListTableGUI.php");
788 
789  $tab = new ilTaxonomyListTableGUI($this, "listTaxonomies", $this->getAssignedObject(),
790  $this->getListInfo());
791 
792  $tpl->setContent($tab->getHTML());
793  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
getMultiple()
Get multiple.
global $ilCtrl
Definition: ilias.php:18
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 646 of file class.ilObjTaxonomyGUI.php.

References $_POST, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, getCurrentTaxonomy(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilObject2GUI\setTabs().

647  {
648  global $tpl, $ilCtrl, $lng, $ilToolbar, $ilHelp;
649 
650  if(!isset($_POST["id"]))
651  {
652  ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
653  $ilCtrl->redirect($this, "listNodes");
654  }
655 
656  $this->setTabs("list_items");
657  $ilHelp->setSubScreenId("move_items");
658 
659  $ilToolbar->addButton($lng->txt("cancel"),
660  $ilCtrl->getLinkTarget($this, "listNodes"));
661 
662  ilUtil::sendInfo($lng->txt("tax_please_select_target"));
663 
664  if (is_array($_POST["id"]))
665  {
666  $ilCtrl->setParameter($this, "move_ids", implode($_POST["id"], ","));
667 
668  global $ilUser, $tpl, $ilCtrl, $lng;
669 
670  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
671  $tax_exp = new ilTaxonomyExplorerGUI($this, "moveItems", $this->getCurrentTaxonomy()->getId(),
672  "ilobjtaxonomygui", "pasteItems");
673  if (!$tax_exp->handleCommand())
674  {
675  //$tpl->setLeftNavContent($tax_exp->getHTML());
676  $tpl->setContent($tax_exp->getHTML()." ");
677  }
678  }
679  }
$_POST['username']
Definition: cron.php:12
Taxonomy explorer GUI class.
global $ilCtrl
Definition: ilias.php:18
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)
global $ilUser
Definition: imgupload.php:15
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:

◆ pasteItems()

ilObjTaxonomyGUI::pasteItems ( )

Paste items (move operation)

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

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

685  {
686  global $lng, $ilCtrl;
687 //var_dump($_GET);
688 //var_dump($_POST);
689  if ($_GET["move_ids"] != "")
690  {
691  $move_ids = explode(",", $_GET["move_ids"]);
692  $tax = $this->getCurrentTaxonomy();
693  $tree = $tax->getTree();
694 
695  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
696  $target_node = new ilTaxonomyNode((int) $_GET["tax_node"]);
697  foreach ($move_ids as $m_id)
698  {
699  // cross check taxonomy
700  $node = new ilTaxonomyNode((int) $m_id);
701  if ($node->getTaxonomyId() == $tax->getId() &&
702  ($target_node->getTaxonomyId() == $tax->getId() ||
703  $target_node->getId() == $tree->readRootId()))
704  {
705  // check if target is not within the selected nodes
706  if($tree->isGrandChild((int) $m_id, $target_node->getId()))
707  {
708  ilUtil::sendFailure($lng->txt("tax_target_within_nodes"), true);
709  $this->ctrl->redirect($this, "listNodes");
710  }
711 
712  // if target is not current place, move
713  $parent_id = $tree->getParentId((int) $m_id);
714  if ($parent_id != $target_node->getId())
715  {
716  $tree->moveTree((int) $m_id, $target_node->getId());
717  ilTaxonomyNode::fixOrderNumbers($tax->getId(), $target_node->getId());
719  }
720  }
721  }
722  }
723 
724  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
725  $ilCtrl->redirect($this, "listNodes");
726  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 308 of file class.ilObjTaxonomyGUI.php.

References $_REQUEST, $ilCtrl, and getAssignedObject().

309  {
310  global $ilCtrl;
311 
312  if ($this->getAssignedObject() > 0)
313  {
314  $_REQUEST["new_type"] = "tax";
315  }
316 
317  parent::saveObject();
318  }
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ saveAssignedItemsSorting()

ilObjTaxonomyGUI::saveAssignedItemsSorting ( )

Save assigned items sorting.

Parameters

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

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$lng, getCurrentTaxonomyId(), and ilUtil\sendSuccess().

955  {
956  global $lng, $ilCtrl;
957 
958  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
959  if (is_array($_POST["order"]))
960  {
961  $order = $_POST["order"];
962  //asort($order, SORT_NUMERIC);
963  //$cnt = 10;
964  $tax_node = (int) $_GET["tax_node"];
965  foreach ($order as $a_item_id => $ord_nr)
966  {
967  $tax_ass = new ilTaxNodeAssignment($this->assigned_item_comp_id,
968  $this->assigned_item_obj_id,
969  $this->assigned_item_type, $this->getCurrentTaxonomyId());
970  $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
971  //$cnt+= 10;
972  }
973  $tax_ass = new ilTaxNodeAssignment($this->assigned_item_comp_id,
974  $this->assigned_item_obj_id,
975  $this->assigned_item_type, $this->getCurrentTaxonomyId());
976  $tax_ass->fixOrderNr($tax_node);
977  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
978  }
979  $ilCtrl->redirect($this, "listAssignedItems");
980  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Taxonomy node <-> item assignment.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
getCurrentTaxonomyId()
Get current taxonomy id.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveSorting()

ilObjTaxonomyGUI::saveSorting ( )

Save settings and sorting.

Parameters

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

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

611  {
612  global $ilCtrl, $lng;
613 
614  // save sorting
615  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
616  if (is_array($_POST["order"]))
617  {
618 // asort($_POST["order"]);
619 // $cnt = 10;
620  foreach ($_POST["order"] as $k => $v)
621  {
623  ilTaxonomyNode::fixOrderNumbers($this->getCurrentTaxonomyId(), (int) $_GET["tax_node"]);
624 // $cnt+= 10;
625  }
626  }
627 
628  // save titles
629  if (is_array($_POST["title"]))
630  {
631  foreach ($_POST["title"] as $k => $v)
632  {
635  }
636  }
637 
638 
639  ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
640  $ilCtrl->redirect($this, "listNodes");
641  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static writeTitle($a_node_id, $a_title)
Write title.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
getCurrentTaxonomyId()
Get current taxonomy id.
static writeOrderNr($a_node_id, $a_order_nr)
Write order nr.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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 457 of file class.ilObjTaxonomyGUI.php.

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

458  {
459  global $tpl, $lng, $ilCtrl;
460 
461  $this->initTaxNodeForm("create");
462  if ($this->form->checkInput())
463  {
464  $tax = $this->getCurrentTaxonomy();
465 
466  // create node
467  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
468  $node = new ilTaxonomyNode();
469  $node->setTitle($this->form->getInput("title"));
470 
471  $tax = $this->getCurrentTaxonomy();
472  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
473  {
474  $order_nr = $this->form->getInput("order_nr");
475  }
476  if ($order_nr === "")
477  {
478  $order_nr = ilTaxonomyNode::getNextOrderNr($tax->getId(), (int) $_GET["tax_node"]);
479  }
480  //echo $order_nr; exit;
481  $node->setOrderNr($order_nr);
482  $node->setTaxonomyId($tax->getId());
483  $node->create();
484 
485  // put in tree
486  ilTaxonomyNode::putInTree($tax->getId(), $node, (int) $_GET["tax_node"]);
487 
488  ilTaxonomyNode::fixOrderNumbers($tax->getId(), (int) $_GET["tax_node"]);
489 
490  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
491  $ilCtrl->redirect($this, "listNodes");
492  }
493  else
494  {
495  $this->form->setValuesByPost();
496  $tpl->setContent($this->form->getHtml());
497  }
498  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getNextOrderNr($a_tax_id, $a_parent_id)
Put this node into the taxonomy tree.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
initTaxNodeForm($a_mode="edit")
Init tax node form.
static putInTree($a_tax_id, $a_node, $a_parent_id="", $a_target_node_id="", $a_order_nr=0)
Put this node into the taxonomy tree.
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 53 of file class.ilObjTaxonomyGUI.php.

54  {
55  $this->assigned_object_id = $a_val;
56  }

◆ setListInfo()

ilObjTaxonomyGUI::setListInfo (   $a_val)

Set list info.

Parameters
string$a_val

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

94  {
95  $this->list_info = trim($a_val);
96  }

◆ setMultiple()

ilObjTaxonomyGUI::setMultiple (   $a_val)

Set multiple.

Parameters
bool$a_valmultiple

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

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

◆ setTabs()

ilObjTaxonomyGUI::setTabs (   $a_id)

Set tabs.

Parameters
$a_idstring tab id to be activated

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

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject\_lookupTitle(), getCurrentTaxonomyId(), and ilUtil\getImagePath().

801  {
802  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
803 
804  $ilTabs->clearTargets();
805 
806  $ilHelp->setScreenIdComponent("tax");
807 
808  $tpl->clearHeader();
809  $tpl->setTitle(ilObject::_lookupTitle($this->getCurrentTaxonomyId()));
810  $tpl->setTitleIcon(ilUtil::getImagePath("icon_tax.svg"));
811 
812  $ilTabs->setBackTarget($lng->txt("back"),
813  $ilCtrl->getLinkTarget($this, "listTaxonomies"));
814 
815  $ilTabs->addTab("list_items", $lng->txt("tax_nodes"),
816  $ilCtrl->getLinkTarget($this, "listNodes"));
817  if ($this->assigned_item_sorting)
818  {
819  $ilTabs->addTab("ass_items", $lng->txt("tax_assigned_items"),
820  $ilCtrl->getLinkTarget($this, "listAssignedItems"));
821  }
822  $ilTabs->addTab("settings", $lng->txt("settings"),
823  $ilCtrl->getLinkTarget($this, "editSettings"));
824 
825  $ilTabs->activateTab($a_id);
826  }
static _lookupTitle($a_id)
lookup object title
getCurrentTaxonomyId()
Get current taxonomy id.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ showTree()

ilObjTaxonomyGUI::showTree (   $a_ass_items = false)

Show Editing Tree.

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

References $cmd, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, and getCurrentTaxonomy().

Referenced by listAssignedItems(), and listNodes().

344  {
345  global $ilUser, $tpl, $ilCtrl, $lng;
346 
347  $tax = $this->getCurrentTaxonomy();
348 
349  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
350  $cmd = $a_ass_items
351  ? "listAssignedItems"
352  : "listNodes";
353  $tax_exp = new ilTaxonomyExplorerGUI($this, "showTree", $tax->getId(),
354  "ilobjtaxonomygui", $cmd);
355  if (!$tax_exp->handleCommand())
356  {
357  //$tpl->setLeftNavContent($tax_exp->getHTML());
358  $tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
359  }
360  return;
361  }
$cmd
Definition: sahs_server.php:35
Taxonomy explorer GUI class.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
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 898 of file class.ilObjTaxonomyGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, getCurrentTaxonomy(), initSettingsForm(), and ilUtil\sendSuccess().

899  {
900  global $tpl, $lng, $ilCtrl;
901 
902  $form = $this->initSettingsForm();
903  if ($form->checkInput())
904  {
905  $tax = $this->getCurrentTaxonomy();
906  $tax->setTitle($form->getInput("title"));
907  $tax->setDescription($form->getInput("description"));
908  $tax->setSortingMode($form->getInput("sorting"));
909  $tax->setItemSorting($form->getInput("item_sorting"));
910  $tax->update();
911 
912  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
913  $ilCtrl->redirect($this, "editSettings");
914  }
915  else
916  {
917  $form->setValuesByPost();
918  $tpl->setContent($form->getHtml());
919  }
920  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
getCurrentTaxonomy()
Get current taxonomy.
+ Here is the call graph for this function:

◆ updateTaxNode()

ilObjTaxonomyGUI::updateTaxNode ( )

Update tax node.

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

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

505  {
506  global $lng, $ilCtrl, $tpl;
507 
508  $this->initTaxNodeForm("edit");
509  if ($this->form->checkInput())
510  {
511  // create node
512  $node = new ilTaxonomyNode($_GET["tax_node"]);
513  $node->setTitle($this->form->getInput("title"));
514 
515  $tax = $this->getCurrentTaxonomy();
516  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
517  {
518  $node->setOrderNr($this->form->getInput("order_nr"));
519  }
520 
521  $node->update();
522 
523  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
524  $ilCtrl->redirect($this, "");
525  }
526  else
527  {
528  $this->form->setValuesByPost();
529  $tpl->setContent($this->form->getHtml());
530  }
531  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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 21 of file class.ilObjTaxonomyGUI.php.

◆ $multiple

ilObjTaxonomyGUI::$multiple = false
protected

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

Referenced by getMultiple().


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