ILIAS  release_4-3 Revision
 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.
 executeCommand ()
 Execute command.
 editAOTaxonomySettings ()
 determineAOCurrentTaxonomy ()
 Determine current taxonomy (of assigned object)
 listItems ()
 List items.
 createAssignedTaxonomy ()
 Create assigned taxonomy.
 cancel ()
 Cancel creation.
 save ()
 Save taxonomy.
 showTree ($a_tax_tree)
 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.
 saveSettingsAndSorting ()
 Save settings and sorting.
 moveItems ()
 Move items.
 pasteItems ()
 Paste items (move operation)
 confirmDeleteTaxonomy ()
 Confirm taxonomy deletion.
 deleteTaxonomy ()
 Delete taxonomy.
- 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_root_node_title="")
 Get tree html.

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 ()
 should be overwritten to add object specific items (repository items are preloaded)
 setTabs ()
 create tabs (repository/workspace switch)
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 __showClipboardTable ()
 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)
- 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.
 setAdminTabs ()
 set admin tabs public
 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.
 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
 __showClipboardTable ($a_result_set, $a_from="")
 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.

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
- Protected Attributes inherited from ilObject2GUI
 $object_id
 $node_id
 $creation_forms = array()
 $id_type = array()
 $parent_id
 $access_handler

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

Constructor & Destructor Documentation

ilObjTaxonomyGUI::__construct (   $a_id = 0)

Execute command.

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

References $ilCtrl, and ilObject2GUI\OBJECT_ID.

{
global $ilCtrl;
$ilCtrl->saveParameter($this, "tax_node");
}

Member Function Documentation

ilObjTaxonomyGUI::afterSave ( ilObject  $a_new_object)
protected

After saving,.

Parameters
@return

Reimplemented from ilObjectGUI.

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

References $ilCtrl, getAssignedObject(), ilObject\getId(), and ilObjTaxonomy\saveUsage().

