コード例 #1
0
 /**
  * Constructor
  */
 function __construct($a_parent_obj, $a_parent_cmd, $a_cskill_id, $a_usage)
 {
     global $ilCtrl, $lng, $ilAccess, $lng;
     $id_parts = explode(":", $a_cskill_id);
     $this->skill_id = $id_parts[0];
     $this->tref_id = $id_parts[1];
     $data = array();
     foreach ($a_usage as $k => $v) {
         $data[] = array("type" => $k, "usages" => $v);
     }
     parent::__construct($a_parent_obj, $a_parent_cmd);
     $this->setData($data);
     $this->setTitle(ilSkillTreeNode::_lookupTitle($this->skill_id, $this->tref_id));
     include_once "./Services/Skill/classes/class.ilSkillTree.php";
     $tree = new ilSkillTree();
     $path = $tree->getSkillTreePathAsString($this->skill_id, $this->tref_id);
     $this->setDescription($path);
     $this->addColumn($this->lng->txt("skmg_type"), "", "50%");
     $this->addColumn($this->lng->txt("skmg_number"), "", "50%");
     $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
     $this->setRowTemplate("tpl.skill_usage_row.html", "Services/Skill");
     $this->setEnableNumInfo(false);
     //		$this->addMultiCommand("", $lng->txt(""));
     //		$this->addCommandButton("", $lng->txt(""));
 }
コード例 #2
0
 /**
  * Is clickable
  *
  * @param
  * @return
  */
 function isNodeClickable($a_node)
 {
     if (in_array($a_node["type"], array("skll", "sktp"))) {
         return true;
     }
     // references that refer directly to a (basic) skill template
     if ($a_node["type"] == "sktr" && ilSkillTreeNode::_lookupType($a_node["skill_id"]) == "sktp") {
         return true;
     }
     return false;
 }
コード例 #3
0
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl;
     $this->tpl->setVariable("SE_ID", $a_set["id"]);
     $this->tpl->setVariable("VAL_CREATED", $a_set["created"]);
     $this->tpl->setVariable("VAL_LAST_UPDATE", $a_set["last_update"]);
     $this->tpl->setVariable("VAL_SKILL", ilSkillTreeNode::_lookupTitle($a_set["top_skill_id"]));
     $this->tpl->setVariable("TXT_CMD", $lng->txt("edit"));
     $ilCtrl->setParameter($this->parent_obj, "se_id", $a_set["id"]);
     $this->tpl->setVariable("HREF_CMD", $ilCtrl->getLinkTarget($this->parent_obj, "editSelfEvaluation"));
 }
コード例 #4
0
 /**
  * Get personal selected user skills
  *
  * @param int $a_user_id user id
  * @return array 
  */
 static function getSelectedUserSkills($a_user_id)
 {
     global $ilDB;
     include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
     include_once "./Services/Skill/classes/class.ilSkillTree.php";
     $stree = new ilSkillTree();
     $set = $ilDB->query("SELECT * FROM skl_personal_skill " . " WHERE user_id = " . $ilDB->quote($a_user_id, "integer"));
     $pskills = array();
     while ($rec = $ilDB->fetchAssoc($set)) {
         if ($stree->isInTree($rec["skill_node_id"])) {
             $pskills[$rec["skill_node_id"]] = array("skill_node_id" => $rec["skill_node_id"], "title" => ilSkillTreeNode::_lookupTitle($rec["skill_node_id"]));
         }
     }
     return $pskills;
 }
コード例 #5
0
 /**
  * Get node content
  *
  * @param array $a_node node data
  * @return string icon path
  */
 function getNodeIcon($a_node)
 {
     $a_parent_id_parts = explode(":", $a_node["id"]);
     $a_parent_skl_tree_id = $a_parent_id_parts[0];
     $a_parent_skl_template_tree_id = $a_parent_id_parts[1];
     // root?
     if ($a_node["type"] == "skrt") {
         $icon = ilUtil::getImagePath("icon_scat.svg");
     } else {
         if (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr", "sctp", "sktp"))) {
             $icon = ilSkillTreeNode::getIconPath($a_parent_skl_tree_id, $a_node["type"], "", $this->vtree->isDraft($a_node["id"]) || $this->vtree->isOutdated($a_node["id"]));
         } else {
             $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . ".svg");
         }
     }
     return $icon;
 }
