ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjTaxonomyGUI Class Reference

Taxonomy GUI class. More...

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

Public Member Functions

 __construct ($a_id=0)
 Execute command. More...
 
 getType ()
 Get type. More...
 
 setAssignedObject ($a_val)
 Set assigned object. More...
 
 getAssignedObject ()
 Get assigned object. More...
 
 setMultiple ($a_val)
 Set multiple. More...
 
 getMultiple ()
 Get multiple. More...
 
 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 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...
 
 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, and ilObject2GUI\OBJECT_ID.

27  {
28  global $ilCtrl;
29 
30  parent::__construct($a_id, ilObject2GUI::OBJECT_ID);
31 
32  $ilCtrl->saveParameter($this, "tax_node");
33  $ilCtrl->saveParameter($this, "tax_id");
34  }
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 91 of file class.ilObjTaxonomyGUI.php.

92  {
93  $this->assigned_item_sorting = true;
94  $this->assigned_item_info_obj = $a_item_info_obj;
95  $this->assigned_item_comp_id = $a_component_id;
96  $this->assigned_item_obj_id = $a_obj_id;
97  $this->assigned_item_type = $a_item_type;
98  }

◆ afterSave()

ilObjTaxonomyGUI::afterSave ( ilObject  $a_new_object)
protected

After saving,.

Parameters

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

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

305  {
306  global $ilCtrl, $lng;
307 
308  if ($this->getAssignedObject() > 0)
309  {
310  ilObjTaxonomy::saveUsage($a_new_object->getId(),
311  $this->getAssignedObject());
312  $ilCtrl->setParameter($this, "tax_id", $a_new_object->getId());
313  ilUtil::sendSuccess($lng->txt("tax_added"), true);
314  $ilCtrl->redirect($this, "editSettings");
315  }
316  }
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 268 of file class.ilObjTaxonomyGUI.php.

References $ilCtrl, and getAssignedObject().

269  {
270  global $ilCtrl;
271 
272  if ($this->getAssignedObject() > 0)
273  {
274  $ilCtrl->redirect($this, "listTaxonomies");
275  }
276 
277  return parent::cancel();
278  }
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 250 of file class.ilObjTaxonomyGUI.php.

References getAssignedObject().

251  {
252  if ($this->getAssignedObject() > 0)
253  {
254  return true;
255  }
256  else
257  {
258  return parent::checkPermissionBool($a_perm, $a_cmd, $a_type, $a_node_id);
259  }
260  }
getAssignedObject()
Get assigned object.
+ Here is the call graph for this function:

◆ confirmDeleteTaxonomy()

ilObjTaxonomyGUI::confirmDeleteTaxonomy ( )

Confirm taxonomy deletion.

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

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

703  {
704  global $ilCtrl, $tpl, $lng;
705 
706  $tax = $this->getCurrentTaxonomy();
707 
708  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
709  $cgui = new ilConfirmationGUI();
710  $cgui->setFormAction($ilCtrl->getFormAction($this));
711  $cgui->setHeaderText($lng->txt("tax_confirm_deletion"));
712  $cgui->setCancel($lng->txt("cancel"), "listTaxonomies");
713  $cgui->setConfirm($lng->txt("delete"), "deleteTaxonomy");
714 
715  $cgui->addItem("id[]", $i, $tax->getTitle());
716 
717  $tpl->setContent($cgui->getHTML());
718  }
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 551 of file class.ilObjTaxonomyGUI.php.

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

552  {
553  global $ilCtrl;
554 
555  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
556 
557  // delete all selected objects
558  foreach ($_POST["id"] as $id)
559  {
560  $node = new ilTaxonomyNode($id);
561  $tax = new ilObjTaxonomy($node->getTaxonomyId());
562  $tax_tree = $tax->getTree();
563  $node_data = $tax_tree->getNodeData($id);
564  if (is_object($node))
565  {
566  $node->delete();
567  }
568  if($tax_tree->isInTree($id))
569  {
570  $tax_tree->deleteTree($node_data);
571  }
572  ilTaxonomyNode::fixOrderNumbers($node->getTaxonomyId(), $node_data["parent"]);
573  }
574 
575  // feedback
576  ilUtil::sendInfo($this->lng->txt("info_deleted"),true);
577 
578  $ilCtrl->redirect($this, "listNodes");
579  }
$_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 240 of file class.ilObjTaxonomyGUI.php.