{
global $ilCtrl;
if ($this->getAssignedObject() > 0)
{
ilObjTaxonomy::saveUsage($a_new_object->getId(),
$this->getAssignedObject());
$ilCtrl->redirect($this, "editAOTaxonomySettings");
}
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::cancel ( )

Cancel creation.

Parameters
@return

Reimplemented from ilObject2GUI.

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

References $ilCtrl, and getAssignedObject().

{
global $ilCtrl;
if ($this->getAssignedObject() > 0)
{
$ilCtrl->redirect($this, "editAOTaxonomySettings");
}
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 206 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 715 of file class.ilObjTaxonomyGUI.php.

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

{
global $ilCtrl, $tpl, $lng;
$tax = $this->determineAOCurrentTaxonomy();
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"), "listItems");
$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 556 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, "listItems");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::createAssignedTaxonomy ( )

Create assigned taxonomy.

Parameters
@return

Definition at line 196 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 380 of file class.ilObjTaxonomyGUI.php.

References ilObjectGUI\$tpl, and initTaxNodeForm().

{
global $tpl;
$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 522 of file class.ilObjTaxonomyGUI.php.

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

{
global $lng, $tpl, $ilCtrl, $ilTabs;
if(!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// $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"), "listItems");
$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 739 of file class.ilObjTaxonomyGUI.php.

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

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

+ Here is the call graph for this function:

ilObjTaxonomyGUI::determineAOCurrentTaxonomy ( )

Determine current taxonomy (of assigned object)

Parameters
@return

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

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

Referenced by confirmDeleteTaxonomy(), deleteTaxonomy(), initTaxNodeForm(), listItems(), moveItems(), pasteItems(), saveSettingsAndSorting(), saveTaxNode(), and updateTaxNode().

{
// get taxonomy
$tax = new ilObjTaxonomy(current($tax_ids));
return $tax;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::editAOTaxonomySettings ( )
Parameters
@return

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

References $ilCtrl, ilObjectGUI\$lng, getAssignedObject(), ilObjTaxonomy\getUsageOfObject(), and listItems().

{
global $ilToolbar, $ilCtrl, $lng;
if (count($tax_ids) == 0)
{
$ilToolbar->addButton($lng->txt("tax_add_taxonomy"),
$ilCtrl->getLinkTarget($this, "createAssignedTaxonomy"));
}
else
{
$this->listItems();
}
// currently we support only one taxonomy, otherwise we may need to provide
// a list here
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::executeCommand ( )

Execute command.

Reimplemented from ilObject2GUI.

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

References $cmd, $ilCtrl, and $ilUser.

{
global $ilCtrl, $ilUser, $ilTabs;
$next_class = $ilCtrl->getNextClass();
$cmd = $ilCtrl->getCmd();
switch ($next_class)
{
default:
$this->$cmd();
break;
}
}
ilObjTaxonomyGUI::getAssignedObject ( )

Get assigned object.

Returns
int object id

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

Referenced by afterSave(), cancel(), checkPermissionBool(), determineAOCurrentTaxonomy(), editAOTaxonomySettings(), and save().

{
return $this->assigned_object_id;
}

+ Here is the caller graph for this function:

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

Get tree html.

Parameters
@return

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

References $_GET, $ilCtrl, $ilUser, ilObjectGUI\$lng, $path, ilObjectGUI\$tpl, and ilExplorer\setTargetGet().

Referenced by ilGlossaryPresentationGUI\showTaxonomy().

{
global $ilUser, $tpl, $ilCtrl, $lng;
$lng->loadLanguageModule("tax");
include_once("./Services/Taxonomy/classes/class.ilTaxonomyTree.php");
require_once ("./Services/Taxonomy/classes/class.ilTaxonomyExplorer.php");
$a_tax_tree = new ilTaxonomyTree($a_tax_id);
$exp = new ilTaxonomyExplorer($ilCtrl->getLinkTargetByClass($a_class, $a_cmd), $a_tax_tree,
$a_class, $a_cmd);
$exp->setTargetGet("tax_node");
if ($a_root_node_title != "")
{
$exp->setRootNodeTitle($a_root_node_title);
}
$exp->setExpandTarget($ilCtrl->getLinkTargetByClass($a_class, $a_cmd));
if ($_GET["txexpand"] == "")
{
$expanded = $a_tax_tree->readRootId();
}
else
{
$expanded = $_GET["txexpand"];
}
if ($_GET["tax_node"] > 0)
{
$path = $a_tax_tree->getPathId($_GET["tax_node"]);
$exp->setForceOpenPath($path);
$exp->highlightNode($_GET["tax_node"]);
}
else
{
$exp->highlightNode($a_tax_tree->readRootId());
}
$exp->setExpand($expanded);
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
return $output;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::getType ( )

Get type.

Returns
string type

Reimplemented from ilObject2GUI.

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

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

Init creation forms.

Definition at line 84 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::initTaxNodeForm (   $a_mode = "edit")

Init tax node form.

Parameters
int$a_modeEdit Mode

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, determineAOCurrentTaxonomy(), 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->determineAOCurrentTaxonomy();
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("listItems", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("tax_new_tax_node"));
}
else
{
$this->form->addCommandButton("updateTaxNode", $lng->txt("save"));
$this->form->addCommandButton("listItems", $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::listItems ( )

List items.

Parameters
@return

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, $si, ilObjectGUI\$tpl, determineAOCurrentTaxonomy(), ilTable2GUI\setOpenFormTag(), ilSelectInputGUI\setValue(), showTree(), ilObjTaxonomy\SORT_ALPHABETICAL, and ilObjTaxonomy\SORT_MANUAL.

Referenced by editAOTaxonomySettings().

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
$tax = $this->determineAOCurrentTaxonomy();
// show toolbar
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->addFormButton($lng->txt("tax_create_node"), "createTaxNode");
// settings
$ilToolbar->addSeparator();
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$options = array(
ilObjTaxonomy::SORT_ALPHABETICAL => $lng->txt("tax_alphabetical"),
ilObjTaxonomy::SORT_MANUAL => $lng->txt("tax_manual")
);
$si = new ilSelectInputGUI($lng->txt("tax_sorting"), "sorting");
$si->setValue($this->determineAOCurrentTaxonomy()->getSortingMode());
$si->setOptions($options);
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($lng->txt("save"), "saveSettingsAndSorting");
$ilToolbar->addSeparator();
$ilToolbar->addFormButton($lng->txt("tax_delete_taxonomy"), "confirmDeleteTaxonomy");
$ilToolbar->setCloseFormTag(false);
// show tree
$this->showTree($tax->getTree());
// show subitems
include_once("./Services/Taxonomy/classes/class.ilTaxonomyTableGUI.php");
$table = new ilTaxonomyTableGUI($this, "listItems", $tax->getTree(),
(int) $_GET["tax_node"], $this->determineAOCurrentTaxonomy());
$table->setOpenFormTag(false);
$tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::moveItems ( )

Move items.

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

References $_POST, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, determineAOCurrentTaxonomy(), ilExplorer\forceExpandAll(), and ilUtil\sendInfo().

{
global $tpl, $ilCtrl, $lng, $ilToolbar;
$ilToolbar->addButton($lng->txt("cancel"),
$ilCtrl->getLinkTarget($this, "listItems"));
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;
require_once ("./Services/Taxonomy/classes/class.ilTaxonomyExplorer.php");
$exp = new ilTaxonomyExplorer($ilCtrl->getLinkTarget($this, "pasteItems"),
$this->determineAOCurrentTaxonomy()->getTree(),
"ilobjtaxonomygui", "pasteItems");
$exp->forceExpandAll(true, false);
$exp->setTargetGet("tax_node");
$exp->setExpandTarget($ilCtrl->getLinkTarget($this, "pasteItems"));
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
$tpl->setContent($output);
}
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::pasteItems ( )

Paste items (move operation)

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\$parent_id, ilObject2GUI\$tree, determineAOCurrentTaxonomy(), ilTaxonomyNode\fixOrderNumbers(), 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->determineAOCurrentTaxonomy();
$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, "listItems");
}
// 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, "listItems");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::save ( )

Save taxonomy.

Parameters
@return

Reimplemented from ilObject2GUI.

Definition at line 242 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::saveSettingsAndSorting ( )

Save settings and sorting.

Parameters
@return

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

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

{
global $ilCtrl, $lng;
// save settings
$tax = $this->determineAOCurrentTaxonomy();
$tax->setSortingMode(ilUtil::stripSlashes($_POST["sorting"]));
$tax->update();
// 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, "listItems");
}

+ Here is the call graph for this function:

ilObjTaxonomyGUI::saveTaxNode ( )

Save tax node form.

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

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

{
global $tpl, $lng, $ilCtrl;
$this->initTaxNodeForm("create");
if ($this->form->checkInput())
{
$tax = $this->determineAOCurrentTaxonomy();
// create node
include_once("./Services/Taxonomy/classes/class.ilTaxonomyNode.php");
$node = new ilTaxonomyNode();
$node->setTitle($this->form->getInput("title"));
$tax = $this->determineAOCurrentTaxonomy();
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"]);
}
$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, "listItems");
}
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 47 of file class.ilObjTaxonomyGUI.php.

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

Show Editing Tree.

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

References $_GET, $ilCtrl, $ilUser, ilObjectGUI\$lng, $path, ilObjectGUI\$tpl, exit, and ilExplorer\setTargetGet().

Referenced by listItems().

{
global $ilUser, $tpl, $ilCtrl, $lng;
require_once ("./Services/Taxonomy/classes/class.ilTaxonomyExplorer.php");
$exp = new ilTaxonomyExplorer($ilCtrl->getLinkTarget($this, "listItems"), $a_tax_tree);
$exp->setTargetGet("tax_node");
$exp->setExpandTarget($ilCtrl->getLinkTarget($this, "listItems"));
if ($_GET["txexpand"] == "")
{
$expanded = $a_tax_tree->readRootId();
}
else
{
$expanded = $_GET["txexpand"];
}
if ($_GET["tax_node"] > 0)
{
$path = $a_tax_tree->getPathId($_GET["tax_node"]);
$exp->setForceOpenPath($path);
$exp->highlightNode($_GET["tax_node"]);
}
else
{
$exp->highlightNode($a_tax_tree->readRootId());
}
$exp->setExpand($expanded);
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
// asynchronous output
if ($ilCtrl->isAsynch())
{
echo $output; exit;
}
$tpl->setLeftContent($output);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjTaxonomyGUI::updateTaxNode ( )

Update tax node.

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, determineAOCurrentTaxonomy(), 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->determineAOCurrentTaxonomy();
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:


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