ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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.
 getType ()
 Get type.
 setAssignedObject ($a_val)
 Set assigned object.
 getAssignedObject ()
 Get assigned object.
 setMultiple ($a_val)
 Set multiple.
 getMultiple ()
 Get multiple.
 setListInfo ($a_val)
 Set list info.
 getListInfo ()
 Get list info.
 activateAssignedItemSorting (ilTaxAssignedItemInfo $a_item_info_obj, $a_component_id, $a_obj_id, $a_item_type)
 Activate sorting mode of assigned objects.
 executeCommand ()
 Execute command.
 editAOTaxonomySettings ()
 getCurrentTaxonomyId ()
 Get current taxonomy id.
 getCurrentTaxonomy ()
 Get current taxonomy.
 listNodes ()
 List items.
 createAssignedTaxonomy ()
 Create assigned taxonomy.
 cancel ()
 Cancel creation.
 save ()
 Save taxonomy.
 showTree ($a_ass_items=false)
 Show Editing Tree.
 createTaxNode ()
 Create tax node.
 initTaxNodeForm ($a_mode="edit")
 Init tax node form.
 saveTaxNode ()
 Save tax node form.
 updateTaxNode ()
 Update tax node.
 deleteItems ()
 Confirm deletion screen for items.
 confirmedDelete ()
 Delete taxonomy nodes.
 saveSorting ()
 Save settings and sorting.
 moveItems ()
 Move items.
 pasteItems ()
 Paste items (move operation)
 confirmDeleteTaxonomy ()
 Confirm taxonomy deletion.
 deleteTaxonomy ()
 Delete taxonomy.
 listTaxonomies ()
 List taxonomies.
 setTabs ($a_id)
 Set tabs.
 editSettings ()
 Edit settings.
 initSettingsForm ()
 Init form.
 updateSettings ()
 Update taxonomy settings.
 listAssignedItems ()
 List assigned items.
 saveAssignedItemsSorting ()
 Save assigned items sorting.
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor.
 delete ()
 Display delete confirmation form (repository/workspace switch)
 getHTML ()
 withReferences ()
 Final/Private declaration of unchanged parent methods.
 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
 getCreationMode ()
 get creation mode
 isVisible ()
 trash ()
 undelete ()
 cancelDelete ()
 removeFromSystem ()
 cloneAll ()
 view ()
 view object content (repository/workspace switch)
 create ()
 Deleted in ilObject.
 edit ()
 update ()
 importFile ()
 Import.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

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.
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback.
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

Protected Member Functions

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

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

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

ilObjTaxonomyGUI::__construct (   $a_id = 0)

Execute command.

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

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

{
global $ilCtrl, $lng;
$ilCtrl->saveParameter($this, "tax_node");
$ilCtrl->saveParameter($this, "tax_id");
$lng->loadLanguageModule("tax");
}

Member Function Documentation

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.

{
$this->assigned_item_sorting = true;
$this->assigned_item_info_obj = $a_item_info_obj;
$this->assigned_item_comp_id = $a_component_id;
$this->assigned_item_obj_id = $a_obj_id;
$this->assigned_item_type = $a_item_type;
}
ilObjTaxonomyGUI::afterSave ( ilObject  $a_new_object)
protected

After saving,.

Parameters
@return

Reimplemented from ilObjectGUI.

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

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