References ilObject2GUI\create().

241  {
242  $this->create();
243  }
create()
Deleted in ilObject.
+ Here is the call graph for this function:

◆ createTaxNode()

ilObjTaxonomyGUI::createTaxNode ( )

Create tax node.

Parameters

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

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

369  {
370  global $tpl, $ilHelp;
371 
372  $this->setTabs("list_items");
373  $ilHelp->setSubScreenId("create_node");
374 
375  $this->initTaxNodeForm("create");
376  $tpl->setContent($this->form->getHTML());
377  }
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 514 of file class.ilObjTaxonomyGUI.php.

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

515  {
516  global $lng, $tpl, $ilCtrl, $ilTabs, $ilHelp;
517 
518  if(!isset($_POST["id"]))
519  {
520  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
521  }
522 
523  $this->setTabs("list_items");
524  $ilHelp->setSubScreenId("del_items");
525 
526 // $ilTabs->clearTargets();
527 
528  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
529  $confirmation_gui = new ilConfirmationGUI();
530 
531  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
532  $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
533 
534  // Add items to delete
535  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
536  foreach($_POST["id"] as $id)
537  {
538  $confirmation_gui->addItem("id[]", $id,
540  }
541 
542  $confirmation_gui->setCancel($lng->txt("cancel"), "listNodes");
543  $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
544 
545  $tpl->setContent($confirmation_gui->getHTML());
546  }
$_POST['username']
Definition: cron.php:12
static _lookupTitle($a_obj_id)
Lookup Title.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
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 726 of file class.ilObjTaxonomyGUI.php.

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

727  {
728  global $ilCtrl, $lng;
729 
730  $tax = $this->getCurrentTaxonomy();
731  $tax->delete();
732 
733  ilUtil::sendSuccess($lng->txt("tax_tax_deleted"), true);
734  $ilCtrl->redirect($this, "listTaxonomies");
735  }
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 144 of file class.ilObjTaxonomyGUI.php.

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

145  {
146  global $ilToolbar, $ilCtrl, $lng;
147 
148 
149 // if (count($tax_ids) != 0 && !$this->getMultiple())
150 // {
151 // $this->listNodes();
152 // }
153 // else if ($this->getMultiple())
154 // {
155  $this->listTaxonomies();
156 // }
157 
158  // currently we support only one taxonomy, otherwise we may need to provide
159  // a list here
160 
161  }
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 803 of file class.ilObjTaxonomyGUI.php.

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

804  {
805  global $tpl;
806 
807  $this->setTabs("settings");
808 
809  $form = $this->initSettingsForm();
810  $tpl->setContent($form->getHTML());
811  }
setTabs()
create tabs (repository/workspace switch)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjTaxonomyGUI::executeCommand ( )

Execute command.

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

References $cmd, $ilCtrl, and $ilUser.

105  {
106  global $ilCtrl, $ilUser, $ilTabs;
107 
108  $next_class = $ilCtrl->getNextClass();
109 
110  switch ($next_class)
111  {
112  default:
113  $cmd = $ilCtrl->getCmd("listTaxonomies");
114  $this->$cmd();
115  break;
116  }
117  }
$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 61 of file class.ilObjTaxonomyGUI.php.

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

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

◆ getCurrentTaxonomy()

ilObjTaxonomyGUI::getCurrentTaxonomy ( )

Get current taxonomy.

Parameters

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().

188  {
189  $tax_id = $this->getCurrentTaxonomyId();
190  if ($tax_id > 0)
191  {
192  $tax = new ilObjTaxonomy($tax_id);
193  return $tax;
194  }
195 
196  return false;
197  }
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 169 of file class.ilObjTaxonomyGUI.php.

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

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

170  {
172  $tax_id = (int) $_GET["tax_id"];
173  if (in_array($tax_id, $tax_ids))
174  {
175  return $tax_id;
176  }
177  return false;
178  }
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:

◆ getMultiple()

ilObjTaxonomyGUI::getMultiple ( )

Get multiple.

Returns
bool multiple

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

References $multiple.

Referenced by listTaxonomies().

82  {
83  return $this->multiple;
84  }
+ 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 347 of file class.ilObjTaxonomyGUI.php.

Referenced by ilGlossaryPresentationGUI\showTaxonomy().

349  {
350 die("ilObjTaxonomyGUI::getTreeHTML is deprecated.");
351  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
352  $tax_exp = new ilTaxonomyExplorerGUI($a_class, $a_cmd, $a_tax_id,
353  $a_target_class, $a_target_cmd);
354  if (!$tax_exp->handleCommand())
355  {
356  return $tax_exp->getHTML()." ";
357  }
358  return;
359  }
Taxonomy explorer GUI class.
+ Here is the caller graph for this function:

◆ getType()

ilObjTaxonomyGUI::getType ( )

Get type.

Returns
string type

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

42  {
43  return "tax";
44  }

◆ initCreationForms()

ilObjTaxonomyGUI::initCreationForms ( )
protected

Init creation forms.

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

References ilObjectGUI\initCreateForm().

123  {
124  $forms = array();
125 
126  $forms = array(
127  self::CFORM_NEW => $this->initCreateForm("tax")
128  );
129 
130  return $forms;
131  }
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjTaxonomyGUI::initSettingsForm ( )

Init form.

Definition at line 816 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().

817  {
818  global $lng, $ilCtrl;
819 
820  $tax = $this->getCurrentTaxonomy();
821 
822  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
823  $form = new ilPropertyFormGUI();
824 
825  // title
826  $ti = new ilTextInputGUI($lng->txt("title"), "title");
827  $ti->setMaxLength(200);
828  $form->addItem($ti);
829  $ti->setValue($tax->getTitle());
830 
831  // description
832  $ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
833  //$ta->setCols();
834  //$ta->setRows();
835  $form->addItem($ta);
836  $ta->setValue($tax->getDescription());
837 
838  // sorting
839  $options = array(
840  ilObjTaxonomy::SORT_ALPHABETICAL => $lng->txt("tax_alphabetical"),
841  ilObjTaxonomy::SORT_MANUAL => $lng->txt("tax_manual")
842  );
843  $si = new ilSelectInputGUI($lng->txt("tax_node_sorting"), "sorting");
844  $si->setOptions($options);
845  $form->addItem($si);
846  $si->setValue($tax->getSortingMode());
847 
848  // assigned item sorting
849  if ($this->assigned_item_sorting)
850  {
851  $cb = new ilCheckboxInputGUI($lng->txt("tax_item_sorting"), "item_sorting");
852  $cb->setChecked($tax->getItemSorting());
853  $form->addItem($cb);
854  }
855 
856  $form->addCommandButton("updateSettings", $lng->txt("save"));
857 
858  $form->setTitle($lng->txt("settings"));
859  $form->setFormAction($ilCtrl->getFormAction($this));
860 
861  return $form;
862  }
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 385 of file class.ilObjTaxonomyGUI.php.

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

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

386  {
387  global $lng, $ilCtrl;
388 
389  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
390  $this->form = new ilPropertyFormGUI();
391 
392  // title
393  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
394  $this->form->addItem($ti);
395 
396  // order nr
397  $tax = $this->getCurrentTaxonomy();
398  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
399  {
400  $or = new ilTextInputGUI($this->lng->txt("tax_order_nr"), "order_nr");
401  $or->setMaxLength(5);
402  $or->setSize(5);
403  $this->form->addItem($or);
404  }
405 
406  if ($a_mode == "edit")
407  {
408  $node = new ilTaxonomyNode((int) $_GET["tax_node"]);
409  $ti->setValue($node->getTitle());
410  $or->setValue($node->getOrderNr());
411  }
412 
413  // save and cancel commands
414  if ($a_mode == "create")
415  {
416  $this->form->addCommandButton("saveTaxNode", $lng->txt("save"));
417  $this->form->addCommandButton("listNodes", $lng->txt("cancel"));
418  $this->form->setTitle($lng->txt("tax_new_tax_node"));
419  }
420  else
421  {
422  $this->form->addCommandButton("updateTaxNode", $lng->txt("save"));
423  $this->form->addCommandButton("listNodes", $lng->txt("cancel"));
424  $this->form->setTitle($lng->txt("tax_edit_tax_node"));
425  }
426 
427  $this->form->setFormAction($ilCtrl->getFormAction($this));
428 
429  }
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 897 of file class.ilObjTaxonomyGUI.php.

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

898  {
899  global $tpl, $ilToolbar, $lng, $ilCtrl;
900 
901  $tax = $this->getCurrentTaxonomy();
902 
903  $this->setTabs("ass_items");
904 
905  // show tree
906  $this->showTree(true);
907 
908  // list assigned items
909  include_once("./Services/Taxonomy/classes/class.ilTaxAssignedItemsTableGUI.php");
910  $table = new ilTaxAssignedItemsTableGUI($this, "listAssignedItems",
911  (int) $_GET["tax_node"], $this->getCurrentTaxonomy(), $this->assigned_item_comp_id,
912  $this->assigned_item_obj_id, $this->assigned_item_type, $this->assigned_item_info_obj);
913 
914  $tpl->setContent($table->getHTML());
915  }
$_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 206 of file class.ilObjTaxonomyGUI.php.

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

207  {
208  global $tpl, $ilToolbar, $lng, $ilCtrl;
209 
210  $tax = $this->getCurrentTaxonomy();
211 
212  $this->setTabs("list_items");
213 
214  // show toolbar
215  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
216  $ilToolbar->addFormButton($lng->txt("tax_create_node"), "createTaxNode");
217 
218  $ilToolbar->setCloseFormTag(false);
219 
220 
221  // show tree
222  $this->showTree();
223 
224  // show subitems
225  include_once("./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
226  $table = new ilTaxonomyTableGUI($this, "listNodes", $tax->getTree(),
227  (int) $_GET["tax_node"], $this->getCurrentTaxonomy());
228  $table->setOpenFormTag(false);
229 
230  $tpl->setContent($table->getHTML());
231  }
$_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 743 of file class.ilObjTaxonomyGUI.php.

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

Referenced by editAOTaxonomySettings().

744  {
745  global $tpl, $ilToolbar, $lng, $ilCtrl;
746 
748  if (count($tax_ids) == 0 || $this->getMultiple())
749  {
750  $ilToolbar->addButton($lng->txt("tax_add_taxonomy"),
751  $ilCtrl->getLinkTarget($this, "createAssignedTaxonomy"));
752  }
753  else
754  {
755  ilUtil::sendInfo($lng->txt("tax_max_one_tax"));
756  }
757 
758  include_once("./Services/Taxonomy/classes/class.ilTaxonomyListTableGUI.php");
759 
760  $tab = new ilTaxonomyListTableGUI($this, "listTaxonomies", $this->getAssignedObject());
761 
762  $tpl->setContent($tab->getHTML());
763  }
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveItems()

ilObjTaxonomyGUI::moveItems ( )

Move items.

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

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

624  {
625  global $tpl, $ilCtrl, $lng, $ilToolbar, $ilHelp;
626 
627  $this->setTabs("list_items");
628  $ilHelp->setSubScreenId("move_items");
629 
630  $ilToolbar->addButton($lng->txt("cancel"),
631  $ilCtrl->getLinkTarget($this, "listNodes"));
632 
633  ilUtil::sendInfo($lng->txt("tax_please_select_target"));
634 
635  if (is_array($_POST["id"]))
636  {
637  $ilCtrl->setParameter($this, "move_ids", implode($_POST["id"], ","));
638 
639  global $ilUser, $tpl, $ilCtrl, $lng;
640 
641  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
642  $tax_exp = new ilTaxonomyExplorerGUI($this, "moveItems", $this->getCurrentTaxonomy()->getId(),
643  "ilobjtaxonomygui", "pasteItems");
644  if (!$tax_exp->handleCommand())
645  {
646  //$tpl->setLeftNavContent($tax_exp->getHTML());
647  $tpl->setContent($tax_exp->getHTML()." ");
648  }
649  }
650  }
$_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.
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 655 of file class.ilObjTaxonomyGUI.php.

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

656  {
657  global $lng, $ilCtrl;
658 //var_dump($_GET);
659 //var_dump($_POST);
660  if ($_GET["move_ids"] != "")
661  {
662  $move_ids = explode(",", $_GET["move_ids"]);
663  $tax = $this->getCurrentTaxonomy();
664  $tree = $tax->getTree();
665 
666  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
667  $target_node = new ilTaxonomyNode((int) $_GET["tax_node"]);
668  foreach ($move_ids as $m_id)
669  {
670  // cross check taxonomy
671  $node = new ilTaxonomyNode((int) $m_id);
672  if ($node->getTaxonomyId() == $tax->getId() &&
673  ($target_node->getTaxonomyId() == $tax->getId() ||
674  $target_node->getId() == $tree->readRootId()))
675  {
676  // check if target is not within the selected nodes
677  if($tree->isGrandChild((int) $m_id, $target_node->getId()))
678  {
679  ilUtil::sendFailure($lng->txt("tax_target_within_nodes"), true);
680  $this->ctrl->redirect($this, "listNodes");
681  }
682 
683  // if target is not current place, move
684  $parent_id = $tree->getParentId((int) $m_id);
685  if ($parent_id != $target_node->getId())
686  {
687  $tree->moveTree((int) $m_id, $target_node->getId());
688  ilTaxonomyNode::fixOrderNumbers($tax->getId(), $target_node->getId());
690  }
691  }
692  }
693  }
694 
695  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
696  $ilCtrl->redirect($this, "listNodes");
697  }
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 286 of file class.ilObjTaxonomyGUI.php.

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

287  {
288  global $ilCtrl;
289 
290  if ($this->getAssignedObject() > 0)
291  {
292  $_REQUEST["new_type"] = "tax";
293  }
294 
295  parent::saveObject();
296  }
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 923 of file class.ilObjTaxonomyGUI.php.

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

924  {
925  global $lng, $ilCtrl;
926 
927  include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
928  if (is_array($_POST["order"]))
929  {
930  $order = $_POST["order"];
931  //asort($order, SORT_NUMERIC);
932  //$cnt = 10;
933  $tax_node = (int) $_GET["tax_node"];
934  foreach ($order as $a_item_id => $ord_nr)
935  {
936  $tax_ass = new ilTaxNodeAssignment($this->assigned_item_comp_id,
937  $this->assigned_item_obj_id,
938  $this->assigned_item_type, $this->getCurrentTaxonomyId());
939  $tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
940  //$cnt+= 10;
941  }
942  $tax_ass = new ilTaxNodeAssignment($this->assigned_item_comp_id,
943  $this->assigned_item_obj_id,
944  $this->assigned_item_type, $this->getCurrentTaxonomyId());
945  $tax_ass->fixOrderNr($tax_node);
946  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
947  }
948  $ilCtrl->redirect($this, "listAssignedItems");
949  }
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 587 of file class.ilObjTaxonomyGUI.php.

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

588  {
589  global $ilCtrl, $lng;
590 
591  // save sorting
592  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
593  if (is_array($_POST["order"]))
594  {
595 // asort($_POST["order"]);
596 // $cnt = 10;
597  foreach ($_POST["order"] as $k => $v)
598  {
600  ilTaxonomyNode::fixOrderNumbers($this->getCurrentTaxonomyId(), (int) $_GET["tax_node"]);
601 // $cnt+= 10;
602  }
603  }
604 
605  // save titles
606  if (is_array($_POST["title"]))
607  {
608  foreach ($_POST["title"] as $k => $v)
609  {
612  }
613  }
614 
615 
616  ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
617  $ilCtrl->redirect($this, "listNodes");
618  }
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 435 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.

436  {
437  global $tpl, $lng, $ilCtrl;
438 
439  $this->initTaxNodeForm("create");
440  if ($this->form->checkInput())
441  {
442  $tax = $this->getCurrentTaxonomy();
443 
444  // create node
445  include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
446  $node = new ilTaxonomyNode();
447  $node->setTitle($this->form->getInput("title"));
448 
449  $tax = $this->getCurrentTaxonomy();
450  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
451  {
452  $order_nr = $this->form->getInput("order_nr");
453  }
454  if ($order_nr === "")
455  {
456  $order_nr = ilTaxonomyNode::getNextOrderNr($tax->getId(), (int) $_GET["tax_node"]);
457  }
458  //echo $order_nr; exit;
459  $node->setOrderNr($order_nr);
460  $node->setTaxonomyId($tax->getId());
461  $node->create();
462 
463  // put in tree
464  ilTaxonomyNode::putInTree($tax->getId(), $node, (int) $_GET["tax_node"]);
465 
466  ilTaxonomyNode::fixOrderNumbers($tax->getId(), (int) $_GET["tax_node"]);
467 
468  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
469  $ilCtrl->redirect($this, "listNodes");
470  }
471  else
472  {
473  $this->form->setValuesByPost();
474  $tpl->setContent($this->form->getHtml());
475  }
476  }
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 51 of file class.ilObjTaxonomyGUI.php.

52  {
53  $this->assigned_object_id = $a_val;
54  }

◆ setMultiple()

ilObjTaxonomyGUI::setMultiple (   $a_val)

Set multiple.

Parameters
bool$a_valmultiple

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

72  {
73  $this->multiple = $a_val;
74  }

◆ setTabs()

ilObjTaxonomyGUI::setTabs (   $a_id)

Set tabs.

Parameters
$a_idstring tab id to be activated

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

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

771  {
772  global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
773 
774  $ilTabs->clearTargets();
775 
776  $ilHelp->setScreenIdComponent("tax");
777 
778  $tpl->setTitle(ilObject::_lookupTitle($this->getCurrentTaxonomyId()));
779  $tpl->setTitleIcon(ilUtil::getImagePath("icon_tax_b.png"));
780 
781  $ilTabs->setBackTarget($lng->txt("back"),
782  $ilCtrl->getLinkTarget($this, "listTaxonomies"));
783 
784  $ilTabs->addTab("list_items", $lng->txt("tax_nodes"),
785  $ilCtrl->getLinkTarget($this, "listNodes"));
786  if ($this->assigned_item_sorting)
787  {
788  $ilTabs->addTab("ass_items", $lng->txt("tax_assigned_items"),
789  $ilCtrl->getLinkTarget($this, "listAssignedItems"));
790  }
791  $ilTabs->addTab("settings", $lng->txt("settings"),
792  $ilCtrl->getLinkTarget($this, "editSettings"));
793 
794  $ilTabs->activateTab($a_id);
795  }
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 321 of file class.ilObjTaxonomyGUI.php.

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

Referenced by listAssignedItems(), and listNodes().

322  {
323  global $ilUser, $tpl, $ilCtrl, $lng;
324 
325  $tax = $this->getCurrentTaxonomy();
326 
327  include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
328  $cmd = $a_ass_items
329  ? "listAssignedItems"
330  : "listNodes";
331  $tax_exp = new ilTaxonomyExplorerGUI($this, "showTree", $tax->getId(),
332  "ilobjtaxonomygui", $cmd);
333  if (!$tax_exp->handleCommand())
334  {
335  //$tpl->setLeftNavContent($tax_exp->getHTML());
336  $tpl->setLeftContent($tax_exp->getHTML()."&nbsp;");
337  }
338  return;
339  }
$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 867 of file class.ilObjTaxonomyGUI.php.

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

868  {
869  global $tpl, $lng, $ilCtrl;
870 
871  $form = $this->initSettingsForm();
872  if ($form->checkInput())
873  {
874  $tax = $this->getCurrentTaxonomy();
875  $tax->setTitle($form->getInput("title"));
876  $tax->setDescription($form->getInput("description"));
877  $tax->setSortingMode($form->getInput("sorting"));
878  $tax->setItemSorting($form->getInput("item_sorting"));
879  $tax->update();
880 
881  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
882  $ilCtrl->redirect($this, "editSettings");
883  }
884  else
885  {
886  $form->setValuesByPost();
887  $tpl->setContent($form->getHtml());
888  }
889  }
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 482 of file class.ilObjTaxonomyGUI.php.

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

483  {
484  global $lng, $ilCtrl, $tpl;
485 
486  $this->initTaxNodeForm("edit");
487  if ($this->form->checkInput())
488  {
489  // create node
490  $node = new ilTaxonomyNode($_GET["tax_node"]);
491  $node->setTitle($this->form->getInput("title"));
492 
493  $tax = $this->getCurrentTaxonomy();
494  if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
495  {
496  $node->setOrderNr($this->form->getInput("order_nr"));
497  }
498 
499  $node->update();
500 
501  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
502  $ilCtrl->redirect($this, "");
503  }
504  else
505  {
506  $this->form->setValuesByPost();
507  $tpl->setContent($this->form->getHtml());
508  }
509  }
$_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: