/**
  * Get HTML for navigation history
  */
 function getHTML()
 {
     global $ilNavigationHistory, $lng;
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $selection = new ilAdvancedSelectionListGUI();
     $selection->setFormSelectMode("url_ref_id", "ilNavHistorySelect", true, "goto.php?target=navi_request", "ilNavHistory", "ilNavHistoryForm", "_top", $lng->txt("go"), "ilNavHistorySubmit");
     $selection->setListTitle($lng->txt("last_visited"));
     $selection->setId("lastvisited");
     $selection->setSelectionHeaderClass("MMInactive");
     $selection->setHeaderIcon(ilAdvancedSelectionListGUI::NO_ICON);
     $selection->setItemLinkClass("small");
     $selection->setUseImages(true);
     include_once "./Services/Accessibility/classes/class.ilAccessKey.php";
     $selection->setAccessKey(ilAccessKey::LAST_VISITED);
     $items = $ilNavigationHistory->getItems();
     //$sel_arr = array(0 => "-- ".$lng->txt("last_visited")." --");
     reset($items);
     $cnt = 0;
     foreach ($items as $k => $item) {
         if ($cnt++ > 20) {
             break;
         }
         if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) || $item["ref_id"] != $_GET["ref_id"] || $k > 0) {
             $obj_id = ilObject::_lookupObjId($item["ref_id"]);
             $selection->addItem($item["title"], $item["ref_id"], $item["link"], ilObject::_getIcon($obj_id, "tiny", $item["type"]), $lng->txt("obj_" . $item["type"]), "_top");
         }
     }
     $html = $selection->getHTML();
     if ($html == "") {
         $selection->addItem($lng->txt("no_items"), "", "#", "", "", "_top");
         $selection->setUseImages(false);
         $html = $selection->getHTML();
     }
     return $html;
 }
 /**
  * show desktop
  */
 function show()
 {
     // preload block settings
     include_once "Services/Block/classes/class.ilBlockSetting.php";
     ilBlockSetting::preloadPDBlockSettings();
     // add template for content
     $this->pd_tpl = new ilTemplate("tpl.usr_personaldesktop.html", true, true, "Services/PersonalDesktop");
     $this->tpl->getStandardTemplate();
     // display infopanel if something happened
     ilUtil::infoPanel();
     //$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.png"),
     //	$this->lng->txt("personal_desktop"));
     //		$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.png"),
     //			"");
     $this->tpl->setTitle($this->lng->txt("overview"));
     $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
     $this->tpl->setContent($this->getCenterColumnHTML());
     $this->tpl->setRightContent($this->getRightColumnHTML());
     $this->tpl->setLeftContent($this->getLeftColumnHTML());
     if (count($this->action_menu->getItems())) {
         /**
          * @var $tpl ilTemplate
          * @var $lng ilLanguage
          */
         global $tpl, $lng;
         $this->action_menu->setAsynch(false);
         $this->action_menu->setAsynchUrl('');
         $this->action_menu->setListTitle($lng->txt('actions'));
         $this->action_menu->setId('act_pd');
         $this->action_menu->setSelectionHeaderClass('small');
         $this->action_menu->setItemLinkClass('xsmall');
         $this->action_menu->setLinksMode('il_ContainerItemCommand2');
         $this->action_menu->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
         $this->action_menu->setUseImages(false);
         $htpl = new ilTemplate('tpl.header_action.html', true, true, 'Services/Repository');
         $htpl->setVariable('ACTION_DROP_DOWN', $this->action_menu->getHTML());
         $tpl->setHeaderActionMenu($htpl->get());
     }
     $this->tpl->show();
 }