コード例 #6
0
 /**
  * check if links for certain object type are activated
  *
  * @param	string		$a_type			object type
  *
  * @return	boolean		true if linking is activated
  */
 function isClickable($a_type, $a_obj_id = 0)
 {
     global $ilUser;
     if (!ilSkillTreeNode::_lookupSelfEvaluation($a_obj_id)) {
         return false;
     }
     return true;
 }
コード例 #7
0
 /**
  * Collect page elements (that need to be exported separately)
  *
  * @param string $a_pg_type page type
  * @param int $a_pg_id page id
  */
 function collectPageElements($a_type, $a_id)
 {
     // collect media objects
     $pg_mobs = ilObjMediaObject::_getMobsOfObject($a_type, $a_id);
     foreach ($pg_mobs as $pg_mob) {
         $this->mobs[$pg_mob] = $pg_mob;
     }
     // collect all files
     include_once "./Modules/File/classes/class.ilObjFile.php";
     $files = ilObjFile::_getFilesOfObject($a_type, $a_id);
     foreach ($files as $f) {
         $this->files[$f] = $f;
     }
     $skill_tree = $ws_tree = null;
     $pcs = ilPageContentUsage::getUsagesOfPage($a_id, $a_type);
     foreach ($pcs as $pc) {
         // skils
         if ($pc["type"] == "skmg") {
             $skill_id = $pc["id"];
             // get user id from portfolio page
             include_once "Services/Portfolio/classes/class.ilPortfolioPage.php";
             $page = new ilPortfolioPage(0, $a_id);
             $user_id = $page->create_user;
             // we only need 1 instance each
             if (!$skill_tree) {
                 include_once "Services/Skill/classes/class.ilSkillTree.php";
                 $skill_tree = new ilSkillTree();
                 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
                 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
                 $ws_tree = new ilWorkspaceTree($user_id);
             }
             // walk skill tree
             $b_skills = ilSkillTreeNode::getSkillTreeNodes($skill_id, true);
             foreach ($b_skills as $bs) {
                 $skill = ilSkillTreeNodeFactory::getInstance($bs["id"]);
                 $level_data = $skill->getLevelData();
                 foreach ($level_data as $k => $v) {
                     // get assigned materials from personal skill
                     $mat = ilPersonalSkill::getAssignedMaterial($user_id, $bs["tref"], $v["id"]);
                     if (sizeof($mat)) {
                         foreach ($mat as $item) {
                             $wsp_id = $item["wsp_id"];
                             $obj_id = $ws_tree->lookupObjectId($wsp_id);
                             // all possible material types for now
                             switch (ilObject::_lookupType($obj_id)) {
                                 case "file":
                                     $this->files[$obj_id] = $obj_id;
                                     break;
                                 case "tstv":
                                     include_once "Modules/Test/classes/class.ilObjTestVerification.php";
                                     $obj = new ilObjTestVerification($obj_id, false);
                                     $this->files_direct[$obj_id] = array($obj->getFilePath(), $obj->getOfflineFilename());
                                     break;
                                 case "excv":
                                     include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
                                     $obj = new ilObjExerciseVerification($obj_id, false);
                                     $this->files_direct[$obj_id] = array($obj->getFilePath(), $obj->getOfflineFilename());
                                     break;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
コード例 #8
0
 /**
  * Get childs of node
  *
  * @param int $a_parent_id parent id
  * @return array childs
  */
 function getChildsOfNode($a_parent_id)
 {
     $childs = $this->tree->getChilds($a_parent_id, $this->order_column);
     foreach ($childs as $c) {
         $this->parent[$c["child"]] = $c["parent"];
         if ($this->draft[$c["parent"]]) {
             $this->draft[$c["child"]] = true;
         } else {
             $this->draft[$c["child"]] = ilSkillTreeNode::_lookupDraft($c["child"]);
         }
     }
     return $childs;
 }
コード例 #9
0
 /**
  * Assign materials to skill levels
  *
  * @param
  * @return
  */
 function selfEvaluation()
 {
     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.png"));
     // 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());
 }
コード例 #10
0
 /**
  * Set title icon
  */
 function setTitleIcon()
 {
     global $tpl;
     $obj_id = is_object($this->node_object) ? $this->node_object->getId() : 0;
     $tpl->setTitleIcon(ilSkillTreeNode::getIconPath($obj_id, $this->getType(), "_b", ilSkillTreeNode::_lookupDraft($obj_id)));
 }
コード例 #11
0
 protected function renderSkillsTeaser($a_user_id, $a_skills_id)
 {
     // not used
     // $user_id = $this->getPageContentUserId($a_user_id);
     include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
     return $this->renderTeaser("skills", $this->lng->txt("skills") . ' "' . ilSkillTreeNode::_lookupTitle($a_skills_id) . '"');
 }
コード例 #12
0
 /**
  * Set title icon
  */
 function setTitleIcon()
 {
     global $tpl;
     $obj_id = is_object($this->node_object) ? $this->node_object->getId() : 0;
     $tpl->setTitleIcon(ilSkillTreeNode::getIconPath($obj_id, $this->getType(), "", ilSkillTreeNode::_lookupStatus($obj_id) == ilSkillTreeNode::STATUS_DRAFT));
 }
コード例 #13
0
 /**
  * Constructor
  * @access	public
  */
 function __construct($a_id = 0)
 {
     parent::ilSkillTreeNode($a_id);
     $this->setType("sctp");
 }
コード例 #14
0
 /**
  * Is clickable
  *
  * @param
  * @return
  */
 function isNodeClickable($a_node)
 {
     if (!ilSkillTreeNode::_lookupSelfEvaluation($a_node["child"])) {
         return false;
     }
     return true;
 }
コード例 #15
0
 /**
  * Get node content
  *
  * @param array 
  * @return
  */
 function getNodeIcon($a_node)
 {
     // root?
     if ($a_node["type"] == "skrt") {
         $icon = $this->templates ? ilUtil::getImagePath("icon_sctp_s.png") : ilUtil::getImagePath("icon_scat_s.png");
     } else {
         if (in_array($a_node["type"], array("skll", "scat", "sctr", "sktr"))) {
             $icon = ilSkillTreeNode::getIconPath($a_node["child"], $a_node["type"], "_s", $this->draft[$a_node["child"]]);
         } else {
             $icon = ilUtil::getImagePath("icon_" . $a_node["type"] . "_s.png");
         }
     }
     return $icon;
 }
コード例 #16
0
 /**
  * Delete skill
  */
 function delete()
 {
     global $ilDB;
     $ilDB->manipulate("DELETE FROM skl_templ_ref WHERE " . " skl_node_id = " . $ilDB->quote($this->getId(), "integer"));
     parent::delete();
 }
コード例 #17
0
 /**
  * Show Editing Tree
  */
 function showTree($a_templates, $a_gui = "", $a_gui_cmd = "")
 {
     global $ilUser, $tpl, $ilCtrl, $lng;
     if ($a_templates) {
         if ($_GET["obj_id"] == "" || $_GET["obj_id"] == 1) {
             return;
         }
         if ($_GET["obj_id"] > 1) {
             $path = $this->skill_tree->getPathId($_GET["obj_id"]);
             include_once "./Services/Skill/classes/class.ilSkillTreeNode.php";
             if (ilSkillTreeNode::_lookupType($path[1]) == "sktp") {
                 return;
             }
         }
     }
     include_once "./Services/Skill/classes/class.ilSkillTreeExplorerGUI.php";
     $ilCtrl->setParameter($this, "templates_tree", $a_templates);
     $exp = new ilSkillTreeExplorerGUI($this, "showTree", $a_templates);
     if (!$exp->handleCommand()) {
         $tpl->setLeftNavContent($exp->getHTML());
     }
 }
コード例 #18
0
 /**
  * Redirect to parent (identified by current obj_id)
  */
 function redirectToParent()
 {
     global $ilCtrl;
     $t = ilSkillTreeNode::_lookupType((int) $_GET["obj_id"]);
     switch ($t) {
         case "skrt":
             $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id", (int) $_GET["obj_id"]);
             $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
             break;
     }
     parent::redirectToParent();
 }
コード例 #19
0
 /**
  * Get node icon
  *
  * @param array 
  * @return
  */
 function getNodeIcon($a_node)
 {
     $a_id_parts = explode(":", $a_node["id"]);
     $a_skl_tree_id = $a_parent_id_parts[0];
     $a_skl_template_tree_id = $a_id_parts[1];
     // root?
     if ($a_node["type"] == "skrt") {
         $icon = ilUtil::getImagePath("icon_scat.svg");
     } else {
         $type = $a_node["type"];
         if ($type == "sktr") {
             include_once "./Services/Skill/classes/class.ilSkillTreeNode.php";
             $type = ilSkillTreeNode::_lookupType($a_skl_template_tree_id);
         }
         if ($type == "sktp") {
             $type = "skll";
         }
         if ($type == "sctp") {
             $type = "scat";
         }
         $icon = ilUtil::getImagePath("icon_" . $type . ".svg");
     }
     return $icon;
 }
コード例 #20
0
 /**
  * Get icon path
  *
  * @param int $a_obj_id node id
  * @param string $a_type node type
  * @param string $a_size size
  * @param int $a_status status
  * @return string icon path
  */
 static function getIconPath($a_obj_id, $a_type, $a_size = "", $a_status = 0)
 {
     if ($a_status == self::STATUS_DRAFT && $a_type == "sctp") {
         $a_type = "scat";
     }
     if ($a_status == self::STATUS_DRAFT && $a_type == "sktp") {
         $a_type = "skll";
     }
     $off = $a_status == self::STATUS_DRAFT ? "_off" : "";
     $a_name = "icon_" . $a_type . $a_size . $off . ".svg";
     if ($a_type == "sktr") {
         include_once "./Services/Skill/classes/class.ilSkillTemplateReference.php";
         $tid = ilSkillTemplateReference::_lookupTemplateId($a_obj_id);
         $type = ilSkillTreeNode::_lookupType($tid);
         if ($type == "sctp") {
             $a_name = "icon_sctr" . $a_size . $off . ".svg";
         }
     }
     $vers = "vers=" . str_replace(array(".", " "), "-", ILIAS_VERSION);
     return ilUtil::getImagePath($a_name) . "?" . $vers;
 }
コード例 #21
0
 public static function getAutocompleteResult($a_field_id, $a_term)
 {
     global $ilUser;
     $multi_fields = array("interests_general", "interests_help_offered", "interests_help_looking");
     if (in_array($a_field_id, $multi_fields) && $a_term) {
         // registration has no current user
         $user_id = null;
         if ($ilUser && $ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $user_id = $ilUser->getId();
         }
         $result = array();
         $cnt = 0;
         // term is searched in ALL interest fields, no distinction
         foreach (ilObjUser::findInterests($a_term, $ilUser->getId()) as $item) {
             $result[$cnt] = new stdClass();
             $result[$cnt]->value = $item;
             $result[$cnt]->label = $item;
             $cnt++;
         }
         // :TODO: search in skill data
         include_once "./Services/Skill/classes/class.ilSkillTreeNode.php";
         foreach (ilSkillTreeNode::findSkills($a_term) as $skill) {
             $result[$cnt] = new stdClass();
             $result[$cnt]->value = $skill;
             $result[$cnt]->label = $skill;
             $cnt++;
         }
     }
     return $result;
 }
コード例 #22
0
 /**
  * Get subtree, internal
  *
  * @param string $id vtree id
  * @param array $result node array (called by reference)
  * @param bool $a_only_basic return only basic skills (and basic skill templates)
  */
 private function __getSubTreeRec($id, &$result, $a_only_basic)
 {
     $childs = $this->getChildsOfNode($id);
     foreach ($childs as $c) {
         if (!$a_only_basic || in_array($c["type"], array("skll", "sktp")) || $c["type"] == "sktr" && ilSkillTreeNode::_lookupType($c["skill_id"]) == "sktp") {
             $result[] = $c;
         }
         $this->__getSubTreeRec($c["id"], $result, $a_only_basic);
     }
 }
コード例 #23
0
 /**
  * Get skill for level id
  *
  * @param
  * @return
  */
 function getSkillForLevelId($a_level_id)
 {
     global $ilDB;
     $set = $ilDB->query("SELECT * FROM skl_level WHERE " . " id = " . $ilDB->quote($a_level_id, "integer"));
     $skill = null;
     if ($rec = $ilDB->fetchAssoc($set)) {
         if (ilSkillTreeNode::isInTree($rec["skill_id"])) {
             $skill = new ilBasicSkill($rec["skill_id"]);
         }
     }
     return $skill;
 }
コード例 #24
0
 protected function renderSkillsTeaser($a_user_id, $a_skills_id)
 {
     global $lng;
     include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
     return "<div style=\"margin:5px\">" . $lng->txt("skills") . ": \"" . ilSkillTreeNode::_lookupTitle($a_skills_id) . "\"</div>";
 }
コード例 #25
0
 /**
  * Delete skill
  */
 function delete()
 {
     parent::delete();
 }
コード例 #26
0
 protected function initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
 {
     global $ilSetting, $ilUser;
     if ((int) $_REQUEST["exc_id"]) {
         $this->ctrl->setParameter($this, "exc_id", (int) $_REQUEST["exc_id"]);
         $this->ctrl->setParameter($this, "ass_id", (int) $_REQUEST["ass_id"]);
     }
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
     $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
     $form->addItem($tmpl);
     $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
     $title->setValue($a_title);
     $form->addItem($title);
     // gather user blogs
     if (!$ilSetting->get('disable_wsp_blogs')) {
         $blog_options = array();
         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
         $tree = new ilWorkspaceTree($this->user_id);
         $root = $tree->readRootId();
         if ($root) {
             $root = $tree->getNodeData($root);
             foreach ($tree->getSubTree($root, true, "blog") as $node) {
                 $blog_options[$node["obj_id"]] = $node["title"];
             }
             asort($blog_options);
         }
     }
     $has_form_content = false;
     include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
     $check_quota = ilDiskQuotaActivationChecker::_isPersonalWorkspaceActive();
     $quota_sum = 0;
     include_once "Services/Skill/classes/class.ilPersonalSkill.php";
     $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
     $skill_ids = array();
     include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
     foreach (ilPortfolioTemplatePage::getAllPages($a_prtt_id) as $page) {
         switch ($page["type"]) {
             case ilPortfolioTemplatePage::TYPE_PAGE:
                 // skills
                 $source_page = new ilPortfolioTemplatePage($page["id"]);
                 $source_page->buildDom(true);
                 $dom = $source_page->getDom();
                 if ($dom instanceof php4DOMDocument) {
                     $dom = $dom->myDOMDocument;
                 }
                 $xpath = new DOMXPath($dom);
                 $nodes = $xpath->query("//PageContent/Skills");
                 foreach ($nodes as $node) {
                     $skill_id = $node->getAttribute("Id");
                     if (!in_array($skill_id, $pskills)) {
                         $skill_ids[] = $skill_id;
                     }
                 }
                 unset($nodes);
                 unset($xpath);
                 unset($dom);
                 if ($check_quota) {
                     $quota_sum += $source_page->getPageDiskSize();
                 }
                 if (sizeof($skill_ids)) {
                     $has_form_content = true;
                 }
                 break;
             case ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE:
                 if (!$ilSetting->get('disable_wsp_blogs')) {
                     $has_form_content = true;
                     $field_id = "blog_" . $page["id"];
                     $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " . $page["title"], $field_id);
                     $blog->setRequired(true);
                     $blog->setValue("blog_create");
                     $form->addItem($blog);
                     $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
                     $blog->addOption($new_blog);
                     $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
                     $title->setRequired(true);
                     $new_blog->addSubItem($title);
                     if (sizeof($blog_options)) {
                         $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
                         $blog->addOption($reuse_blog);
                         $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
                         $obj->setRequired(true);
                         $obj->setOptions(array("" => $this->lng->txt("please_select")) + $blog_options);
                         $reuse_blog->addSubItem($obj);
                     }
                     $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
                 }
                 break;
         }
     }
     if ($skill_ids) {
         include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
         $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
         $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
         $skills->setValue($skill_ids);
         foreach ($skill_ids as $skill_id) {
             $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
         }
         $form->addItem($skills);
     }
     if ($quota_sum) {
         include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
         if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
             ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
             $this->ctrl->redirect($this, "create");
         }
     }
     // no dialog needed, go ahead
     if (!$has_form_content) {
         return;
     }
     $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
     $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
     $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
     return $form;
 }
コード例 #27
0
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng, $ilCtrl;
     switch ($a_set["type"]) {
         // category
         case "scat":
             $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", $a_set["child"]);
             $ret = $ilCtrl->getLinkTargetByClass("ilskillcategorygui", "listItems");
             $ilCtrl->setParameterByClass("ilskillcategorygui", "obj_id", $_GET["obj_id"]);
             break;
             // skill template reference
         // skill template reference
         case "sktr":
             $tid = ilSkillTemplateReference::_lookupTemplateId($a_set["child"]);
             $ilCtrl->setParameterByClass("ilskilltemplatereferencegui", "tref_id", $a_set["child"]);
             $ilCtrl->setParameterByClass("ilskilltemplatereferencegui", "obj_id", $tid);
             $ret = $ilCtrl->getLinkTargetByClass("ilskilltemplatereferencegui", "listItems");
             $ilCtrl->setParameterByClass("ilskilltemplatereferencegui", "obj_id", $_GET["obj_id"]);
             $ilCtrl->setParameterByClass("ilskilltemplatereferencegui", "tref_id", $_GET["tref_id"]);
             break;
             // skill
         // skill
         case "skll":
             $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id", $a_set["child"]);
             $ret = $ilCtrl->getLinkTargetByClass("ilbasicskillgui", "edit");
             $ilCtrl->setParameterByClass("ilbasicskillgui", "obj_id", $_GET["obj_id"]);
             break;
             // --------
             // template
         // --------
         // template
         case "sktp":
             $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $a_set["child"]);
             $ret = $ilCtrl->getLinkTargetByClass("ilbasicskilltemplategui", "edit");
             $ilCtrl->setParameterByClass("ilbasicskilltemplategui", "obj_id", $_GET["obj_id"]);
             break;
             // template category
         // template category
         case "sctp":
             $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $a_set["child"]);
             $ret = $ilCtrl->getLinkTargetByClass("ilskilltemplatecategorygui", "listItems");
             $ilCtrl->setParameterByClass("ilskilltemplatecategorygui", "obj_id", $_GET["obj_id"]);
             break;
     }
     if ($this->tref_id == 0) {
         $this->tpl->setCurrentBlock("cb");
         $this->tpl->setVariable("CB_ID", $a_set["child"]);
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("nr");
         $this->tpl->setVariable("OBJ_ID", $a_set["child"]);
         $this->tpl->setVariable("ORDER_NR", $a_set["order_nr"]);
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("HREF_TITLE", $ret);
     $this->tpl->setVariable("TITLE", $a_set["title"]);
     $icon = ilSkillTreeNode::getIconPath($a_set["child"], $a_set["type"], "", ilSkillTreeNode::_lookupStatus($a_set["child"]));
     $this->tpl->setVariable("ICON", ilUtil::img($icon, ""));
 }
コード例 #28
0
 /**
  * List items
  */
 function listItems()
 {
     global $tpl;
     $this->setTabs("content");
     $sk_id = $this->node_object->getSkillTemplateId();
     $obj_type = ilSkillTreeNode::_lookupType($sk_id);
     if ($obj_type == "sctp") {
         include_once "./Services/Skill/classes/class.ilSkillCatTableGUI.php";
         $table = new ilSkillCatTableGUI($this, "listItems", (int) $sk_id, ilSkillCatTableGUI::MODE_SCTP, $this->node_object->getId());
         $tpl->setContent($table->getHTML());
     } else {
         if ($obj_type == "sktp") {
             include_once "./Services/Skill/classes/class.ilSkillLevelTableGUI.php";
             $table = new ilSkillLevelTableGUI((int) $sk_id, $this, "edit", $this->node_object->getId());
             $tpl->setContent($table->getHTML());
         }
     }
 }
コード例 #29
0
 /**
  * Save item
  */
 function saveItem()
 {
     $it = new ilSkillTemplateCategory();
     $it->setTitle($this->form->getInput("title"));
     $it->setOrderNr($this->form->getInput("order_nr"));
     $it->create();
     ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
 }
コード例 #30
0
 /**
  * Get icon path
  *
  * @param
  * @return
  */
 function getIconPath($a_obj_id, $a_type, $a_size = "", $a_draft = false)
 {
     $off = $a_draft ? "_off" : "";
     $a_name = "icon_" . $a_type . $a_size . $off . ".png";
     if ($a_type == "sktr") {
         include_once "./Services/Skill/classes/class.ilSkillTemplateReference.php";
         $tid = ilSkillTemplateReference::_lookupTemplateId($a_obj_id);
         $type = ilSkillTreeNode::_lookupType($tid);
         if ($type == "sctp") {
             $a_name = "icon_sctr" . $a_size . $off . ".png";
         }
     }
     $vers = "vers=" . str_replace(array(".", " "), "-", ILIAS_VERSION);
     return ilUtil::getImagePath($a_name) . "?" . $vers;
 }