ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSkillTreeNodeGUI Class Reference

Basic GUI class for skill tree nodes. More...

+ Inheritance diagram for ilSkillTreeNodeGUI:
+ Collaboration diagram for ilSkillTreeNodeGUI:

Public Member Functions

 ilSkillTreeNodeGUI ($a_node_id=0)
 constructor
 setParentGUI ($a_parentgui)
 Set Parent GUI class.
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).
 readNodeObject ($a_node_id)
 Get node object instance.
 saveAllTitles ()
 Save Titles.
 deleteNodes ()
 Delete nodes in the hierarchy.
 cutItems ()
 Copy items to clipboard, then cut them from the current tree.
 copyItems ()
 Copy items to clipboard.
 cancelDelete ()
 cancel delete
 confirmedDelete ()
 confirmed delete
 setLocator ()
 Set Locator Items.
 setSkillNodeDescription ()
 Set skill node description.
 create ()
 Create skill tree node.
 editProperties ()
 Edit properties form.
 getPropertyValues ()
 Get property values for edit form.
 save ()
 Save skill tree node.
 afterSave ()
 After saving.
 update ()
 Update skill tree node.
 afterUpdate ()
 After update.
 initForm ($a_mode="edit")
 Init form.
 cancelSave ()
 Cancel saving.
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id)
 saveOrder ()
 Save order.
 insertBasicSkillClip ()
 Insert basic skills from clipboard.
 insertSkillCategoryClip ()
 Insert skill categories from clipboard.
 insertTemplateReferenceClip ()
 Insert skill template references from clipboard.
 insertSkillTemplateClip ()
 Insert skill template from clipboard.
 insertTemplateCategoryClip ()
 Insert skill template category from clipboard.
 setTitleIcon ()
 Set title icon.

Data Fields

 $node_object

Detailed Description

Basic GUI class for skill tree nodes.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilSkillTreeNodeGUI.php.

Member Function Documentation

ilSkillTreeNodeGUI::afterSave ( )

After saving.

Reimplemented in ilBasicSkillTemplateGUI, ilSkillTemplateCategoryGUI, and ilBasicSkillGUI.

Definition at line 334 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

Referenced by save().

{
$this->redirectToParent();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::afterUpdate ( )

After update.

Definition at line 365 of file class.ilSkillTreeNodeGUI.php.

References $ilCtrl.

Referenced by update().

{
global $ilCtrl;
$ilCtrl->redirect($this, "editProperties");
}

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::cancelDelete ( )

cancel delete

Reimplemented in ilSkillRootGUI.

Definition at line 178 of file class.ilSkillTreeNodeGUI.php.

References $ilCtrl, and redirectToParent().

{
global $ilCtrl;
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::cancelSave ( )

Cancel saving.

Parameters
@return

Definition at line 423 of file class.ilSkillTreeNodeGUI.php.

References redirectToParent().

{
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::confirmedDelete ( )

confirmed delete

Definition at line 188 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, getParentGUI(), redirectToParent(), and ilSkillTreeNode\saveChildsOrder().

{
global $ilCtrl;
$this->getParentGUI()->confirmedDelete(false);
ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
$_GET["tmpmode"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::copyItems ( )

Copy items to clipboard.

Definition at line 136 of file class.ilSkillTreeNodeGUI.php.

References $_POST, $ilCtrl, $lng, ilSkillTreeNode\clipboardCopy(), redirectToParent(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSkillTreeNode\uniqueTypesCheck().

{
global $ilCtrl, $lng;
if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
{
$this->redirectToParent();
}
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$todel = array(); // delete IDs < 0 (needed for non-js editing)
foreach($items as $k => $item)
{
if ($item < 0)
{
$todel[] = $k;
}
}
foreach($todel as $k)
{
unset($items[$k]);
}
{
ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
$this->redirectToParent();
}
// @todo: move this to a service since it can be used here, too
include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_copied"), true);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::create ( )

Create skill tree node.

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

References $tpl, and initForm().

{
global $tpl;
$this->initForm("create");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::cutItems ( )

Copy items to clipboard, then cut them from the current tree.

Definition at line 89 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, ilSkillTreeNode\clipboardCut(), redirectToParent(), ilSkillTreeNode\saveChildsOrder(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilSkillTreeNode\uniqueTypesCheck().

{
global $ilCtrl, $lng;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
{
$this->redirectToParent();
}
$todel = array(); // delete IDs < 0 (needed for non-js editing)
foreach($items as $k => $item)
{
if ($item < 0)
{
$todel[] = $k;
}
}
foreach($todel as $k)
{
unset($items[$k]);
}
{
ilUtil::sendInfo($lng->txt("skmg_insert_please_choose_one_type_only"), true);
$this->redirectToParent();
}
include_once("./Modules/LearningModule/classes/class.ilEditClipboard.php");
ilUtil::sendInfo($lng->txt("skmg_selected_items_have_been_cut"), true);
ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
$_GET["tmpmode"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::deleteNodes ( )

Delete nodes in the hierarchy.

Definition at line 78 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$ilCtrl->setParameter($this, "backcmd", $_GET["backcmd"]);
$this->getParentGUI()->deleteNodes($this);
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::editProperties ( )

Edit properties form.

Reimplemented in ilBasicSkillGUI, ilSkillTemplateCategoryGUI, ilSkillTemplateReferenceGUI, and ilSkillCategoryGUI.

Definition at line 283 of file class.ilSkillTreeNodeGUI.php.

References $tpl, getPropertyValues(), and initForm().

{
global $tpl;
$this->initForm("edit");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::getParentGUI ( )

Get Parent GUI class (ilObjSCORM2004LearningModuleGUI).

Returns
object Parent GUI class

Definition at line 50 of file class.ilSkillTreeNodeGUI.php.

Referenced by confirmedDelete(), deleteNodes(), ilSkillRootGUI\listSkills(), ilSkillRootGUI\listTemplates(), saveAllTitles(), and setLocator().

{
return $this->parentgui;
}

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::getPropertyValues ( )

Get property values for edit form.

Definition at line 295 of file class.ilSkillTreeNodeGUI.php.

Referenced by editProperties().

{
$values = array();
$values["title"] = $this->node_object->getTitle();
$values["order_nr"] = $this->node_object->getOrderNr();
$values["self_eval"] = $this->node_object->getSelfEvaluation();
$values["draft"] = $this->node_object->getDraft();
$this->form->setValuesByArray($values);
}

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::ilSkillTreeNodeGUI (   $a_node_id = 0)

constructor

Parameters
object$a_content_objnode object

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

References ilSkillTreeNode\_lookupType(), and readNodeObject().

Referenced by ilSkillCategoryGUI\__construct(), ilSkillTemplateReferenceGUI\__construct(), ilSkillRootGUI\__construct(), ilSkillTemplateGUI\__construct(), ilBasicSkillTemplateGUI\__construct(), ilSkillTemplateCategoryGUI\__construct(), and ilBasicSkillGUI\__construct().

{
$this->node_object = null;
if ($a_node_id > 0 &&
$this->getType() == ilSkillTreeNode::_lookupType($a_node_id))
{
$this->readNodeObject((int) $a_node_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::initForm (   $a_mode = "edit")

Init form.

Parameters
int$a_modeEdit Mode

Reimplemented in ilBasicSkillGUI, ilSkillTemplateReferenceGUI, ilSkillCategoryGUI, and ilBasicSkillTemplateGUI.

Definition at line 377 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $lng, ilNumberInputGUI\setMaxLength(), and ilTextInputGUI\setMaxLength().

Referenced by create(), editProperties(), save(), and update().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(200);
$ti->setSize(50);
$ti->setRequired(true);
$this->form->addItem($ti);
// order nr
$ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
$ni->setMaxLength(6);
$ni->setSize(6);
$ni->setRequired(true);
$this->form->addItem($ni);
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("save", $lng->txt("save"));
$this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("skmg_create_".$this->getType()));
}
else
{
$this->form->addCommandButton("update", $lng->txt("save"));
$this->form->setTitle($lng->txt("skmg_edit_".$this->getType()));
}
$ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::insertBasicSkillClip ( )

Insert basic skills from clipboard.

Definition at line 488 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

{
global $ilCtrl, $ilUser;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$nodes = ilSkillTreeNode::insertItemsFromClip("skll", (int) $_GET["obj_id"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::insertSkillCategoryClip ( )

Insert skill categories from clipboard.

Definition at line 500 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

{
global $ilCtrl, $ilUser;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$nodes = ilSkillTreeNode::insertItemsFromClip("scat", (int) $_GET["obj_id"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::insertSkillTemplateClip ( )

Insert skill template from clipboard.

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

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

{
global $ilCtrl, $ilUser;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$nodes = ilSkillTreeNode::insertItemsFromClip("sktp", (int) $_GET["obj_id"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::insertTemplateCategoryClip ( )

Insert skill template category from clipboard.

Definition at line 536 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

{
global $ilCtrl, $ilUser;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$nodes = ilSkillTreeNode::insertItemsFromClip("sctp", (int) $_GET["obj_id"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::insertTemplateReferenceClip ( )

Insert skill template references from clipboard.

Definition at line 512 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $ilUser, ilSkillTreeNode\insertItemsFromClip(), and redirectToParent().

{
global $ilCtrl, $ilUser;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$nodes = ilSkillTreeNode::insertItemsFromClip("sktr", (int) $_GET["obj_id"]);
$this->redirectToParent();
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::readNodeObject (   $a_node_id)

Get node object instance.

Definition at line 58 of file class.ilSkillTreeNodeGUI.php.

References ilSkillTreeNodeFactory\getInstance().

Referenced by ilSkillTreeNodeGUI().

{
include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
$this->node_object = ilSkillTreeNodeFactory::getInstance($a_node_id);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::redirectToParent (   $a_tmp_mode = false)

Redirect to parent (identified by current obj_id)

Parameters
@return

Definition at line 434 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $t, and ilSkillTreeNode\_lookupType().

Referenced by ilSkillTemplateCategoryGUI\afterSave(), afterSave(), cancelDelete(), cancelSave(), confirmedDelete(), copyItems(), cutItems(), insertBasicSkillClip(), insertSkillCategoryClip(), insertSkillTemplateClip(), insertTemplateCategoryClip(), insertTemplateReferenceClip(), and saveOrder().

{
global $ilCtrl;
if ($_GET["tmpmode"])
{
$a_tmp_mode = true;
}
switch ($t)
{
case "skrt":
$ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
if ($a_tmp_mode)
{
$ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
}
else
{
$ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
}
break;
case "sctp":
$ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", (int) $_GET["obj_id"]);
$ilCtrl->redirectByClass("ilskilltemplatecategorygui", "listItems");
break;
case "scat":
$ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", (int) $_GET["obj_id"]);
$ilCtrl->redirectByClass("ilskillcategorygui", "listItems");
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::save ( )

Save skill tree node.

Definition at line 311 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, afterSave(), initForm(), ilSkillTreeNode\saveChildsOrder(), and ilUtil\sendSuccess().

{
global $tpl, $lng, $ilCtrl;
$this->initForm("create");
if ($this->form->checkInput())
{
$this->saveItem();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], array(),
in_array($this->getType(), array("sktp", "sctp")));
$this->afterSave();
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::saveAllTitles ( )

Save Titles.

Definition at line 67 of file class.ilSkillTreeNodeGUI.php.

References $ilCtrl, and getParentGUI().

{
global $ilCtrl;
$this->getParentGUI()->saveAllTitles(false);
$ilCtrl->redirect($this, "showOrganization");
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::saveOrder ( )

Save order.

Definition at line 475 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, redirectToParent(), ilSkillTreeNode\saveChildsOrder(), and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
ilSkillTreeNode::saveChildsOrder((int) $_GET["obj_id"], $_POST["order"],
(int) $_GET["tmpmode"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$this->redirectToParent((int) $_GET["tmpmode"]);
}

+ Here is the call graph for this function:

ilSkillTreeNodeGUI::setLocator ( )

Set Locator Items.

Definition at line 202 of file class.ilSkillTreeNodeGUI.php.

References $_GET, $ilCtrl, $path, $tpl, ilUtil\getImagePath(), and getParentGUI().

Referenced by ilBasicSkillGUI\showProperties().

{
global $ilLocator, $tpl, $ilCtrl;
$ilLocator->addRepositoryItems($_GET["ref_id"]);
$this->getParentGUI()->addLocatorItems();
if ($_GET["obj_id"] > 0)
{
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$tree = new ilSkillTree();
$path = $tree->getPathFull($_GET["obj_id"]);
for( $i = 1; $i < count($path); $i++)
{
switch($path[$i]["type"])
{
case "scat":
$ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
"ilskillcategorygui"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_skmg_s.png"));
break;
case "skll":
$ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id",
$path[$i]["child"]);
$ilLocator->addItem($path[$i]["title"],
$ilCtrl->getLinkTargetByClass("ilskillmanagementgui",
"ilbasicskillgui"), "", 0, $path[$i]["type"],
ilUtil::getImagePath("icon_skmg_s.png"));
break;
}
}
}
$ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
$tpl->setLocator();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::setParentGUI (   $a_parentgui)

Set Parent GUI class.

Parameters
object$a_parentguiParent GUI class

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

{
$this->parentgui = $a_parentgui;
}
ilSkillTreeNodeGUI::setSkillNodeDescription ( )

Set skill node description.

Definition at line 247 of file class.ilSkillTreeNodeGUI.php.

References $path, and $tpl.

Referenced by ilBasicSkillTemplateGUI\setSkillHead(), ilBasicSkillGUI\setSkillHead(), ilSkillTemplateReferenceGUI\setTabs(), ilSkillCategoryGUI\setTabs(), and ilSkillTemplateCategoryGUI\setTabs().

{
global $tpl;
if (is_object($this->node_object))
{
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$tree = new ilSkillTree();
$path = $this->node_object->skill_tree->getPathFull($this->node_object->getId());
$desc = "";
foreach ($path as $p)
{
if (in_array($p["type"], array("scat", "skll", "sktr")))
{
$desc.= $sep.$p["title"];
$sep = " > ";
}
}
}
$tpl->setDescription($desc);
}

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::setTitleIcon ( )

Set title icon.

Definition at line 548 of file class.ilSkillTreeNodeGUI.php.

References $tpl, ilSkillTreeNode\_lookupDraft(), and ilSkillTreeNode\getIconPath().

Referenced by ilBasicSkillTemplateGUI\setSkillHead(), ilBasicSkillGUI\setSkillHead(), ilBasicSkillTemplateGUI\setTabs(), ilSkillCategoryGUI\setTabs(), ilSkillTemplateReferenceGUI\setTabs(), and ilSkillTemplateCategoryGUI\setTabs().

{
global $tpl;
$obj_id = (is_object($this->node_object))
? $this->node_object->getId()
:0;
$tpl->setTitleIcon(
$obj_id, $this->getType(), "_b",
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillTreeNodeGUI::update ( )

Update skill tree node.

Definition at line 344 of file class.ilSkillTreeNodeGUI.php.

References $ilCtrl, $lng, $tpl, afterUpdate(), initForm(), and ilUtil\sendSuccess().

{
global $tpl, $lng, $ilCtrl;
$this->initForm("edit");
if ($this->form->checkInput())
{
$this->updateItem();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$this->afterUpdate();
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}
}

+ Here is the call graph for this function:

Field Documentation

ilSkillTreeNodeGUI::$node_object

Definition at line 17 of file class.ilSkillTreeNodeGUI.php.


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