{
global $ilCtrl, $lng;
if ($this->getAssignedObject() > 0)
{
ilObjTaxonomy::saveUsage($a_new_object->getId(),
$this->getAssignedObject());
$ilCtrl->setParameter($this, "tax_id", $a_new_object->getId());
ilUtil::sendSuccess($lng->txt("tax_added"), true);
$ilCtrl->redirect($this, "editSettings");
}
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::cancel ( )

Cancel creation.

Parameters
@return

Reimplemented from ilObject2GUI.

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

References $ilCtrl, and getAssignedObject().

{
global $ilCtrl;
if ($this->getAssignedObject() > 0)
{
$ilCtrl->redirect($this, "listTaxonomies");
}
return parent::cancel();
}

+ Here is the call graph for this function:

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.

Reimplemented from ilObject2GUI.

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

References getAssignedObject().

{
if ($this->getAssignedObject() > 0)
{
return true;
}
else
{
return parent::checkPermissionBool($a_perm, $a_cmd, $a_type, $a_node_id);
}
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::confirmDeleteTaxonomy ( )

Confirm taxonomy deletion.

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

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

{
global $ilCtrl, $tpl, $lng;
$tax = $this->getCurrentTaxonomy();
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("tax_confirm_deletion"));
$cgui->setCancel($lng->txt("cancel"), "listTaxonomies");
$cgui->setConfirm($lng->txt("delete"), "deleteTaxonomy");
$cgui->addItem("id[]", $i, $tax->getTitle());
$tpl->setContent($cgui->getHTML());
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::confirmedDelete ( )

Delete taxonomy nodes.

Reimplemented from ilObject2GUI.

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

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

{
global $ilCtrl;
include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
// delete all selected objects
foreach ($_POST["id"] as $id)
{
$node = new ilTaxonomyNode($id);
$tax = new ilObjTaxonomy($node->getTaxonomyId());
$tax_tree = $tax->getTree();
$node_data = $tax_tree->getNodeData($id);
if (is_object($node))
{
$node->delete();
}
if($tax_tree->isInTree($id))
{
$tax_tree->deleteTree($node_data);
}
ilTaxonomyNode::fixOrderNumbers($node->getTaxonomyId(), $node_data["parent"]);
}
// feedback
ilUtil::sendInfo($this->lng->txt("info_deleted"),true);
$ilCtrl->redirect($this, "listNodes");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::createAssignedTaxonomy ( )

Create assigned taxonomy.

Parameters
@return

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

References ilObject2GUI\create().

{
$this->create();
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::createTaxNode ( )

Create tax node.

Parameters
@return

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

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

{
global $tpl, $ilHelp;
$this->setTabs("list_items");
$ilHelp->setSubScreenId("create_node");
$this->initTaxNodeForm("create");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

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

{
global $lng, $tpl, $ilCtrl, $ilTabs, $ilHelp;
if(!isset($_POST["id"]))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
$ilCtrl->redirect($this, "listNodes");
}
$this->setTabs("list_items");
$ilHelp->setSubScreenId("del_items");
// $ilTabs->clearTargets();
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$confirmation_gui = new ilConfirmationGUI();
$confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
$confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
// Add items to delete
include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
foreach($_POST["id"] as $id)
{
$confirmation_gui->addItem("id[]", $id,
}
$confirmation_gui->setCancel($lng->txt("cancel"), "listNodes");
$confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
$tpl->setContent($confirmation_gui->getHTML());
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::deleteTaxonomy ( )

Delete taxonomy.

Parameters
@return

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

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

{
global $ilCtrl, $lng;
$tax = $this->getCurrentTaxonomy();
$tax->delete();
ilUtil::sendSuccess($lng->txt("tax_tax_deleted"), true);
$ilCtrl->redirect($this, "listTaxonomies");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::editAOTaxonomySettings ( )
Parameters
@return

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

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

{
global $ilToolbar, $ilCtrl, $lng;
// if (count($tax_ids) != 0 && !$this->getMultiple())
// {
// $this->listNodes();
// }
// else if ($this->getMultiple())
// {
$this->listTaxonomies();
// }
// currently we support only one taxonomy, otherwise we may need to provide
// a list here
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::editSettings ( )

Edit settings.

Parameters
@return

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

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

{
global $tpl;
$this->setTabs("settings");
$form = $this->initSettingsForm();
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::executeCommand ( )

Execute command.

Reimplemented from ilObject2GUI.

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

References $cmd, $ilCtrl, and $ilUser.

{
global $ilCtrl, $ilUser, $ilTabs;
$next_class = $ilCtrl->getNextClass();
switch ($next_class)
{
default:
$cmd = $ilCtrl->getCmd("listTaxonomies");
$this->$cmd();
break;
}
}
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().

{
return $this->assigned_object_id;
}

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::getCurrentTaxonomy ( )

Get current taxonomy.

Parameters
@return

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

{
$tax_id = $this->getCurrentTaxonomyId();
if ($tax_id > 0)
{
$tax = new ilObjTaxonomy($tax_id);
return $tax;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::getCurrentTaxonomyId ( )

Get current taxonomy id.

Parameters
@return

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

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

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

{
$tax_id = (int) $_GET["tax_id"];
if (in_array($tax_id, $tax_ids))
{
return $tax_id;
}
return false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::getListInfo ( )

Get list info.

Returns
string

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

Referenced by listTaxonomies().

{
return $this->list_info;
}

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::getMultiple ( )

Get multiple.

Returns
bool multiple

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

References $multiple.

Referenced by listTaxonomies().

{
}

+ Here is the caller graph for this function:

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
@return

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

Referenced by ilGlossaryPresentationGUI\showTaxonomy().

{
die("ilObjTaxonomyGUI::getTreeHTML is deprecated.");
include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
$tax_exp = new ilTaxonomyExplorerGUI($a_class, $a_cmd, $a_tax_id,
$a_target_class, $a_target_cmd);
if (!$tax_exp->handleCommand())
{
return $tax_exp->getHTML()." ";
}
return;
}

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::getType ( )

Get type.

Returns
string type

Reimplemented from ilObject2GUI.

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

{
return "tax";
}
ilObjTaxonomyGUI::initCreationForms ( )
protected

Init creation forms.

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

References ilObjectGUI\initCreateForm().

{
$forms = array();
$forms = array(
self::CFORM_NEW => $this->initCreateForm("tax")
);
return $forms;
}

+ Here is the call graph for this function:

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

{
global $lng, $ilCtrl;
$tax = $this->getCurrentTaxonomy();
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(200);
$form->addItem($ti);
$ti->setValue($tax->getTitle());
// description
$ta = new ilTextAreaInputGUI($lng->txt("description"), "description");
//$ta->setCols();
//$ta->setRows();
$form->addItem($ta);
$ta->setValue($tax->getDescription());
// sorting
$options = array(
ilObjTaxonomy::SORT_ALPHABETICAL => $lng->txt("tax_alphabetical"),
ilObjTaxonomy::SORT_MANUAL => $lng->txt("tax_manual")
);
$si = new ilSelectInputGUI($lng->txt("tax_node_sorting"), "sorting");
$form->addItem($si);
$si->setValue($tax->getSortingMode());
// assigned item sorting
if ($this->assigned_item_sorting)
{
$cb = new ilCheckboxInputGUI($lng->txt("tax_item_sorting"), "item_sorting");
$cb->setChecked($tax->getItemSorting());
$form->addItem($cb);
}
$form->addCommandButton("updateSettings", $lng->txt("save"));
$form->setTitle($lng->txt("settings"));
$form->setFormAction($ilCtrl->getFormAction($this));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$this->form->addItem($ti);
// order nr
$tax = $this->getCurrentTaxonomy();
if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
{
$or = new ilTextInputGUI($this->lng->txt("tax_order_nr"), "order_nr");
$or->setMaxLength(5);
$or->setSize(5);
$this->form->addItem($or);
}
if ($a_mode == "edit")
{
$node = new ilTaxonomyNode((int) $_GET["tax_node"]);
$ti->setValue($node->getTitle());
$or->setValue($node->getOrderNr());
}
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("saveTaxNode", $lng->txt("save"));
$this->form->addCommandButton("listNodes", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("tax_new_tax_node"));
}
else
{
$this->form->addCommandButton("updateTaxNode", $lng->txt("save"));
$this->form->addCommandButton("listNodes", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("tax_edit_tax_node"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::listAssignedItems ( )

List assigned items.

Parameters
@return

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

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

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
$tax = $this->getCurrentTaxonomy();
$this->setTabs("ass_items");
// show tree
$this->showTree(true);
// list assigned items
include_once("./Services/Taxonomy/classes/class.ilTaxAssignedItemsTableGUI.php");
$table = new ilTaxAssignedItemsTableGUI($this, "listAssignedItems",
(int) $_GET["tax_node"], $this->getCurrentTaxonomy(), $this->assigned_item_comp_id,
$this->assigned_item_obj_id, $this->assigned_item_type, $this->assigned_item_info_obj);
$tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::listNodes ( )

List items.

Parameters
@return

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

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

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
$tax = $this->getCurrentTaxonomy();
$this->setTabs("list_items");
// show toolbar
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->addFormButton($lng->txt("tax_create_node"), "createTaxNode");
$ilToolbar->setCloseFormTag(false);
// show tree
$this->showTree();
// show subitems
include_once("./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
$table = new ilTaxonomyTableGUI($this, "listNodes", $tax->getTree(),
(int) $_GET["tax_node"], $this->getCurrentTaxonomy());
$table->setOpenFormTag(false);
$tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::listTaxonomies ( )

List taxonomies.

Parameters
@return

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

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
if (count($tax_ids) == 0 || $this->getMultiple())
{
$ilToolbar->addButton($lng->txt("tax_add_taxonomy"),
$ilCtrl->getLinkTarget($this, "createAssignedTaxonomy"));
}
else
{
ilUtil::sendInfo($lng->txt("tax_max_one_tax"));
}
include_once("./Services/Taxonomy/classes/class.ilTaxonomyListTableGUI.php");
$tab = new ilTaxonomyListTableGUI($this, "listTaxonomies", $this->getAssignedObject(),
$this->getListInfo());
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
global $tpl, $ilCtrl, $lng, $ilToolbar, $ilHelp;
if(!isset($_POST["id"]))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"),true);
$ilCtrl->redirect($this, "listNodes");
}
$this->setTabs("list_items");
$ilHelp->setSubScreenId("move_items");
$ilToolbar->addButton($lng->txt("cancel"),
$ilCtrl->getLinkTarget($this, "listNodes"));
ilUtil::sendInfo($lng->txt("tax_please_select_target"));
if (is_array($_POST["id"]))
{
$ilCtrl->setParameter($this, "move_ids", implode($_POST["id"], ","));
global $ilUser, $tpl, $ilCtrl, $lng;
include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
$tax_exp = new ilTaxonomyExplorerGUI($this, "moveItems", $this->getCurrentTaxonomy()->getId(),
"ilobjtaxonomygui", "pasteItems");
if (!$tax_exp->handleCommand())
{
//$tpl->setLeftNavContent($tax_exp->getHTML());
$tpl->setContent($tax_exp->getHTML()." ");
}
}
}

+ Here is the call graph for this function:

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

{
global $lng, $ilCtrl;
//var_dump($_GET);
//var_dump($_POST);
if ($_GET["move_ids"] != "")
{
$move_ids = explode(",", $_GET["move_ids"]);
$tax = $this->getCurrentTaxonomy();
$tree = $tax->getTree();
include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
$target_node = new ilTaxonomyNode((int) $_GET["tax_node"]);
foreach ($move_ids as $m_id)
{
// cross check taxonomy
$node = new ilTaxonomyNode((int) $m_id);
if ($node->getTaxonomyId() == $tax->getId() &&
($target_node->getTaxonomyId() == $tax->getId() ||
$target_node->getId() == $tree->readRootId()))
{
// check if target is not within the selected nodes
if($tree->isGrandChild((int) $m_id, $target_node->getId()))
{
ilUtil::sendFailure($lng->txt("tax_target_within_nodes"), true);
$this->ctrl->redirect($this, "listNodes");
}
// if target is not current place, move
$parent_id = $tree->getParentId((int) $m_id);
if ($parent_id != $target_node->getId())
{
$tree->moveTree((int) $m_id, $target_node->getId());
ilTaxonomyNode::fixOrderNumbers($tax->getId(), $target_node->getId());
}
}
}
}
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "listNodes");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::save ( )

Save taxonomy.

Parameters
@return

Reimplemented from ilObject2GUI.

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

References $_REQUEST, $ilCtrl, getAssignedObject(), and ilObjectGUI\saveObject().

{
global $ilCtrl;
if ($this->getAssignedObject() > 0)
{
$_REQUEST["new_type"] = "tax";
}
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::saveAssignedItemsSorting ( )

Save assigned items sorting.

Parameters
@return

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

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

{
global $lng, $ilCtrl;
include_once("./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php");
if (is_array($_POST["order"]))
{
$order = $_POST["order"];
//asort($order, SORT_NUMERIC);
//$cnt = 10;
$tax_node = (int) $_GET["tax_node"];
foreach ($order as $a_item_id => $ord_nr)
{
$tax_ass = new ilTaxNodeAssignment($this->assigned_item_comp_id,
$this->assigned_item_obj_id,
$this->assigned_item_type, $this->getCurrentTaxonomyId());
$tax_ass->setOrderNr($tax_node, $a_item_id, $ord_nr);
//$cnt+= 10;
}
$tax_ass = new ilTaxNodeAssignment($this->assigned_item_comp_id,
$this->assigned_item_obj_id,
$this->assigned_item_type, $this->getCurrentTaxonomyId());
$tax_ass->fixOrderNr($tax_node);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
}
$ilCtrl->redirect($this, "listAssignedItems");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::saveSorting ( )

Save settings and sorting.

Parameters
@return

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

{
global $ilCtrl, $lng;
// save sorting
include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
if (is_array($_POST["order"]))
{
// asort($_POST["order"]);
// $cnt = 10;
foreach ($_POST["order"] as $k => $v)
{
// $cnt+= 10;
}
}
// save titles
if (is_array($_POST["title"]))
{
foreach ($_POST["title"] as $k => $v)
{
}
}
ilUtil::sendSuccess($lng->txt("msg_obj_modified"));
$ilCtrl->redirect($this, "listNodes");
}

+ Here is the call graph for this function:

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.

{
global $tpl, $lng, $ilCtrl;
$this->initTaxNodeForm("create");
if ($this->form->checkInput())
{
$tax = $this->getCurrentTaxonomy();
// create node
include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
$node = new ilTaxonomyNode();
$node->setTitle($this->form->getInput("title"));
$tax = $this->getCurrentTaxonomy();
if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
{
$order_nr = $this->form->getInput("order_nr");
}
if ($order_nr === "")
{
$order_nr = ilTaxonomyNode::getNextOrderNr($tax->getId(), (int) $_GET["tax_node"]);
}
//echo $order_nr; exit;
$node->setOrderNr($order_nr);
$node->setTaxonomyId($tax->getId());
$node->create();
// put in tree
ilTaxonomyNode::putInTree($tax->getId(), $node, (int) $_GET["tax_node"]);
ilTaxonomyNode::fixOrderNumbers($tax->getId(), (int) $_GET["tax_node"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "listNodes");
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::setAssignedObject (   $a_val)

Set assigned object.

Parameters
int$a_valobject id

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

{
$this->assigned_object_id = $a_val;
}
ilObjTaxonomyGUI::setListInfo (   $a_val)

Set list info.

Parameters
string$a_val

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

{
$this->list_info = trim($a_val);
}
ilObjTaxonomyGUI::setMultiple (   $a_val)

Set multiple.

Parameters
bool$a_valmultiple

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

{
$this->multiple = $a_val;
}
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().

{
global $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;
$ilTabs->clearTargets();
$ilHelp->setScreenIdComponent("tax");
$tpl->clearHeader();
$tpl->setTitle(ilObject::_lookupTitle($this->getCurrentTaxonomyId()));
$tpl->setTitleIcon(ilUtil::getImagePath("icon_tax.svg"));
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "listTaxonomies"));
$ilTabs->addTab("list_items", $lng->txt("tax_nodes"),
$ilCtrl->getLinkTarget($this, "listNodes"));
if ($this->assigned_item_sorting)
{
$ilTabs->addTab("ass_items", $lng->txt("tax_assigned_items"),
$ilCtrl->getLinkTarget($this, "listAssignedItems"));
}
$ilTabs->addTab("settings", $lng->txt("settings"),
$ilCtrl->getLinkTarget($this, "editSettings"));
$ilTabs->activateTab($a_id);
}

+ Here is the call graph for this function:

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

{
global $ilUser, $tpl, $ilCtrl, $lng;
$tax = $this->getCurrentTaxonomy();
include_once("./Services/Taxonomy/classes/class.ilTaxonomyExplorerGUI.php");
$cmd = $a_ass_items
? "listAssignedItems"
: "listNodes";
$tax_exp = new ilTaxonomyExplorerGUI($this, "showTree", $tax->getId(),
"ilobjtaxonomygui", $cmd);
if (!$tax_exp->handleCommand())
{
//$tpl->setLeftNavContent($tax_exp->getHTML());
$tpl->setLeftContent($tax_exp->getHTML()." ");
}
return;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

{
global $tpl, $lng, $ilCtrl;
$form = $this->initSettingsForm();
if ($form->checkInput())
{
$tax = $this->getCurrentTaxonomy();
$tax->setTitle($form->getInput("title"));
$tax->setDescription($form->getInput("description"));
$tax->setSortingMode($form->getInput("sorting"));
$tax->setItemSorting($form->getInput("item_sorting"));
$tax->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "editSettings");
}
else
{
$form->setValuesByPost();
$tpl->setContent($form->getHtml());
}
}

+ Here is the call graph for this function:

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.

{
global $lng, $ilCtrl, $tpl;
$this->initTaxNodeForm("edit");
if ($this->form->checkInput())
{
// create node
$node = new ilTaxonomyNode($_GET["tax_node"]);
$node->setTitle($this->form->getInput("title"));
$tax = $this->getCurrentTaxonomy();
if ($tax->getSortingMode() == ilObjTaxonomy::SORT_MANUAL)
{
$node->setOrderNr($this->form->getInput("order_nr"));
}
$node->update();
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "");
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

Field Documentation

ilObjTaxonomyGUI::$assigned_item_sorting = false
protected

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

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: