ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPersonalSkillsGUI Class Reference

Personal skills GUI class. More...

+ Collaboration diagram for ilPersonalSkillsGUI:

Public Member Functions

 __construct ()
 Contructor.
 executeCommand ()
 Execute command.
 setTabs ($a_activate)
 Set tabs.
 setOfflineMode ($a_file_path)
 listSkills ()
 List skills.
 getSkillHTML ($a_top_skill_id, $a_user_id=0, $a_edit=false)
 Get skill presentation HTML.
 getTooltipsJs ()
 getMaterialInfo ($a_wsp_id)
 Get material file name and goto url.
 addSkill ()
 Add personal skill.
 confirmSkillRemove ()
 Confirm skill remove.
 removeSkills ()
 Remove skills.
 assignMaterials ()
 Assign materials to skill levels.
 assignMaterial ()
 Assign materials to skill level.
 selectMaterial ()
 Select material.
 removeMaterial ()
 Remove material.
 selfEvaluation ()
 Assign materials to skill levels.
 saveSelfEvaluation ()
 Save self evaluation.
 listSkillsForAdd ()
 LIst skills for adding.

Static Public Attributes

static $skill_tt_cnt = 1

Protected Attributes

 $offline_mode
 $skill_tree

Detailed Description

Personal skills GUI class.

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

ilPersonalSkillsGUI:

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

Constructor & Destructor Documentation

ilPersonalSkillsGUI::__construct ( )

Contructor.

public

Definition at line 28 of file class.ilPersonalSkillsGUI.php.

References $ilCtrl, and $lng.

{
global $ilCtrl, $lng;
$lng->loadLanguageModule('skmg');
$ilCtrl->saveParameter($this, "skill_id");
$ilCtrl->saveParameter($this, "tref_id");
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$this->skill_tree = new ilSkillTree();
}

Member Function Documentation

ilPersonalSkillsGUI::addSkill ( )

Add personal skill.

Definition at line 405 of file class.ilPersonalSkillsGUI.php.

References $_GET, $ilCtrl, $lng, ilPersonalSkill\addPersonalSkill(), and ilUtil\sendSuccess().

{
global $ilUser, $ilCtrl, $lng;
ilPersonalSkill::addPersonalSkill($ilUser->getId(), (int) $_GET["obj_id"]);
ilUtil::sendSuccess($lng->txt("msg_object_modified"));
$ilCtrl->redirect($this, "listSkills");
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::assignMaterial ( )

Assign materials to skill level.

Parameters
@return

Definition at line 542 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, $tpl, and ilWorkspaceExplorer\SEL_TYPE_CHECK.

Referenced by selectMaterial().

{
global $tpl, $ilUser, $ilCtrl, $ilTabs, $lng;
$ilCtrl->saveParameter($this, "skill_id");
$ilCtrl->saveParameter($this, "level_id");
$ilCtrl->saveParameter($this, "tref_id");
$ilCtrl->saveParameter($this, "basic_skill_id");
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "assignMaterials"));
// get ws tree
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
$tree = new ilWorkspaceTree($ilUser->getId());
// get access handler
include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
$acc_handler = new ilWorkspaceAccessHandler($tree);
// get es explorer
include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php");
'skill_wspexpand', $tree, $acc_handler);
$exp->setTargetGet('wsp_id');
$exp->setFiltered(false);
$exp->removeAllFormItemTypes();
$exp->addFormItemForType("file");
$exp->addFormItemForType("tstv");
$exp->addFormItemForType("excv");
if($_GET['skill_wspexpand'] == '')
{
// not really used as session is already set [see above]
$expanded = $tree->readRootId();
}
else
{
$expanded = $_GET['skill_wspexpand'];
}
$exp->setCheckedItems(array((int)$_POST['wsp_id']));
$exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'assignMaterial'));
$exp->setPostVar('wsp_id[]');
$exp->setExpand($expanded);
$exp->setOutput(0);
// fill template
$mtpl = new ilTemplate("tpl.materials_selection.html", true, true, "Services/Skill");
$mtpl->setVariable("EXP", $exp->getOutput());
// toolbars
$tb = new ilToolbarGUI();
$tb->addFormButton($lng->txt("select"),
"selectMaterial");
$tb->setFormAction($ilCtrl->getFormAction($this));
$tb->setOpenFormTag(true);
$tb->setCloseFormTag(false);
$mtpl->setVariable("TOOLBAR1", $tb->getHTML());
$tb->setOpenFormTag(false);
$tb->setCloseFormTag(true);
$mtpl->setVariable("TOOLBAR2", $tb->getHTML());
$tpl->setContent($mtpl->get());
}

+ Here is the caller graph for this function:

ilPersonalSkillsGUI::assignMaterials ( )

Assign materials to skill levels.

Parameters
@return

Definition at line 482 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, $tab, $tpl, ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ilUtil\getImagePath(), ilSkillTreeNode\getSkillTreeNodes(), and ilSelectInputGUI\setOptions().

{
global $ilTabs, $lng, $ilCtrl, $tpl, $ilToolbar;
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "listSkills"));
$ilCtrl->saveParameter($this, "skill_id");
$ilCtrl->saveParameter($this, "basic_skill_id");
$ilCtrl->saveParameter($this, "tref_id");
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
$tpl->setTitleIcon(ilUtil::getImagePath("icon_".
ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]).
"_b.gif"));
// basic skill selection
// here basic skill id??
$bs = ilSkillTreeNode::getSkillTreeNodes((int) $_GET["skill_id"], true);
$options = array();
foreach ($bs as $b)
{
$options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
}
$cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
? (int) $_POST["basic_skill_id"]
: (((int) $_GET["basic_skill_id"] > 0)
? (int) $_GET["basic_skill_id"]
: key($options));
$ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
$si->setOptions($options);
$si->setValue($cur_basic_skill_id);
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($lng->txt("select"),
"assignMaterials");
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
// table
include_once("./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
$tab = new ilSkillAssignMaterialsTableGUI($this, "assignMaterials",
(int) $_GET["skill_id"], (int) $_GET["tref_id"], $cur_basic_skill_id);
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::confirmSkillRemove ( )

Confirm skill remove.

Definition at line 420 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, $tpl, ilSkillTreeNode\_lookupTitle(), and ilUtil\sendInfo().

{
global $ilCtrl, $tpl, $lng;
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
if ($_GET["skill_id"] > 0)
{
$_POST["id"][] = $_GET["skill_id"];
}
if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listSkills");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("skmg_really_remove_skills"));
$cgui->setCancel($lng->txt("cancel"), "listSkills");
$cgui->setConfirm($lng->txt("delete"), "removeSkills");
foreach ($_POST["id"] as $i)
{
$cgui->addItem("id[]", $i, ilSkillTreeNode::_lookupTitle($i));
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::executeCommand ( )

Execute command.

public

Definition at line 47 of file class.ilPersonalSkillsGUI.php.

References $cmd, $ilCtrl, $lng, $tpl, and ilUtil\getImagePath().

{
global $ilCtrl, $tpl, $lng;
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd("listSkills");
$tpl->setTitle($lng->txt("skills"));
$tpl->setTitleIcon(ilUtil::getImagePath("icon_skmg_b.gif"));
switch($next_class)
{
default:
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::getMaterialInfo (   $a_wsp_id)

Get material file name and goto url.

Parameters
int$a_wsp_id
Returns
array caption, url

Definition at line 354 of file class.ilPersonalSkillsGUI.php.

References $file, ilObject\_lookupTitle(), and ilObject\_lookupType().

Referenced by getSkillHTML().

{
global $ilUser;
if(!$this->ws_tree)
{
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
$this->ws_tree = new ilWorkspaceTree($ilUser->getId());
$this->ws_access = new ilWorkspaceAccessHandler($caption);
}
$obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
$caption = ilObject::_lookupTitle($obj_id);
if(!$this->offline_mode)
{
$url = $this->ws_access->getGotoLink($a_wsp_id, $obj_id);
}
else
{
$url = $this->offline_mode."file_".$obj_id."/";
// all possible material types for now
switch(ilObject::_lookupType($obj_id))
{
case "tstv":
include_once "Modules/Test/classes/class.ilObjTestVerification.php";
$obj = new ilObjTestVerification($obj_id, false);
$url .= $obj->getOfflineFilename();
break;
case "excv":
include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
$obj = new ilObjExerciseVerification($obj_id, false);
$url .= $obj->getOfflineFilename();
break;
case "file":
$file = new ilObjFile($obj_id, false);
$url .= $file->getFilename();
break;
}
}
return array($caption, $url);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSkillsGUI::getSkillHTML (   $a_top_skill_id,
  $a_user_id = 0,
  $a_edit = false 
)

Get skill presentation HTML.

Returns

Definition at line 140 of file class.ilPersonalSkillsGUI.php.

References $ilCtrl, $lng, $path, $title, $tpl, ilSkillTreeNode\_lookupTitle(), ilTooltipGUI\addTooltip(), ilPersonalSkill\countAssignedMaterial(), ilAdvancedSelectionListGUI\DOWN_ARROW_DARK, ilPersonalSkill\getAssignedMaterial(), ilSkillTreeNodeFactory\getInstance(), getMaterialInfo(), ilPersonalSkill\getSelfEvaluation(), and ilSkillTreeNode\getSkillTreeNodes().

Referenced by listSkills().

{
global $ilUser, $lng, $ilCtrl;
$this->tooltips = array();
if ($a_user_id == 0)
{
$user = $ilUser;
}
else
{
$user = new ilObjUser($a_user_id);
}
$tpl = new ilTemplate("tpl.skill_pres.html", true, true, "Services/Skill");
include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$stree = new ilSkillTree();
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
// general settings for the action drop down
include_once("Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$act_list = new ilAdvancedSelectionListGUI();
$act_list->setListTitle($lng->txt("actions"));
$act_list->setSelectionHeaderClass("small");
// $act_list->setLinksMode("il_ContainerItemCommand2");
$act_list->setUseImages(false);
$b_skills = ilSkillTreeNode::getSkillTreeNodes($a_top_skill_id, true);
foreach ($b_skills as $bs)
{
$path = $stree->getSkillTreePath($bs["id"], $bs["tref"]);
// check draft
foreach ($path as $p)
{
if ($p["draft"])
{
continue(2);
}
}
reset($path);
$se_level = ilPersonalSkill::getSelfEvaluation($user->getId(),
$a_top_skill_id, $bs["tref"], $bs["id"]);
$level_data = $skill->getLevelData();
// check, if current self eval level is in current level data
$valid_sel_level = false;
if ($se_level > 0)
{
foreach ($level_data as $k => $v)
{
if ($v["id"] == $se_level)
{
$valid_sel_level = true;
}
}
}
reset($level_data);
$found = false;
foreach ($level_data as $k => $v)
{
// level
$tpl->setCurrentBlock("level_td");
$tpl->setVariable("VAL_LEVEL", $v["title"]);
$tt_id = "skmg_skl_tt_".self::$skill_tt_cnt;
self::$skill_tt_cnt++;
$tpl->setVariable("TT_ID", $tt_id);
if ($v["description"] != "")
{
ilTooltipGUI::addTooltip($tt_id, $v["description"]);
}
$tpl->parseCurrentBlock();
// self evaluation
$tpl->setCurrentBlock("self_eval_td");
if ($valid_sel_level && !$found)
{
$tpl->setVariable("VAL_SELF_EVAL", "x");
$tpl->setVariable("CLASS_SELF_EVAL", "ilSkillSelf");
}
else
{
$tpl->setVariable("VAL_SELF_EVAL", " ");
}
$tpl->parseCurrentBlock();
if ($v["id"] == $se_level)
{
$found = true;
}
// assigned materials
$mat_cnt = ilPersonalSkill::countAssignedMaterial($user->getId(),
$bs["tref"], $v["id"]);
if ($mat_cnt == 0)
{
$tpl->setCurrentBlock("material_td");
$tpl->setVariable("VAL_MATERIAL", " ");
$tpl->parseCurrentBlock();
}
else
{
// links to material files
$tpl->setCurrentBlock("material_links");
$mat_tt = array();
$cnt = 1;
foreach(ilPersonalSkill::getAssignedMaterial($user->getId(),
$bs["tref"], $v["id"]) as $item)
{
$mat_data = $this->getMaterialInfo($item["wsp_id"]);
$tpl->setVariable("URL_MATERIAL", $mat_data[1]);
$tpl->setVariable("TXT_MATERIAL", $cnt);
// tooltip
$mat_tt_id = "skmg_skl_tt_mat_".self::$skill_tt_cnt;
self::$skill_tt_cnt++;
$tpl->setVariable("TOOLTIP_MATERIAL_ID", $mat_tt_id);
if(!$this->offline_mode)
{
ilTooltipGUI::addTooltip($mat_tt_id, $mat_data[0]);
}
else
{
$this->tooltips[] = ilTooltipGUI::getTooltip($mat_tt_id, $mat_data[0]);
}
$tpl->parseCurrentBlock();
$cnt++;
}
$tpl->setCurrentBlock("material_td");
$tpl->setVariable("CLASS_MAT", "ilSkillMat");
$tpl->parseCurrentBlock();
}
}
$title = $sep = "";
$found = false;
foreach ($path as $p)
{
if ($found)
{
$title.= $sep.$p["title"];
$sep = " > ";
}
if ($a_top_skill_id == $p["child"])
{
$found = true;
}
}
$tpl->setCurrentBlock("skill");
$tpl->setVariable("BSKILL_TITLE", $title);
$tpl->setVariable("TXT_LEVEL", $lng->txt("skmg_level"));
$tpl->setVariable("TXT_SELF_EVAL", $lng->txt("skmg_self_evaluation"));
$tpl->setVariable("TXT_MATERIAL", $lng->txt("skmg_material"));
if ($a_edit)
{
$act_list->flush();
$act_list->setId("act_".$a_top_skill_id."_".$bs["id"]);
$ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
$ilCtrl->setParameterByClass("ilpersonalskillsgui", "tref_id", $bs["tref"]);
$ilCtrl->setParameterByClass("ilpersonalskillsgui", "basic_skill_id", $bs["id"]);
$act_list->addItem($lng->txt('skmg_assign_materials'), "",
$ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials"));
$act_list->addItem($lng->txt('skmg_self_evaluation'), "",
$ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "selfEvaluation"));
$tpl->setVariable("ACTIONS2", $act_list->getHTML());
}
$tpl->parseCurrentBlock();
}
$tpl->setVariable("SKILL_TITLE", ilSkillTreeNode::_lookupTitle($a_top_skill_id));
if ($a_edit)
{
$act_list->flush();
$act_list->setId("act_".$a_top_skill_id);
$ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
// $act_list->addItem($lng->txt('skmg_assign_materials'), "",
// $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials"));
$act_list->addItem($lng->txt('skmg_remove_skill'), "",
$ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "confirmSkillRemove"));
$tpl->setVariable("ACTIONS1", $act_list->getHTML());
}
return $tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSkillsGUI::getTooltipsJs ( )

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

{
return $this->tooltips;
}
ilPersonalSkillsGUI::listSkills ( )

List skills.

Definition at line 94 of file class.ilPersonalSkillsGUI.php.

References $ilCtrl, $lng, $path, $tpl, ilPersonalSkill\getSelectedUserSkills(), getSkillHTML(), and setTabs().

{
global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar, $ilUser;
$this->setTabs("list_skills");
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$stree = new ilSkillTree();
// skill selection / add new personal skill
$ilToolbar->addFormButton($lng->txt("skmg_add_skill"),
"listSkillsForAdd");
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$skills = ilPersonalSkill::getSelectedUserSkills($ilUser->getId());
$html = "";
foreach ($skills as $s)
{
$path = $stree->getSkillTreePath($s["skill_node_id"]);
// check draft
foreach ($path as $p)
{
if ($p["draft"])
{
continue(2);
}
}
$html.= $this->getSkillHTML($s["skill_node_id"], 0, true);
}
// list skills
// include_once("./Services/Skill/classes/class.ilPersonalSkillTableGUI.php");
// $sktab = new ilPersonalSkillTableGUI($this, "listSkills");
$tpl->setContent($html);
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::listSkillsForAdd ( )

LIst skills for adding.

Parameters
@return

Definition at line 739 of file class.ilPersonalSkillsGUI.php.

References $_GET, $ilCtrl, $lng, $path, $skill_tree, $tpl, exit, ilUtil\sendInfo(), and ilExplorer\setTargetGet().

{
global $ilUser, $tpl, $ilCtrl, $lng, $ilTabs;
ilUtil::sendInfo($lng->txt("skmg_select_skill"));
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, ""));
include_once("./Services/Skill/classes/class.ilSkillTree.php");
require_once ("./Services/Skill/classes/class.ilPersonalSkillExplorer.php");
$exp = new ilPersonalSkillExplorer($ilCtrl->getLinkTarget($this, "listSkillsForAdd"));
$exp->setTargetGet("obj_id");
$exp->setExpandTarget($ilCtrl->getLinkTarget($this, "listSkillsForAdd"));
if ($_GET["skpexpand"] == "")
{
$expanded = $skill_tree->readRootId();
}
else
{
$expanded = $_GET["skpexpand"];
}
if ($_GET["obj_id"] > 0)
{
$path = $this->skill_tree->getPathId($_GET["obj_id"]);
$exp->setForceOpenPath($path);
$exp->highlightNode($_GET["obj_id"]);
}
else
{
$exp->highlightNode($this->skill_tree->readRootId());
}
$exp->setExpand($expanded);
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
// asynchronous output
if ($ilCtrl->isAsynch())
{
echo $output; exit;
}
$tpl->setContent($output);
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::removeMaterial ( )

Remove material.

Definition at line 638 of file class.ilPersonalSkillsGUI.php.

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

{
global $ilUser, $lng, $ilCtrl;
ilPersonalSkill::removeMaterial($ilUser->getId(), (int) $_GET["tref_id"],
(int) $_GET["level_id"],
(int) $_GET["wsp_id"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "assignMaterials");
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::removeSkills ( )

Remove skills.

Definition at line 455 of file class.ilPersonalSkillsGUI.php.

References $_POST, $ilCtrl, $lng, ilPersonalSkill\removeSkill(), and ilUtil\sendSuccess().

{
global $ilUser, $lng, $ilCtrl;
if (is_array($_POST["id"]))
{
foreach ($_POST["id"] as $n_id)
{
ilPersonalSkill::removeSkill($ilUser->getId(), $n_id);
}
}
ilUtil::sendSuccess($lng->txt("msg_object_modified"));
$ilCtrl->redirect($this, "listSkills");
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::saveSelfEvaluation ( )

Save self evaluation.

Definition at line 716 of file class.ilPersonalSkillsGUI.php.

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

{
global $ilUser, $lng, $ilCtrl;
ilPersonalSkill::saveSelfEvaluation($ilUser->getId(), (int) $_GET["skill_id"],
(int) $_GET["tref_id"], (int) $_GET["basic_skill_id"], (int) $_POST["se"]);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
/* $ilCtrl->saveParameter($this, "skill_id");
$ilCtrl->saveParameter($this, "level_id");
$ilCtrl->saveParameter($this, "tref_id");
$ilCtrl->saveParameter($this, "basic_skill_id");*/
$ilCtrl->redirect($this, "listSkills");
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::selectMaterial ( )

Select material.

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

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

{
global $ilUser, $ilCtrl, $lng;
include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
if (is_array($_POST["wsp_id"]))
{
foreach ($_POST["wsp_id"] as $w)
{
ilPersonalSkill::assignMaterial($ilUser->getId(), (int) $_GET["skill_id"],
(int) $_GET["tref_id"],
(int) $_GET["basic_skill_id"], (int) $_GET["level_id"], (int) $w);
}
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
}
$ilCtrl->saveParameter($this, "skill_id");
$ilCtrl->saveParameter($this, "level_id");
$ilCtrl->saveParameter($this, "tref_id");
$ilCtrl->saveParameter($this, "basic_skill_id");
$ilCtrl->redirect($this, "assignMaterials");
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::selfEvaluation ( )

Assign materials to skill levels.

Parameters
@return

Definition at line 660 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, $tab, $tpl, ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ilUtil\getImagePath(), ilSkillTreeNode\getSkillTreeNodes(), and ilSelectInputGUI\setOptions().

{
global $ilTabs, $lng, $ilCtrl, $tpl, $ilToolbar;
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "listSkills"));
$ilCtrl->saveParameter($this, "skill_id");
$ilCtrl->saveParameter($this, "basic_skill_id");
$ilCtrl->saveParameter($this, "tref_id");
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
$tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
$tpl->setTitleIcon(ilUtil::getImagePath("icon_".
ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]).
"_b.gif"));
// basic skill selection
// here basic skill id??
$bs = ilSkillTreeNode::getSkillTreeNodes((int) $_GET["skill_id"], true);
$options = array();
foreach ($bs as $b)
{
$options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
}
$cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
? (int) $_POST["basic_skill_id"]
: (((int) $_GET["basic_skill_id"] > 0)
? (int) $_GET["basic_skill_id"]
: key($options));
$ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
$si->setOptions($options);
$si->setValue($cur_basic_skill_id);
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($lng->txt("select"),
"selfEvaluation");
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
// table
include_once("./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
$tab = new ilSelfEvaluationSimpleTableGUI($this, "selfEvaluation",
(int) $_GET["skill_id"], (int) $_GET["tref_id"], $cur_basic_skill_id);
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

ilPersonalSkillsGUI::setOfflineMode (   $a_file_path)

Definition at line 86 of file class.ilPersonalSkillsGUI.php.

{
$this->offline_mode = $a_file_path;
}
ilPersonalSkillsGUI::setTabs (   $a_activate)

Set tabs.

Definition at line 69 of file class.ilPersonalSkillsGUI.php.

References $ilCtrl, and $lng.

Referenced by listSkills().

{
global $ilTabs, $lng, $ilCtrl;
// list skills
$ilTabs->addTab("list_skills",
$lng->txt("skmg_list_skills"),
$ilCtrl->getLinkTarget($this, "listSkills"));
// assign materials
/* $ilTabs->addTab("assign_materials",
$lng->txt("skmg_assign_materials"),
$ilCtrl->getLinkTarget($this, "assignMaterials"));*/
$ilTabs->activateTab($a_activate);
}

+ Here is the caller graph for this function:

Field Documentation

ilPersonalSkillsGUI::$offline_mode
protected

Definition at line 19 of file class.ilPersonalSkillsGUI.php.

ilPersonalSkillsGUI::$skill_tree
protected

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

Referenced by listSkillsForAdd().

ilPersonalSkillsGUI::$skill_tt_cnt = 1
static

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


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