Ejemplo n.º 3
0
 /**
  * Get HTML.
  */
 function getHTML()
 {
     global $ilCtrl, $lng, $ilAccess, $ilUser;
     if ($this->isRepositoryObject()) {
         if (!$ilAccess->checkAccess("read", "", $this->getRefId())) {
             return "";
         }
     }
     $this->tpl = new ilTemplate("tpl.block.html", true, true, "Services/Block");
     //		$this->handleConfigStatus();
     $this->fillDataSection();
     if ($this->getRepositoryMode() && $this->isRepositoryObject()) {
         // #10993
         if ($this->getAdminCommands()) {
             $this->tpl->setCurrentBlock("block_check");
             $this->tpl->setVariable("BL_REF_ID", $this->getRefId());
             $this->tpl->parseCurrentBlock();
         }
         if ($ilAccess->checkAccess("delete", "", $this->getRefId())) {
             $this->addBlockCommand("ilias.php?baseClass=ilRepositoryGUI&ref_id=" . $_GET["ref_id"] . "&cmd=delete" . "&item_ref_id=" . $this->getRefId(), $lng->txt("delete"));
         }
     }
     // footer info
     if ($this->getFooterInfo() != "") {
         $this->tpl->setCurrentBlock("footer_information");
         $this->tpl->setVariable("FOOTER_INFO", $this->getFooterInfo());
         $this->tpl->setVariable("FICOLSPAN", $this->getColSpan());
         $this->tpl->parseCurrentBlock();
     }
     $this->dropdown = array();
     // commands
     if (count($this->getBlockCommands()) > 0) {
         $has_block_command = false;
         foreach ($this->getBlockCommands() as $command) {
             if (!$command["img"]) {
                 $this->dropdown[] = $command;
                 continue;
             }
             $has_block_command = true;
             if ($command["target"] != "") {
                 $this->tpl->setCurrentBlock("bc_target");
                 $this->tpl->setVariable("CMD_TARGET", $command["target"]);
                 $this->tpl->parseCurrentBlock();
             }
             if ($command["img"] != "") {
                 $this->tpl->setCurrentBlock("bc_image");
                 $this->tpl->setVariable("SRC_BC", $command["img"]);
                 $this->tpl->setVariable("ALT_BC", $command["text"]);
                 $this->tpl->parseCurrentBlock();
                 $this->tpl->setCurrentBlock("block_command");
             } else {
                 $this->tpl->setCurrentBlock("block_command");
                 $this->tpl->setVariable("CMD_TEXT", $command["text"]);
                 $this->tpl->setVariable("BC_CLASS", 'class="il_ContainerItemCommand"');
             }
             $this->tpl->setVariable("CMD_HREF", $command["href"]);
             $this->tpl->parseCurrentBlock();
         }
         if ($has_block_command) {
             $this->tpl->setCurrentBlock("block_commands");
             $this->tpl->setVariable("CCOLSPAN", $this->getColSpan());
             $this->tpl->parseCurrentBlock();
         }
     }
     // fill previous next
     $this->fillPreviousNext();
     // fill footer
     $this->fillFooter();
     // fill row for setting details
     $this->fillDetailRow();
     // header links
     if (count($this->getHeaderLinks())) {
         $counter = 0;
         foreach ($this->getHeaderLinks() as $command) {
             if ($counter > 0) {
                 $this->tpl->setCurrentBlock('head_delim');
                 $this->tpl->touchBlock('head_delim');
                 $this->tpl->parseCurrentBlock();
             }
             if ($command['status'] == true) {
                 $this->tpl->setCurrentBlock('head_link');
                 $this->tpl->setVariable('HHREF', $command['href']);
                 $this->tpl->setVariable('HLINK', $command['text']);
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->setCurrentBlock('head_text');
                 $this->tpl->setVariable('HTEXT', $command['text']);
                 $this->tpl->parseCurrentBlock();
             }
             $this->tpl->setCurrentBlock('head_item');
             $this->tpl->parseCurrentBlock();
             ++$counter;
         }
         $this->tpl->setCurrentBlock('header_links');
         $this->tpl->parseCurrentBlock();
     }
     // for screen readers we first output the title and the commands
     // (e.g. close icon afterwards), otherwise we first output the
     // header commands, since we want to have the close icon top right
     // and not floated after the title
     if (is_object($ilUser) && $ilUser->getPref("screen_reader_optimization")) {
         $this->fillHeaderTitleBlock();
         $this->fillHeaderCommands();
     } else {
         $this->fillHeaderCommands();
         $this->fillHeaderTitleBlock();
     }
     // adv selection gui
     include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $dropdown = new ilAdvancedSelectionListGUI();
     $dropdown->setUseImages(true);
     $dropdown->setHeaderIcon(ilUtil::getImagePath("icon_sett_s.png"));
     $dropdown->setId("block_dd_" . $this->getBlockType() . "_" . $this->block_id);
     foreach ($this->dropdown as $item) {
         if ($item["href"] || $item["onclick"]) {
             if ($item["checked"]) {
                 $item["image"] = ilUtil::getImagePath("icon_checked_s.png");
             }
             $dropdown->addItem($item["text"], "", $item["href"], $item["image"], $item["text"], "", "", false, $item["onclick"]);
         }
     }
     $dropdown = $dropdown->getHTML();
     $this->tpl->setVariable("ADV_DROPDOWN", $dropdown);
     $this->tpl->setVariable("COLSPAN", $this->getColSpan());
     if ($this->getBigMode()) {
         $this->tpl->touchBlock("hclassb");
     } else {
         $this->tpl->touchBlock("hclass");
     }
     if ($ilCtrl->isAsynch()) {
         // return without div wrapper
         echo $this->tpl->getAsynch();
     } else {
         // return incl. wrapping div with id
         return '<div id="' . "block_" . $this->getBlockType() . "_" . $this->block_id . '">' . $this->tpl->get() . '</div>';
     }
 }
