Exemplo n.º 1
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();
 }
Exemplo n.º 2
0
 /**
  * read and set mail object id
  * @access	private
  */
 function readMailObjectReferenceId()
 {
     include_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
     $this->mail_obj_ref_id = ilMailGlobalServices::getMailObjectRefId();
 }
 function __initSubTabs($a_cmd)
 {
     /**
      * @var $rbacsystem ilRbacSystem
      */
     global $ilTabs, $ilSetting, $ilHelp, $rbacsystem, $ilUser;
     $ilHelp->setScreenIdComponent("user");
     $showPassword = $a_cmd == 'showPassword' ? true : false;
     $showGeneralSettings = $a_cmd == 'showGeneralSettings' ? true : false;
     $showMailOptions = $a_cmd == 'showMailOptions' ? true : false;
     //		$showjsMath = ($a_cmd == 'showjsMath') ? true : false;
     $showChatOptions = $a_cmd == 'showChatOptions' ? true : false;
     // old profile
     // general settings
     $ilTabs->addTarget("general_settings", $this->ctrl->getLinkTarget($this, "showGeneralSettings"), "", "", "", $showGeneralSettings);
     // password
     if ($this->allowPasswordChange()) {
         $ilTabs->addTarget("password", $this->ctrl->getLinkTarget($this, "showPassword"), "", "", "", $showPassword);
     }
     include_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
     if ($rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
         $ilTabs->addTarget("mail_settings", $this->ctrl->getLinkTarget($this, "showMailOptions"), "", "", "", $showMailOptions);
     }
     $chatSettings = new ilSetting('chatroom');
     $notificationSettings = new ilSetting('notifications');
     if ($chatSettings->get('chat_enabled', false) && $notificationSettings->get('enable_osd', false) && $chatSettings->get('play_invitation_sound', false)) {
         $ilTabs->addTarget('chat_settings', $this->ctrl->getLinkTarget($this, 'showChatOptions'), '', '', '', $showChatOptions);
     }
     include_once "./Services/Administration/classes/class.ilSetting.php";
     /*		$jsMathSetting = new ilSetting("jsMath");
     		if ($jsMathSetting->get("enable"))
     		{
     			$ilTabs->addTarget("jsmath_extt_jsmath", $this->ctrl->getLinkTarget($this, "showjsMath"),
     									 "", "", "", $showjsMath);
     		}*/
     if ((bool) $ilSetting->get('user_delete_own_account') && $ilUser->getId() != SYSTEM_USER_ID) {
         $ilTabs->addTab("delacc", $this->lng->txt('user_delete_own_account'), $this->ctrl->getLinkTarget($this, "deleteOwnAccount1"));
     }
 }
