/**
  * Get accesskey HTML attribute
  * @static
  * @param int $a_func_id
  * @return string
  */
 public static function getAttribute($a_func_id)
 {
     $key = ilAccessKey::getKey($a_func_id);
     if ($key != "") {
         return 'accesskey="' . $key . '"';
     }
     return "";
 }
 /**
  * Fill table row
  */
 protected function fillRow($a_set)
 {
     global $lng;
     $this->tpl->setVariable("VAL_COMPONENT", ilAccessKey::getComponentNames($a_set["func_id"]));
     $this->tpl->setVariable("VAL_FUNCTION", ilAccessKey::getFunctionName($a_set["func_id"]));
     $this->tpl->setVariable("FUNC_ID", $a_set["func_id"]);
     $this->tpl->setVariable("VAL_ACC_KEY", ilUtil::prepareFormOutput($a_set["access_key"]));
 }
 /**
  * Render main menu entry
  *
  * @param
  * @return
  */
 function renderEntry($a_tpl, $a_id, $a_txt, $a_script, $a_target = "_top")
 {
     global $lng, $ilNavigationHistory, $ilSetting, $rbacsystem, $ilCtrl;
     $id = strtolower($a_id);
     $id_up = strtoupper($a_id);
     $a_tpl->setCurrentBlock("entry_" . $id);
     include_once "./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php";
     // repository
     if ($a_id == "repository") {
         $gl = new ilGroupedListGUI();
         $gl->setAsDropDown(true);
         include_once "./Services/Link/classes/class.ilLink.php";
         $icon = ilUtil::img(ilObject::_getIcon(ilObject::_lookupObjId(1), "tiny"));
         $gl->addEntry($icon . " " . $a_txt . " - " . $lng->txt("rep_main_page"), ilLink::_getStaticLink(1, 'root', true), "_top");
         $items = $ilNavigationHistory->getItems();
         reset($items);
         $cnt = 0;
         $first = true;
         foreach ($items as $k => $item) {
             if ($cnt >= 10) {
                 break;
             }
             if (!isset($item["ref_id"]) || !isset($_GET["ref_id"]) || ($item["ref_id"] != $_GET["ref_id"] || !$first)) {
                 if ($cnt == 0) {
                     $gl->addGroupHeader($lng->txt("last_visited"), "ilLVNavEnt");
                 }
                 $obj_id = ilObject::_lookupObjId($item["ref_id"]);
                 $cnt++;
                 $icon = ilUtil::img(ilObject::_getIcon($obj_id, "tiny"));
                 $ititle = ilUtil::shortenText(strip_tags($item["title"]), 50, true);
                 // #11023
                 $gl->addEntry($icon . " " . $ititle, $item["link"], "_top", "", "ilLVNavEnt");
             }
             $first = false;
         }
         if ($cnt > 0) {
             $gl->addEntry("ยป " . $lng->txt("remove_entries"), "#", "", "return il.MainMenu.removeLastVisitedItems('" . $ilCtrl->getLinkTargetByClass("ilnavigationhistorygui", "removeEntries", "", true) . "');", "ilLVNavEnt");
         }
         $a_tpl->setVariable("REP_EN_OV", $gl->getHTML());
     }
     // desktop
     if ($a_id == "desktop") {
         $gl = new ilGroupedListGUI();
         $gl->setAsDropDown(true);
         // overview
         $gl->addEntry($lng->txt("overview"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSelectedItems", "_top", "", "", "mm_pd_sel_items", ilHelp::getMainMenuTooltip("mm_pd_sel_items"), "left center", "right center", false);
         // my groups and courses, if both is available
         if ($ilSetting->get('disable_my_offers') == 0 && $ilSetting->get('disable_my_memberships') == 0) {
             $gl->addEntry($lng->txt("my_courses_groups"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToMemberships", "_top", "", "", "mm_pd_crs_grp", ilHelp::getMainMenuTooltip("mm_pd_crs_grp"), "left center", "right center", false);
         }
         // bookmarks
         if (!$this->ilias->getSetting("disable_bookmarks")) {
             $gl->addEntry($lng->txt("bookmarks"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToBookmarks", "_top", "", "", "mm_pd_bookm", ilHelp::getMainMenuTooltip("mm_pd_bookm"), "left center", "right center", false);
         }
         // private notes
         if (!$this->ilias->getSetting("disable_notes")) {
             $gl->addEntry($lng->txt("notes_and_comments"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNotes", "_top", "", "", "mm_pd_notes", ilHelp::getMainMenuTooltip("mm_pd_notes"), "left center", "right center", false);
         }
         // news
         if ($ilSetting->get("block_activated_news")) {
             $gl->addEntry($lng->txt("news"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToNews", "_top", "", "", "mm_pd_news", ilHelp::getMainMenuTooltip("mm_pd_news"), "left center", "right center", false);
         }
         // overview is always active
         $gl->addSeparator();
         $separator = false;
         if (!$ilSetting->get("disable_personal_workspace")) {
             // workspace
             $gl->addEntry($lng->txt("personal_workspace"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace", "_top", "", "", "mm_pd_wsp", ilHelp::getMainMenuTooltip("mm_pd_wsp"), "left center", "right center", false);
             $separator = true;
         }
         // portfolio
         if ($ilSetting->get('user_portfolios')) {
             $gl->addEntry($lng->txt("portfolio"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio", "_top", "", "", "mm_pd_port", ilHelp::getMainMenuTooltip("mm_pd_port"), "left center", "right center", false);
             $separator = true;
         }
         // skills
         $skmg_set = new ilSetting("skmg");
         if ($skmg_set->get("enable_skmg")) {
             $gl->addEntry($lng->txt("skills"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSkills", "_top", "", "", "mm_pd_skill", ilHelp::getMainMenuTooltip("mm_pd_skill"), "left center", "right center", false);
             $separator = true;
         }
         // Learning Progress
         include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
         if (ilObjUserTracking::_enabledLearningProgress() && (ilObjUserTracking::_hasLearningProgressOtherUsers() || ilObjUserTracking::_hasLearningProgressLearner())) {
             //$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
             $gl->addEntry($lng->txt("learning_progress"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToLP", "_top", "", "", "mm_pd_lp", ilHelp::getMainMenuTooltip("mm_pd_lp"), "left center", "right center", false);
             $separator = true;
         }
         if ($separator) {
             $gl->addSeparator();
         }
         $separator = false;
         // calendar
         include_once './Services/Calendar/classes/class.ilCalendarSettings.php';
         $settings = ilCalendarSettings::_getInstance();
         if ($settings->isEnabled()) {
             $gl->addEntry($lng->txt("calendar"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToCalendar", "_top", "", "", "mm_pd_cal", ilHelp::getMainMenuTooltip("mm_pd_cal"), "left center", "right center", false);
             $separator = true;
         }
         // mail
         if ($this->mail) {
             $gl->addEntry($lng->txt('mail'), 'ilias.php?baseClass=ilMailGUI', '_top', "", "", "mm_pd_mail", ilHelp::getMainMenuTooltip("mm_pd_mail"), "left center", "right center", false);
             $separator = true;
         }
         // contacts
         if (!$this->ilias->getSetting('disable_contacts') && ($this->ilias->getSetting('disable_contacts_require_mail') || $rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))) {
             $gl->addEntry($lng->txt('mail_addressbook'), 'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToContacts', '_top', "", "", "mm_pd_contacts", ilHelp::getMainMenuTooltip("mm_pd_contacts"), "left center", "right center", false);
             $separator = true;
         }
         if ($separator) {
             $gl->addSeparator();
         }
         // profile
         $gl->addEntry($lng->txt("personal_profile"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToProfile", "_top", "", "", "mm_pd_profile", ilHelp::getMainMenuTooltip("mm_pd_profile"), "left center", "right center", false);
         // settings
         $gl->addEntry($lng->txt("personal_settings"), "ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToSettings", "_top", "", "", "mm_pd_sett", ilHelp::getMainMenuTooltip("mm_pd_sett"), "left center", "right center", false);
         $a_tpl->setVariable("DESK_CONT_OV", $gl->getHTML());
     }
     if (IS_PAYMENT_ENABLED) {
         // shop
         if ($a_id == "shop") {
             $gl = new ilGroupedListGUI();
             $gl->setAsDropDown(true);
             // shop_content
             $gl->addEntry($lng->txt("content"), "ilias.php?baseClass=ilShopController&cmd=firstpage", "_top");
             // shoppingcart
             include_once 'Services/Payment/classes/class.ilPaymentShoppingCart.php';
             global $ilUser;
             $objShoppingCart = new ilPaymentShoppingCart($ilUser);
             $items = $objShoppingCart->getEntries();
             if (count($items) > 0) {
                 $gl->addEntry($lng->txt("shoppingcart") . ' (' . count($items) . ')', "ilias.php?baseClass=ilShopController&cmdClass=ilshopshoppingcartgui", "_top");
             }
             $a_tpl->setVariable("SHOP_CONT_OV", $gl->getHTML());
         }
     }
     $a_tpl->setVariable("TXT_" . $id_up, $a_txt);
     $a_tpl->setVariable("SCRIPT_" . $id_up, $a_script);
     $a_tpl->setVariable("TARGET_" . $id_up, $a_target);
     if ($this->active == $a_id || $this->active == "" && $a_id == "repository") {
         //$a_tpl->setVariable("MM_CLASS", "MMActive");
         $a_tpl->setVariable("SEL", '<span class="ilAccHidden">(' . $lng->txt("stat_selected") . ')</span>');
     } else {
         //$a_tpl->setVariable("MM_CLASS", "MMInactive");
     }
     if ($a_id == "repository") {
         include_once "./Services/Accessibility/classes/class.ilAccessKey.php";
         if (ilAccessKey::getKey(ilAccessKey::LAST_VISITED) != "") {
             $a_tpl->setVariable("ACC_KEY_REPOSITORY", 'accesskey="' . ilAccessKey::getKey(ilAccessKey::LAST_VISITED) . '"');
         }
     }
     if ($a_id == "desktop") {
         include_once "./Services/Accessibility/classes/class.ilAccessKey.php";
         if (ilAccessKey::getKey(ilAccessKey::PERSONAL_DESKTOP) != "") {
             $a_tpl->setVariable("ACC_KEY_DESKTOP", 'accesskey="' . ilAccessKey::getKey(ilAccessKey::PERSONAL_DESKTOP) . '"');
         }
     }
     $a_tpl->parseCurrentBlock();
 }
 /**
  * Save access keys
  */
 function saveAccessKeys()
 {
     global $ilCtrl, $lng, $ilAccess;
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         include_once "./Services/Accessibility/classes/class.ilAccessKey.php";
         ilAccessKey::writeKeys(ilUtil::stripSlashesArray($_POST["acckey"]));
         ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
     }
     $ilCtrl->redirect($this, "editAccessKeys");
 }
Example #5
0
 /**
  * Get single access key.
  *
  * @param	string		lang key, "0" means default values
  */
 static function getKey($a_func_id, $lang_key = "0", $a_ignore_default = false)
 {
     global $ilDB;
     $key = "";
     // get defaults
     if ($lang_key != "0" && !$a_ignore_default) {
         $key = ilAccessKey::getKey($a_func_id);
     }
     // get keys of selected language
     $set = $ilDB->query("SELECT * FROM acc_access_key " . " WHERE lang_key = " . $ilDB->quote($lang_key, "text") . " AND function_id = " . $ilDB->quote($a_func_id, "integer"));
     if ($rec = $ilDB->fetchAssoc($set)) {
         $key = $rec["access_key"];
     }
     return $key;
 }
Example #6
0
 /**
  * Render current HTML attributes
  * 
  * @param array $a_additional_attr
  * @return string
  */
 protected function renderAttributes(array $a_additional_attr = null)
 {
     $attr = array();
     $attr["id"] = $this->getId();
     $attr["class"] = $this->gatherCssClasses();
     $attr["onclick"] = $this->getOnClick();
     if ($this->getAccessKey()) {
         include_once "./Services/Accessibility/classes/class.ilAccessKey.php";
         $attr["accesskey"] = ilAccessKey::getKey($this->getAccessKey());
     }
     if ($this->isDisabled()) {
         $attr["disabled"] = "disabled";
     }
     if (sizeof($a_additional_attr)) {
         $attr = array_merge($attr, $a_additional_attr);
     }
     return $this->renderAttributesHelper($attr);
 }