Ejemplo n.º 4
0
 /**
  * GetDropDownHTML
  *
  * @param
  * @return
  */
 function renderDropDown($a_tpl, $a_id)
 {
     global $lng, $ilSetting, $rbacsystem;
     $id = strtolower($a_id);
     $id_up = strtoupper($a_id);
     $a_tpl->setCurrentBlock("entry_" . $id);
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $selection = new ilAdvancedSelectionListGUI();
     if ($this->active == $a_id || $this->active == "" && $a_id == "repository") {
         $selection->setSelectionHeaderClass("MMActive");
         $a_tpl->setVariable("SEL", '<span class="ilAccHidden">(' . $lng->txt("stat_selected") . ')</span>');
     } else {
         $selection->setSelectionHeaderClass("MMInactive");
     }
     $selection->setSelectionHeaderSpanClass("MMSpan");
     $selection->setHeaderIcon(ilAdvancedSelectionListGUI::ICON_ARROW);
     $selection->setItemLinkClass("small");
     $selection->setUseImages(false);
     switch ($id) {
         // desktop drop down
         case "desktop":
             $selection->setListTitle($lng->txt("personal_desktop"));
             $selection->setId("dd_pd");
             // overview
             $selection->addItem($lng->txt("overview"), "", "ilias.php?baseClass=ilPersonalDesktopGUI", "", "", "_top");
             if (!$ilSetting->get("disable_personal_workspace")) {
                 // workspace
                 $selection->addItem($lng->txt("personal_workspace"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace", "", "", "_top");
             }
             // profile
             $selection->addItem($lng->txt("personal_profile"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToProfile", "", "", "_top");
             // skills
             $skmg_set = new ilSetting("skmg");
             if ($skmg_set->get("enable_skmg")) {
                 $selection->addItem($lng->txt("skills"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSkills", "", "", "_top");
             }
             // portfolio
             if ($ilSetting->get('user_portfolios')) {
                 $selection->addItem($lng->txt("portfolio"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToPortfolio", "", "", "_top");
             }
             // news
             if ($ilSetting->get("block_activated_news")) {
                 $selection->addItem($lng->txt("news"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNews", "", "", "_top");
             }
             // Learning Progress
             include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
             if (ilObjUserTracking::_enabledLearningProgress()) {
                 //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
                 $selection->addItem($lng->txt("learning_progress"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToLP", "", "", "_top");
             }
             // calendar
             include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
             $settings = ilCalendarSettings::_getInstance();
             if ($settings->isEnabled()) {
                 $selection->addItem($lng->txt("calendar"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToCalendar", "", "", "_top");
             }
             // mail
             if ($this->mail) {
                 $selection->addItem($lng->txt('mail'), '', 'ilias.php?baseClass=ilMailGUI', '', '', '_top');
             }
             // contacts
             if (!$this->ilias->getSetting('disable_contacts') && ($this->ilias->getSetting('disable_contacts_require_mail') || $rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))) {
                 $selection->addItem($lng->txt('mail_addressbook'), '', 'ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToContacts', '', '', '_top');
             }
             // private notes
             if (!$this->ilias->getSetting("disable_notes")) {
                 $selection->addItem($lng->txt("notes_and_comments"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNotes", "", "", "_top");
             }
             // bookmarks
             if (!$this->ilias->getSetting("disable_bookmarks")) {
                 $selection->addItem($lng->txt("bookmarks"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToBookmarks", "", "", "_top");
             }
             // settings
             $selection->addItem($lng->txt("personal_settings"), "", "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSettings", "", "", "_top");
             break;
             // shop
         // shop
         case 'shop':
             $selection->setListTitle($lng->txt("shop"));
             $selection->setId("dd_shp");
             $selection->addItem($lng->txt("shop"), "", "ilias.php?baseClass=ilShopController&cmd=firstpage", "", "", "_top");
             break;
             // administration
         // administration
         case "administration":
             $selection->setListTitle($lng->txt("administration"));
             $selection->setId("dd_adm");
             $selection->setAsynch(true);
             $selection->setAsynchUrl("ilias.php?baseClass=ilAdministrationGUI&cmd=getDropDown&cmdMode=asynch");
             //$this->renderEntry($a_tpl, "administration",
             //	$lng->txt("administration"),
             //	$this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
             //	$this->target);
             break;
     }
     //		$selection->setTriggerEvent("mouseover");
     //		$selection->setAutoHide(true);
     // bs-patch start
     global $ilUser;
     $a_tpl->setVariable("TXT_ADMINISTRATION", $lng->txt("administration"));
     $a_tpl->parseCurrentBlock();
     return;
     // bs-patch end
     $html = $selection->getHTML();
     $a_tpl->setVariable($id_up . "_DROP_DOWN", $html);
     $a_tpl->parseCurrentBlock();
 }
 /**
  * Get skill presentation HTML
  *
  * @return
  */
 function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit = false, $a_tref_id = 0)
 {
     global $ilUser, $lng, $ilCtrl, $ilSetting;
     $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->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
     $act_list->setUseImages(false);
     $b_skills = ilSkillTreeNode::getSkillTreeNodes($a_top_skill_id, true, $a_tref_id);
     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);
         $skill = ilSkillTreeNodeFactory::getInstance($bs["id"]);
         $level_data = $skill->getLevelData();
         if ($this->mode == "gap") {
             if ($this->getProfileId() > 0) {
                 $this->renderProfileTargetRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
             }
             $this->renderActualLevelsRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
             $this->renderGapSelfEvalRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
             $this->renderSuggestedResources($tpl, $level_data, $bs["id"], $bs["tref"]);
         } else {
             if ($this->getProfileId() > 0) {
                 $this->renderProfileTargetRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
             }
             $this->renderMaterialsRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
             // get date of self evaluation
             $se_date = ilPersonalSkill::getSelfEvaluationDate($user->getId(), $a_top_skill_id, $bs["tref"], $bs["id"]);
             $se_rendered = $se_date == "" ? true : false;
             // get all object triggered entries and render them
             foreach ($skill->getAllLevelEntriesOfUser($bs["tref"], $user->getId()) as $level_entry) {
                 // render the self evaluation at the correct position within the list of object triggered entries
                 if ($se_date > $level_entry["status_date"] && !$se_rendered) {
                     $this->renderSelfEvaluationRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
                     $se_rendered = true;
                 }
                 $this->renderObjectEvalRow($tpl, $level_data, $level_entry);
             }
             // if not rendered yet, render self evaluation now
             if (!$se_rendered) {
                 $this->renderSelfEvaluationRow($tpl, $level_data, $a_top_skill_id, $bs["id"], $bs["tref"]);
             }
         }
         $too_low = true;
         $current_target_level = 0;
         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();
             // profile targel level
             /*
             				foreach ($this->profile_levels as $pl)
             				{
             					if ($pl["level_id"] == $v["id"] &&
             						$pl["base_skill_id"] == $v["skill_id"])
             					{
             						$too_low = true;
             						$current_target_level = $v["id"];
             					}
             				}
             				else
             				{
             					$tpl->setVariable("VAL_SELF_EVAL", " ");
             				}
             				$tpl->parseCurrentBlock();
             				if ($v["id"] == $se_level)
             				{
             					$found = true;
             				}
             
             				// assigned materials
             				if ($this->use_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"));
         			if ($this->use_materials)
         			{
         				$tpl->setVariable("TXT_MATERIAL", $lng->txt("skmg_material"));
         			}*/
         $tpl->setVariable("TXT_TARGET", $lng->txt("skmg_target_level"));
         $tpl->setVariable("TXT_360_SURVEY", $lng->txt("skmg_360_survey"));
         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"]);
             if ($this->use_materials) {
                 $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();
 }
 /**
  * Get skill presentation HTML
  *
  * @return
  */
 function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit = false)
 {
     global $ilUser, $lng, $ilCtrl, $ilSetting;
     $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->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
     $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"]);
         $skill = ilSkillTreeNodeFactory::getInstance($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
             if ($this->use_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"));
         if ($this->use_materials) {
             $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"]);
             if ($this->use_materials) {
                 $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();
 }
 /**
  * Get character style selector
  */
 static function getCharStyleSelector($a_par_type, $a_use_callback = true)
 {
     global $lng;
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $selection = new ilAdvancedSelectionListGUI();
     $selection->setFormSelectMode("char_characteristic", "", false, "", "", "", "", "", "", "");
     $selection->setId("char_style_selection");
     $selection->setSelectionHeaderClass("ilEditSubmit");
     $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
     //$selection->setSelectedValue($a_selected);
     $selection->setUseImages(false);
     $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_NOP);
     if ($a_use_callback) {
         $selection->setSelectCallback("ilCOPage.setCharacterClass");
     }
     //$chars = $a_chars;
     //$title_char = ($chars[$a_selected] != "")
     //	? $chars[$a_selected]
     //	: $a_selected;
     $selection->setListTitle("&nbsp;<i>A</i>");
     /*if ($chars[$a_seleted] == "" && ($a_seleted != ""))
     		{
     			$chars = array_merge(array($a_seleted => $a_seleted),
     				$chars);
     		}*/
     $chars = array("Comment" => array("code" => "com", "txt" => $lng->txt("cont_char_style_com")), "Quotation" => array("code" => "quot", "txt" => $lng->txt("cont_char_style_quot")), "Accent" => array("code" => "acc", "txt" => $lng->txt("cont_char_style_acc")), "Code" => array("code" => "code", "txt" => $lng->txt("cont_char_style_code")));
     foreach ($chars as $key => $char) {
         if (ilPageEditorSettings::lookupSettingByParentType($a_par_type, "active_" . $char["code"], true)) {
             $t = "text_inline";
             $tag = "span";
             switch ($key) {
                 case "Code":
                     $tag = "code";
                     break;
             }
             $html = '<' . $tag . ' class="ilc_' . $t . '_' . $key . '" style="font-size:90%; margin-top:2px; margin-bottom:2px; position:static;">' . $char["txt"] . "</" . $tag . ">";
             // this next line is very important for IE. The real onclick event is on the surrounding <tr> of the
             // advanced selection list. But it is impossible to prevent the tr-event from removing the focus
             // on tiny withouth the following line, that receives the click event before and stops the faulty default
             // bevaviour of IE, see bug report #8723
             $html = '<a class="nostyle" style="display:block;" href="#" onclick="return false;">' . $html . "</a>";
             $selection->addItem($char["txt"], $key, "", "", $key, "", $html);
         }
     }
     return $selection->getHTML();
 }
 /**
  * returns the active bookmark links. if only one link is enabled, a single link is returned.
  * otherwise a the html of an advanced selection list is returned.
  */
 public static function _getBookmarksSelectionList($title, $href)
 {
     global $ilDB, $lng, $ilSetting;
     require_once 'Services/PermanentLink/classes/class.ilPermanentLink.php';
     // social bookmarkings
     $rset = ilPermanentLink::getActiveBookmarks();
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $current_selection_list = new ilAdvancedSelectionListGUI();
     $current_selection_list->setListTitle($lng->txt("bm_add_to_social_bookmarks"));
     $current_selection_list->setId("socialbm_actions");
     $current_selection_list->setUseImages(true);
     $cnt = 0;
     if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get('disable_bookmarks')) {
         $linktpl = 'ilias.php?cmd=redirect&baseClass=ilPersonalDesktopGUI&redirectClass=ilbookmarkadministrationgui&redirectCmd=newFormBookmark&param_bmf_id=1&param_return_to=true&param_bm_title=' . urlencode($title) . '&param_bm_link=' . urlencode(urlencode($href)) . "&param_return_to_url=" . urlencode(urlencode($_SERVER['REQUEST_URI']));
         $current_selection_list->addItem($lng->txt("bm_add_to_ilias"), '', $linktpl, ilUtil::getImagePath('socialbookmarks/icon_bm_15x15.gif'), $lng->txt("bm_add_to_ilias"), '_top');
         $cnt++;
     }
     foreach ($rset as $row) {
         $linktpl = $row->sbm_link;
         $linktpl = str_replace('{LINK}', urlencode($href), $linktpl);
         $linktpl = str_replace('{TITLE}', urlencode($title), $linktpl);
         $current_selection_list->addItem($row->sbm_title, '', $linktpl, $row->sbm_icon, $row->title, '_blank');
         $cnt++;
     }
     if ($cnt == 1 && $_SESSION["AccountId"] != ANONYMOUS_USER_ID && !$ilSetting->get('disable_bookmarks')) {
         $loc_tpl = new ilTemplate('tpl.single_link.html', true, true, 'Services/PermanentLink');
         $loc_tpl->setVariable("TXT_ADD_TO_ILIAS_BM", $lng->txt("bm_add_to_ilias"));
         $loc_tpl->setVariable("URL_ADD_TO_BM", 'ilias.php?cmd=redirect&baseClass=ilPersonalDesktopGUI&redirectClass=ilbookmarkadministrationgui&redirectCmd=newFormBookmark&param_bmf_id=1&param_return_to=true&param_bm_title=' . urlencode($title) . '&param_bm_link=' . urlencode(urlencode($href)) . "&param_return_to_url=" . urlencode(urlencode($_SERVER['REQUEST_URI'])));
         $loc_tpl->setVariable("ICON", ilUtil::getImagePath('icon_bm.png'));
         return $loc_tpl->get();
     } else {
         if ($cnt >= 1) {
             return $current_selection_list->getHTML();
         } else {
             return '';
         }
     }
 }
 /**
  * @param array $a_set
  */
 public function fillRow($a_set)
 {
     $ilUDFCheck = ilUDFCheck::find($a_set['id']);
     $ilUDFCheckGUI = new ilUDFCheckGUI($this->parent_obj);
     foreach ($this->getSelectableColumns() as $k => $v) {
         if ($k == 'actions') {
             $this->ctrl->setParameter($this->parent_obj, ilUDFCheckGUI::IDENTIFIER, $ilUDFCheck->getId());
             $this->ctrl->setParameter($ilUDFCheckGUI, ilUDFCheckGUI::IDENTIFIER, $ilUDFCheck->getId());
             $current_selection_list = new ilAdvancedSelectionListGUI();
             $current_selection_list->setListTitle($this->pl->txt('check_actions'));
             $current_selection_list->setId('check_actions' . $ilUDFCheck->getId());
             $current_selection_list->setUseImages(false);
             $current_selection_list->addItem($this->pl->txt('check_edit'), 'check_edit', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_EDIT));
             $current_selection_list->addItem($this->pl->txt('check_delete'), 'check_delete', $this->ctrl->getLinkTarget($this->parent_obj, ilUserSettingsGUI::CMD_CONFIRM_DELETE));
             $this->tpl->setCurrentBlock('td');
             $this->tpl->setVariable('VALUE', $current_selection_list->getHTML());
             $this->tpl->parseCurrentBlock();
             continue;
         }
         if ($this->isColumnSelected($k)) {
             if ($a_set[$k]) {
                 $this->tpl->setCurrentBlock('td');
                 $this->tpl->setVariable('VALUE', is_array($a_set[$k]) ? implode(", ", $a_set[$k]) : $a_set[$k]);
                 $this->tpl->parseCurrentBlock();
             } else {
                 $this->tpl->setCurrentBlock('td');
                 $this->tpl->setVariable('VALUE', '&nbsp;');
                 $this->tpl->parseCurrentBlock();
             }
         }
     }
 }
Ejemplo n.º 10
0
 /**
  * Insert property html
  *
  * @return	int	Size
  */
 function insert(&$a_tpl)
 {
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $selection = new ilAdvancedSelectionListGUI();
     $selection->setFormSelectMode($this->getPostVar(), "", false, "", "", "", "", "", "", "");
     $selection->setId($this->getPostVar());
     $selection->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
     $selection->setSelectedValue($this->getValue());
     $selection->setUseImages(false);
     $selection->setOnClickMode(ilAdvancedSelectionListGUI::ON_ITEM_CLICK_FORM_SELECT);
     foreach ($this->getOptions() as $option) {
         $selection->addItem($option["txt"], $option["value"], "", "", $option["value"], "", $option["html"]);
         if ($this->getValue() == $option["value"]) {
             $selection->setListTitle($option["txt"]);
         }
     }
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $selection->getHTML());
     $a_tpl->parseCurrentBlock();
 }
Ejemplo n.º 11
0
 /**
  * Fill header commands block
  */
 function fillHeaderCommands()
 {
     global $lng, $ilCtrl;
     // header commands
     if (count($this->getHeaderCommands()) > 0 || $this->detail_max > $this->detail_min && $this->detail_min == 0 || $this->close_command != "") {
         foreach ($this->getHeaderCommands() as $command) {
             $this->tpl->setCurrentBlock("header_command");
             $this->tpl->setVariable("HREF_HCOMM", $command["href"]);
             $this->tpl->setVariable("TXT_HCOMM", $command["text"]);
             $this->tpl->parseCurrentBlock();
         }
         // close button
         if ($this->detail_max > $this->detail_min && $this->detail_min == 0 && !$this->getRepositoryMode() || $this->close_command != "") {
             $alt = $lng->txt("hide");
             if ($this->close_command != "") {
                 $url = $this->close_command;
             } else {
                 $ilCtrl->setParameterByClass("ilcolumngui", $this->getDetailParameter(), "0");
                 $url = $ilCtrl->getLinkTargetByClass("ilcolumngui", "");
                 $ilCtrl->setParameterByClass("ilcolumngui", $this->getDetailParameter(), "");
             }
             $this->dropdown[] = array("text" => $alt, "image" => $img, "href" => $url);
         }
         $this->tpl->setCurrentBlock("header_commands");
         $this->tpl->parseCurrentBlock();
     }
     // adv selection gui
     include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $dropdown = new ilAdvancedSelectionListGUI();
     $dropdown->setUseImages(true);
     $dropdown->setStyle(ilAdvancedSelectionListGUI::STYLE_LINK_BUTTON);
     $dropdown->setHeaderIcon(ilAdvancedSelectionListGUI::ICON_CONFIG);
     $dropdown->setId("block_dd_" . $this->getBlockType() . "_" . $this->block_id);
     foreach ($this->dropdown as $item) {
         if ($item["href"] || $item["onclick"]) {
             if ($item["checked"]) {
                 $item["image"] = ilUtil::getImagePath("icon_checked.svg");
             }
             $dropdown->addItem($item["text"], "", $item["href"], $item["image"], $item["text"], "", "", false, $item["onclick"]);
         }
     }
     $dropdown = $dropdown->getHTML();
     $this->tpl->setCurrentBlock("header_dropdown");
     $this->tpl->setVariable("ADV_DROPDOWN", $dropdown);
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock("hitem");
     $this->tpl->parseCurrentBlock();
 }
Ejemplo n.º 12
0
 /**
  * Put admin panel into template:
  * - creation selector
  * - admin view on/off button
  */
 function fillAdminPanel()
 {
     global $lng, $ilHelp;
     $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false;
     $toolb = new ilToolbarGUI();
     // admin panel commands
     if (count($this->admin_panel_commands) > 0) {
         foreach ($this->admin_panel_commands as $cmd) {
             $toolb->addFormButton($cmd["txt"], $cmd["cmd"]);
         }
         $adm_cmds = true;
     } elseif ($this->admin_panel_commands_toolbar instanceof ilToolbarGUI) {
         $toolb = $this->admin_panel_commands_toolbar;
         $adm_cmds = true;
     }
     // Add arrow if desired
     if ($this->admin_panel_arrow) {
         $toolb->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), $lng->txt("actions"));
     }
     if ($adm_cmds) {
         $this->fillPageFormAction();
         $this->setCurrentBlock("adm_view_components");
         $this->setVariable("ADM_PANEL1", $toolb->getHTML());
         $this->parseCurrentBlock();
         $adm_view_cmp = true;
     }
     // admin view button
     if ($this->page_actions != "") {
         $this->setVariable("PAGE_ACTIONS", $this->page_actions);
         $adm_view = true;
     }
     // creation selector
     if (is_array($this->creation_selector)) {
         $this->setCurrentBlock("add_commands");
         if ($adm_cmds) {
             $this->setVariable("ADD_COM_WIDTH", 'width="1"');
         }
         include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
         $selection = new ilAdvancedSelectionListGUI();
         $selection->setListTitle($lng->txt("cntr_add_new_item"));
         $selection->setId("item_creation");
         $selection->setHeaderIcon(ilUtil::getImagePath("cmd_add_s.png"));
         $selection->setItemLinkClass("xsmall");
         $selection->setUseImages(true);
         foreach ($this->creation_selector["options"] as $item) {
             $link = $this->page_form_action . "&new_type=" . $item["value"];
             $link = str_replace("cmd=post", "cmd=" . $this->creation_selector["command"], $link);
             $ttip = ilHelp::getObjCreationTooltipText($item["value"]);
             $selection->addItem($item["title"], $item["value"], $link, $item["img"], $item["title"], "", "", false, "", $ttip, "right center", "left center", false);
         }
         $this->setVariable("SELECT_OBJTYPE_REPOS", $selection->getHTML());
         $this->setVariable("CENTER_COL_CLASS", trim($this->right_content) != "" ? "one_side_col" : "");
         $this->parseCurrentBlock();
         $creation_selector = true;
     }
     if ($adm_cmds and $this->admin_panel_bottom) {
         $this->setCurrentBlock("adm_view_components2");
         if ($this->admin_panel_arrow) {
             $toolb->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), $lng->txt("actions"));
         }
         $this->setVariable("ADM_PANEL2", $toolb->getHTML());
         $this->parseCurrentBlock();
     }
 }