Exemplo n.º 4
0
 /**
  * Static method 
  * check how many unread mails are in inbox
  * @access	public
  * @static
  * @return	int		number of mails
  */
 function _countNewMails($a_user_id)
 {
     include_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
     return ilMailGlobalServices::getNumberOfNewMailsByUserId($a_user_id);
 }
 function hasNewMail($sid)
 {
     $this->initAuth($sid);
     $this->initIlias();
     if (!$this->__checkSession($sid)) {
         return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
     }
     global $ilUser;
     include_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
     if (ilMailGlobalServices::getNumberOfNewMailsByUserId($ilUser->getId()) > 0) {
         return true;
     } else {
         return false;
     }
 }
 /**
  * get flat bookmark list for personal desktop
  */
 function fillRow($a_set)
 {
     global $ilUser, $ilCtrl, $lng, $ilSetting, $rbacsetting, $rbacsystem;
     // mail link
     $a_set["mail_to"] = "";
     if ($this->mail_allowed && $rbacsystem->checkAccessOfUser($a_set['id'], 'internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
         $a_set['mail_url'] = ilMailFormCall::getLinkTarget($this->topGuiObj, '', array(), array('type' => 'new', 'rcp_to' => urlencode($a_set['login'])));
     }
     // check for profile
     $a_set["profile"] = in_array(ilObjUser::_lookupPref($a_set["id"], "public_profile"), array("y", "g"));
     // user image
     if ($this->getCurrentDetailLevel() > 2) {
         if ($a_set["mail_url"] != "") {
             $this->tpl->setCurrentBlock("mailto_link");
             $this->tpl->setVariable("TXT_MAIL", $lng->txt("mail"));
             $this->tpl->setVariable("MAIL_URL", $a_set["mail_url"]);
             $this->tpl->parseCurrentBlock();
         }
         $chatSettings = new ilSetting('chatroom');
         if ($chatSettings->get('chat_enabled')) {
             if (!$this->__showActiveChatsOfUser($a_set["id"])) {
                 // Show invite to chat
                 $this->__showChatInvitation($a_set["id"]);
             }
             global $rbacsystem;
             include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
             if ($a_set["id"] == $ilUser->getId() && $rbacsystem->checkAccess('read', ilObjChatroom::_getPublicRefId())) {
                 $this->tpl->setCurrentBlock('chat_link');
                 $this->tpl->setVariable('TXT_CHAT_INVITE', $lng->txt('chat_enter_public_room'));
                 $this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_enter_public_room_tooltip'));
                 //					$this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId());
                 $this->tpl->setVariable('CHAT_LINK', './ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id=' . ilObjChatroom::_getPublicRefId());
                 $this->tpl->parseCurrentBlock();
             }
         }
         // user image
         $this->tpl->setCurrentBlock("usr_image");
         $this->tpl->setVariable("USR_IMAGE", ilObjUser::_getPersonalPicturePath($a_set["id"], "xxsmall"));
         $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
         $this->tpl->parseCurrentBlock();
         $this->tpl->touchBlock("usr_image_space");
         $pd_set = new ilSetting("pd");
         $osi_server = $pd_set->get("osi_host");
         //			if (trim($osi_server) != "")
         //			{
         // instant messengers
         // 1 indicates to use online status check
         $im_arr = array("icq" => 0, "yahoo" => 1, "msn" => 0, "aim" => 0, "skype" => 1, "jabber" => 0, "voip" => 0);
         // use onlinestatus.org
         // when enabled all instant messengers are checked online and ignores settings above
         if (trim($osi_server) != "") {
             $osi_enable = true;
         }
         // removed calls to external servers due to
         // bug 10583, alex 8 Mar 2013
         foreach ($im_arr as $im_name => $im_check) {
             if ($im_id = ilObjUser::_lookupIm($a_set["id"], $im_name)) {
                 $im_url = "";
                 switch ($im_name) {
                     case "icq":
                         $im_url = "http://http://www.icq.com/people/" . $im_id;
                         break;
                     case "yahoo":
                         $im_url = "http://edit.yahoo.com/config/send_webmesg?target=" . $im_id . "&src=pg";
                         break;
                     case "msn":
                         $im_url = "http://messenger.live.com";
                         break;
                     case "aim":
                         //$im_url = "aim:GoIM?screenname=".$im_id;
                         $im_url = "http://aimexpress.aim.com";
                         break;
                     case "skype":
                         $im_url = "skype:" . $im_id . "?call";
                         break;
                 }
                 $im_img = ilUtil::getImagePath($im_name . 'online.png');
                 if ($im_url != "") {
                     $this->tpl->setCurrentBlock("im_link_start");
                     $this->tpl->setVariable("URL_IM", $im_url);
                     $this->tpl->parseCurrentBlock();
                     $this->tpl->touchBlock("im_link_end");
                 }
                 $this->tpl->setCurrentBlock("instant_messengers");
                 $this->tpl->setVariable("IMG_IM_ICON", $im_img);
                 $this->tpl->setVariable("TXT_IM_ICON", $lng->txt("im_" . $im_name));
                 $icon_id = "im_" . $im_name . "_usr_" . $a_set["id"];
                 $this->tpl->setVariable("ICON_ID", $icon_id);
                 include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
                 ilTooltipGUI::addTooltip($icon_id, $lng->txt("im_" . $im_name) . ": " . $im_id, "", "top center", "bottom center");
                 $this->tpl->parseCurrentBlock();
             }
         }
         //			}
     }
     // username
     if (!$a_set["profile"]) {
         $this->tpl->setVariable("USR_LOGIN", $a_set["login"]);
     } else {
         if ($this->getCurrentDetailLevel() > 2) {
             $this->tpl->setVariable("USR_LOGIN", "<br />" . $a_set["login"]);
         } else {
             $this->tpl->setVariable("USR_LOGIN", " [" . $a_set["login"] . "]");
         }
     }
     // profile link
     if ($a_set["profile"]) {
         include_once "Services/User/classes/class.ilUserUtil.php";
         $user_name = ilUserUtil::getNamePresentation($a_set["id"], false, false, "", false, true, false);
         $this->tpl->setCurrentBlock("profile_link");
         $this->tpl->setVariable("TXT_VIEW", $lng->txt("profile"));
         // see ilPersonalProfileGUI::getProfilePortfolio()
         $has_prtf = false;
         if ($ilSetting->get('user_portfolios')) {
             include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
             $has_prtf = ilObjPortfolio::getDefaultPortfolio($a_set["id"]);
         }
         if (!$has_prtf) {
             // (simple) profile: center column
             $ilCtrl->setParameter($this, "user", $a_set["id"]);
             $this->tpl->setVariable("LINK_PROFILE", $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
         } else {
             // portfolio: fullscreen
             include_once "Services/Link/classes/class.ilLink.php";
             $this->tpl->setVariable("LINK_PROFILE", ilLink::_getLink($a_set["id"], "usr"));
             $this->tpl->setVariable("LINK_TARGET", "_blank");
         }
         $this->tpl->setVariable("USR_ID", $a_set["id"]);
         $this->tpl->setVariable("LINK_FULLNAME", $user_name);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setVariable("USR_FULLNAME", "");
     }
 }
 /**
  * execute command
  */
 function &executeCommand()
 {
     global $ilSetting, $rbacsystem;
     $next_class = $this->ctrl->getNextClass();
     $this->ctrl->setReturn($this, "show");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation('filesystem', 'delos.css', 'Services/Calendar'));
     // read last active subsection
     if (isset($_GET['PDHistory']) && $_GET['PDHistory']) {
         $next_class = $this->__loadNextClass();
     }
     $this->__storeLastClass($next_class);
     // check for permission to view contacts
     if ($next_class == 'ilmailaddressbookgui' && ($this->ilias->getSetting("disable_contacts") || !$this->ilias->getSetting("disable_contacts_require_mail") && !$rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()))) {
         $next_class = '';
         ilUtil::sendFailure($this->lng->txt('no_permission'));
     }
     switch ($next_class) {
         case "ilbookmarkadministrationgui":
             if ($ilSetting->get('disable_bookmarks')) {
                 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
                 ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
                 return;
             }
             include_once "./Services/Bookmarks/classes/class.ilBookmarkAdministrationGUI.php";
             $bookmark_gui = new ilBookmarkAdministrationGUI();
             if ($bookmark_gui->getMode() == 'tree') {
                 $this->getTreeModeTemplates();
             } else {
                 $this->getStandardTemplates();
             }
             $this->setTabs();
             $ret =& $this->ctrl->forwardCommand($bookmark_gui);
             break;
             // profile
         // profile
         case "ilpersonalprofilegui":
             $this->getStandardTemplates();
             $this->setTabs();
             include_once "./Services/User/classes/class.ilPersonalProfileGUI.php";
             $profile_gui = new ilPersonalProfileGUI();
             $ret =& $this->ctrl->forwardCommand($profile_gui);
             break;
             // settings
         // settings
         case "ilpersonalsettingsgui":
             $this->getStandardTemplates();
             $this->setTabs();
             include_once "./Services/User/classes/class.ilPersonalSettingsGUI.php";
             $settings_gui = new ilPersonalSettingsGUI();
             $ret =& $this->ctrl->forwardCommand($settings_gui);
             break;
             // profile
         // profile
         case "ilobjusergui":
             include_once './Services/User/classes/class.ilObjUserGUI.php';
             $user_gui = new ilObjUserGUI("", $_GET["user"], false, false);
             $ret =& $this->ctrl->forwardCommand($user_gui);
             break;
         case 'ilcalendarpresentationgui':
             $this->getStandardTemplates();
             $this->displayHeader();
             $this->tpl->setTitle($this->lng->txt("calendar"));
             $this->setTabs();
             include_once './Services/Calendar/classes/class.ilCalendarPresentationGUI.php';
             $cal = new ilCalendarPresentationGUI();
             $ret = $this->ctrl->forwardCommand($cal);
             $this->tpl->show();
             break;
             // pd notes
         // pd notes
         case "ilpdnotesgui":
             if ($ilSetting->get('disable_notes')) {
                 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
                 ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
                 return;
             }
             $this->getStandardTemplates();
             $this->setTabs();
             include_once "./Services/Notes/classes/class.ilPDNotesGUI.php";
             $pd_notes_gui = new ilPDNotesGUI();
             $ret =& $this->ctrl->forwardCommand($pd_notes_gui);
             break;
             // pd news
         // pd news
         case "ilpdnewsgui":
             $this->getStandardTemplates();
             $this->setTabs();
             include_once "./Services/News/classes/class.ilPDNewsGUI.php";
             $pd_news_gui = new ilPDNewsGUI();
             $ret =& $this->ctrl->forwardCommand($pd_news_gui);
             break;
         case "illearningprogressgui":
             $this->getStandardTemplates();
             $this->setTabs();
             include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui = new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_PERSONAL_DESKTOP, 0);
             $ret =& $this->ctrl->forwardCommand($new_gui);
             break;
         case "ilcolumngui":
             $this->getStandardTemplates();
             $this->setTabs();
             include_once "./Services/Block/classes/class.ilColumnGUI.php";
             $column_gui = new ilColumnGUI("pd");
             $this->initColumn($column_gui);
             $this->show();
             break;
             // contacts
         // contacts
         case 'ilmailaddressbookgui':
             $this->getStandardTemplates();
             $this->setTabs();
             $this->tpl->setTitle($this->lng->txt("mail_addressbook"));
             include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php';
             $mailgui = new ilMailAddressbookGUI();
             $ret = $this->ctrl->forwardCommand($mailgui);
             break;
         case 'ilpersonalworkspacegui':
             $this->getStandardTemplates();
             $this->setTabs();
             include_once 'Services/PersonalWorkspace/classes/class.ilPersonalWorkspaceGUI.php';
             $wsgui = new ilPersonalWorkspaceGUI();
             $ret = $this->ctrl->forwardCommand($wsgui);
             $this->tpl->show();
             break;
         case 'ilportfoliorepositorygui':
             $this->getStandardTemplates();
             $this->setTabs();
             include_once 'Modules/Portfolio/classes/class.ilPortfolioRepositoryGUI.php';
             $pfgui = new ilPortfolioRepositoryGUI();
             $ret = $this->ctrl->forwardCommand($pfgui);
             $this->tpl->show();
             break;
         case 'ilpersonalskillsgui':
             $this->setTabs();
             include_once './Services/Skill/classes/class.ilPersonalSkillsGUI.php';
             $skgui = new ilPersonalSkillsGUI();
             $this->getStandardTemplates();
             $ret = $this->ctrl->forwardCommand($skgui);
             $this->tpl->show();
             break;
         case 'redirect':
             $this->redirect();
             break;
         default:
             $this->getStandardTemplates();
             $this->setTabs();
             $cmd = $this->ctrl->getCmd("show");
             $this->{$cmd}();
             break;
     }
     $ret = null;
     return $ret;
 }