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

Handles display of the main menu. More...

+ Collaboration diagram for ilMainMenuGUI:

Public Member Functions

 ilMainMenuGUI ($a_target="_top", $a_use_start_template=false)
 setSmallMode ($a_small)
 setActive ($a_active)
 setTemplate (&$tpl)
 set output template
 getTemplate ()
 get output template
 setLoginTargetPar ($a_val)
 Set target parameter for login (public sector).
 getLoginTargetPar ()
 Get target parameter for login.
 setTemplateVars ()
 set all template variables (images, scripts, target frames, ...)
 renderStatusBox ($a_tpl)
 Render status box.
 renderMainMenuListEntries ($a_tpl, $a_call_get=true)
 desc
 renderEntry ($a_tpl, $a_id, $a_txt, $a_script, $a_target="_top")
 Render main menu entry.
 getScriptTarget ($a_script)
 generates complete script target (private)
 _checkAdministrationPermission ()
 getHTML ()
 renderDropDown ($a_tpl, $a_id)
 GetDropDownHTML.

Static Public Member Functions

static getLanguageSelection ($a_in_topbar=false)

Data Fields

 $ilias
 $tpl
 $target
 $start_template

Protected Member Functions

 getMemberViewHTML ()
 getHeaderURL ()

Detailed Description

Handles display of the main menu.

Author
Alex Killing
Version
Id:
class.ilMainMenuGUI.php 46317 2013-11-20 10:44:35Z jluetzen

Definition at line 13 of file class.ilMainMenuGUI.php.

Member Function Documentation

ilMainMenuGUI::_checkAdministrationPermission ( )

Definition at line 745 of file class.ilMainMenuGUI.php.

Referenced by ilObjMediaPoolGUI\createMediaFromUploadDir(), ilAdministrationGUI\executeCommand(), ilObjMediaPoolGUI\listMedia(), renderMainMenuListEntries(), and ilObjMediaPoolGUI\selectUploadDirFiles().

{
global $rbacsystem;
//if($rbacsystem->checkAccess("visible,read", SYSTEM_FOLDER_ID))
if($rbacsystem->checkAccess("visible", SYSTEM_FOLDER_ID))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilMainMenuGUI::getHeaderURL ( )
protected

Definition at line 953 of file class.ilMainMenuGUI.php.

Referenced by setTemplateVars().

{
global $ilAccess;
$url = "#";
if($ilAccess->checkAccess("read", "", 1))
{
$url = "./goto.php?target=root_1";
}
return $url;
}

+ Here is the caller graph for this function:

ilMainMenuGUI::getHTML ( )

Definition at line 757 of file class.ilMainMenuGUI.php.

References ilMemberViewSettings\getInstance(), getMemberViewHTML(), and setTemplateVars().

{
include_once './Services/Container/classes/class.ilMemberViewSettings.php';
if($set->isActive())
{
return $this->getMemberViewHTML();
}
$this->setTemplateVars();
return $this->tpl->get();
}

+ Here is the call graph for this function:

static ilMainMenuGUI::getLanguageSelection (   $a_in_topbar = false)
static

Definition at line 101 of file class.ilMainMenuGUI.php.

References $lng, ilUtil\appendUrlParameterString(), and ilAdvancedSelectionListGUI\DOWN_ARROW_TOPBAR.

Referenced by setTemplateVars(), and ilTemplate\setTopBar().

{
global $lng;
include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
$selection = new ilAdvancedSelectionListGUI();
$selection->setFormSelectMode("change_lang_to", "ilLanguageSelection", true,
"#", "ilNavHistory", "ilNavHistoryForm",
"", $lng->txt("ok"), "ilLogin");
//$selection->setListTitle($lng->txt("choose_language"));
$selection->setListTitle($lng->txt("language"));
$selection->setItemLinkClass("small");
if($a_in_topbar)
{
}
$languages = $lng->getInstalledLanguages();
if(sizeof($languages) > 0)
{
foreach ($languages as $lang_key)
{
$base = substr($_SERVER["REQUEST_URI"], strrpos($_SERVER["REQUEST_URI"], "/") + 1);
$base = preg_replace("/&*lang=[a-z]{2}&*/", "", $base);
"lang=".$lang_key);
$link = str_replace("?&", "?", $link);
$selection->addItem($lng->_lookupEntry($lang_key, "meta", "meta_l_".$lang_key),
$lang_key, $link, "", "", "");
}
return $selection->getHTML();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMainMenuGUI::getLoginTargetPar ( )

Get target parameter for login.

Definition at line 96 of file class.ilMainMenuGUI.php.

Referenced by setTemplateVars().

{
return $this->login_target_par;
}

+ Here is the caller graph for this function:

ilMainMenuGUI::getMemberViewHTML ( )
protected

Definition at line 773 of file class.ilMainMenuGUI.php.

References $_GET, $lng, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilUtil\getImagePath().

Referenced by getHTML().

{
global $lng;
$this->tpl = new ilTemplate('tpl.member_view_main_menu.html',true,true,'Services/MainMenu');
$this->tpl->setVariable('TXT_MM_HEADER',$lng->txt('mem_view_long'));
$this->tpl->setVariable('TXT_MM_CLOSE_PREVIEW',$lng->txt('mem_view_close'));
$this->tpl->setVariable('MM_CLOSE_IMG',ilUtil::getImagePath('cancel.gif'));
include_once './classes/class.ilLink.php';
$this->tpl->setVariable(
'HREF_CLOSE_MM',
(int) $_GET['ref_id'],
array('mv' => 0)));
return $this->tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMainMenuGUI::getScriptTarget (   $a_script)

generates complete script target (private)

Definition at line 725 of file class.ilMainMenuGUI.php.

References $ilias.

{
global $ilias;
$script = "./".$a_script;
//if ($this->start_template == true)
//{
//if(is_file("./templates/".$ilias->account->skin."/tpl.start.html"))
//{
// $script = "./start.php?script=".rawurlencode($script);
//}
//}
if (defined("ILIAS_MODULE"))
{
$script = ".".$script;
}
return $script;
}
ilMainMenuGUI::getTemplate ( )

get output template

Definition at line 78 of file class.ilMainMenuGUI.php.

{
echo "ilMainMenu->getTemplate is deprecated. Use getHTML instead.";
return;
}
ilMainMenuGUI::ilMainMenuGUI (   $a_target = "_top",
  $a_use_start_template = false 
)
Parameters
string$a_targettarget frame
boolean$a_use_start_templatetrue means: target scripts should be called through start template

Definition at line 31 of file class.ilMainMenuGUI.php.

References $ilias, and ilMailGlobalServices\getMailObjectRefId().

{
global $ilias, $rbacsystem, $ilUser;
$this->tpl = new ilTemplate("tpl.main_menu.html", true, true,
"Services/MainMenu");
$this->ilias =& $ilias;
$this->target = $a_target;
$this->start_template = $a_use_start_template;
$this->small = false;
$this->mail = false;
if($ilUser->getId() != ANONYMOUS_USER_ID)
{
if($rbacsystem->checkAccess('mail_visible', ilMailGlobalServices::getMailObjectRefId()))
{
$this->mail = true;
}
}
}

+ Here is the call graph for this function:

ilMainMenuGUI::renderDropDown (   $a_tpl,
  $a_id 
)

GetDropDownHTML.

Parameters
@return

Definition at line 801 of file class.ilMainMenuGUI.php.

References $ilSetting, $lng, ilObjUserTracking\_enabledLearningProgress(), ilCalendarSettings\_getInstance(), ilAdvancedSelectionListGUI\DOWN_ARROW_LIGHT, and ilMailGlobalServices\getMailObjectRefId().

Referenced by renderMainMenuListEntries().

{
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->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");
{
//$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');
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('mail_visible', 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
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
case "administration":
$selection->setListTitle($lng->txt("administration"));
$selection->setId("dd_adm");
$selection->setAsynch(true);
$selection->setAsynchUrl("ilias.php?baseClass=ilAdministrationGUI&cmd=getDropDown");
//$this->renderEntry($a_tpl, "administration",
// $lng->txt("administration"),
// $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
// $this->target);
break;
}
// $selection->setTriggerEvent("mouseover");
// $selection->setAutoHide(true);
$html = $selection->getHTML();
$a_tpl->setVariable($id_up."_DROP_DOWN", $html);
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMainMenuGUI::renderEntry (   $a_tpl,
  $a_id,
  $a_txt,
  $a_script,
  $a_target = "_top" 
)

Render main menu entry.

Parameters
@return

Definition at line 468 of file class.ilMainMenuGUI.php.

References $_GET, $ilSetting, $lng, $separator, ilObjUserTracking\_enabledLearningProgress(), ilObject\_getIcon(), ilCalendarSettings\_getInstance(), ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilUtil\getImagePath(), ilAccessKey\getKey(), ilMailGlobalServices\getMailObjectRefId(), ilUtil\img(), ilAccessKey\LAST_VISITED, ilAccessKey\PERSONAL_DESKTOP, and ilUtil\shortenText().

Referenced by renderMainMenuListEntries().

{
global $lng, $ilNavigationHistory, $ilSetting, $rbacsystem;
$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();
include_once("./classes/class.ilLink.php");
$a_tpl->setVariable("ARROW_IMG", ilUtil::getImagePath("mm_down_arrow.gif"));
$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)) // do not list current item
{
if ($cnt == 0)
{
$gl->addGroupHeader($lng->txt("last_visited"));
}
$obj_id = ilObject::_lookupObjId($item["ref_id"]);
$cnt ++;
$icon = ilUtil::img(ilObject::_getIcon($obj_id, "tiny"));
$gl->addEntry($icon." ".ilUtil::shortenText($item["title"], 50, true), $item["link"],
"_top");
}
$first = false;
}
$a_tpl->setVariable("REP_EN_OV", $gl->getHTML());
}
// desktop
if ($a_id == "desktop")
{
$gl = new ilGroupedListGUI();
$a_tpl->setVariable("ARROW_IMG", ilUtil::getImagePath("mm_down_arrow.gif"));
// overview
$gl->addEntry($lng->txt("overview"),
"ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSelectedItems",
"_top");
// 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&amp;cmd=jumpToMemberships",
"_top");
}
// bookmarks
if (!$this->ilias->getSetting("disable_bookmarks"))
{
$gl->addEntry($lng->txt("bookmarks"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToBookmarks",
"_top");
}
// private notes
if (!$this->ilias->getSetting("disable_notes"))
{
$gl->addEntry($lng->txt("notes_and_comments"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNotes",
"_top");
}
// news
if ($ilSetting->get("block_activated_news"))
{
$gl->addEntry($lng->txt("news"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToNews",
"_top");
}
// 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&amp;cmd=jumpToWorkspace",
"_top");
$separator = true;
}
// portfolio
if ($ilSetting->get('user_portfolios'))
{
$gl->addEntry($lng->txt("portfolio"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToPortfolio",
"_top");
$separator = true;
}
// skills
$skmg_set = new ilSetting("skmg");
if ($skmg_set->get("enable_skmg"))
{
$gl->addEntry($lng->txt("skills"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSkills",
"_top");
$separator = true;
}
// Learning Progress
include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
{
//$ilTabs->addTarget("learning_progress", $this->ctrl->getLinkTargetByClass("ilLearningProgressGUI"));
$gl->addEntry($lng->txt("learning_progress"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToLP",
"_top");
$separator = true;
}
{
$gl->addSeparator();
}
$separator = false;
// calendar
include_once('./Services/Calendar/classes/class.ilCalendarSettings.php');
if($settings->isEnabled())
{
$gl->addEntry($lng->txt("calendar"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToCalendar",
"_top");
$separator = true;
}
// mail
if($this->mail)
{
$gl->addEntry($lng->txt('mail'), 'ilias.php?baseClass=ilMailGUI', '_top');
$separator = true;
}
// contacts
if(!$this->ilias->getSetting('disable_contacts') &&
($this->ilias->getSetting('disable_contacts_require_mail') ||
$rbacsystem->checkAccess('mail_visible', ilMailGlobalServices::getMailObjectRefId())))
{
$gl->addEntry($lng->txt('mail_addressbook'), 'ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToContacts', '_top');
$separator = true;
}
{
$gl->addSeparator();
}
// profile
$gl->addEntry($lng->txt("personal_profile"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToProfile",
"_top");
// settings
$gl->addEntry($lng->txt("personal_settings"), "ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToSettings",
"_top");
$a_tpl->setVariable("DESK_CONT_OV", $gl->getHTML());
}
if(IS_PAYMENT_ENABLED)
{
// shop
if ($a_id == "shop")
{
$gl = new ilGroupedListGUI();
$a_tpl->setVariable("ARROW_IMG", ilUtil::getImagePath("mm_down_arrow.gif"));
// shop_content
$gl->addEntry($lng->txt("content"),
"ilias.php?baseClass=ilShopController&amp;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&amp;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");
{
$a_tpl->setVariable("ACC_KEY_REPOSITORY", 'accesskey="'.
}
}
if($a_id == "desktop")
{
include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
{
$a_tpl->setVariable("ACC_KEY_DESKTOP", 'accesskey="'.
}
}
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMainMenuGUI::renderMainMenuListEntries (   $a_tpl,
  $a_call_get = true 
)

desc

Parameters
@return

Definition at line 355 of file class.ilMainMenuGUI.php.

References $_SESSION, $ilias, $ilSetting, $lng, $title, _checkAdministrationPermission(), ilSearchSettings\_getSearchSettingRefId(), renderDropDown(), and renderEntry().

Referenced by setTemplateVars().

{
global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilAccess;
// personal desktop
if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID)
{
/*$this->renderEntry($a_tpl, "desktop",
$lng->txt("personal_desktop"),
$this->getScriptTarget("ilias.php?baseClass=ilPersonalDesktopGUI"),
$this->target);*/
// $this->renderDropDown($a_tpl, "desktop");
$this->renderEntry($a_tpl, "desktop",
$lng->txt("personal_desktop"), "#");
include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
$ov = new ilOverlayGUI("mm_desk_ov");
$ov->setTrigger("mm_desk_tr");
$ov->setAnchor("mm_desk_tr");
$ov->setAutoHide(false);
$ov->add();
}
// repository
if($ilAccess->checkAccess('visible','',ROOT_FOLDER_ID))
{
include_once('classes/class.ilLink.php');
$nd = $tree->getNodeData(ROOT_FOLDER_ID);
$title = $nd["title"];
if ($title == "ILIAS")
{
$title = $lng->txt("repository");
}
//$this->renderEntry($a_tpl, "repository",
// $title,
// ilLink::_getStaticLink(1,'root',true),
// $this->target);
if ($_SESSION["AccountId"] != ANONYMOUS_USER_ID || IS_PAYMENT_ENABLED)
{
$this->renderEntry($a_tpl, "repository",
$title, "#");
include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
$ov = new ilOverlayGUI("mm_rep_ov");
$ov->setTrigger("mm_rep_tr");
$ov->setAnchor("mm_rep_tr");
$ov->setAutoHide(false);
$ov->add();
}
}
// search
include_once 'Services/Search/classes/class.ilSearchSettings.php';
if($rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
{
/* $this->renderEntry($a_tpl, "search",
$lng->txt("search"),
$this->getScriptTarget('ilias.php?baseClass=ilSearchController'),
$this->target); */
}
// webshop
if(IS_PAYMENT_ENABLED)
{
$title = $lng->txt("shop");
$this->renderEntry($a_tpl, "shop", $title, "#" );
include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
$ov = new ilOverlayGUI("mm_shop_ov");
$ov->setTrigger("mm_shop_tr");
$ov->setAnchor("mm_shop_tr");
$ov->setAutoHide(false);
$ov->add();
}
// administration
{
//$this->renderEntry($a_tpl, "administration",
// $lng->txt("administration"),
// $this->getScriptTarget("ilias.php?baseClass=ilAdministrationGUI"),
// $this->target);
$this->renderDropDown($a_tpl, "administration");
}
// navigation history
/* require_once("Services/Navigation/classes/class.ilNavigationHistoryGUI.php");
$nav_hist = new ilNavigationHistoryGUI();
$nav_html = $nav_hist->getHTML();
if ($nav_html != "")
{
$a_tpl->setCurrentBlock("nav_history");
$a_tpl->setVariable("TXT_LAST_VISITED", $lng->txt("last_visited"));
$a_tpl->setVariable("NAVIGATION_HISTORY", $nav_html);
$a_tpl->parseCurrentBlock();
}*/
if ($a_call_get)
{
return $a_tpl->get();
}
return "";
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMainMenuGUI::renderStatusBox (   $a_tpl)

Render status box.

Definition at line 318 of file class.ilMainMenuGUI.php.

References ilUtil\getImagePath(), and ilMailGlobalServices\getNumberOfNewMailsByUserId().

Referenced by setTemplateVars().

{
global $ilUser;
$box = false;
// new mails?
if($this->mail)
{
$new_mails = ilMailGlobalServices::getNumberOfNewMailsByUserId($ilUser->getId());
if($new_mails > 0)
{
$a_tpl->setCurrentBlock('status_text');
$a_tpl->setVariable('STATUS_TXT', $new_mails);
$a_tpl->parseCurrentBlock();
}
$a_tpl->setCurrentBlock('status_item');
$a_tpl->setVariable('STATUS_IMG', ilUtil::getImagePath('icon_mail_s.gif'));
$a_tpl->setVariable('STATUS_HREF', 'ilias.php?baseClass=ilMailGUI');
$a_tpl->parseCurrentBlock();
$box = true;
}
if ($box)
{
$a_tpl->setCurrentBlock("status_box");
$a_tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMainMenuGUI::setActive (   $a_active)
Parameters
string$a_active"desktop"|"repository"|"search"|"mail"|"chat_invitation"|"administration"

Definition at line 60 of file class.ilMainMenuGUI.php.

{
$this->active = $a_active;
}
ilMainMenuGUI::setLoginTargetPar (   $a_val)

Set target parameter for login (public sector).

This is used by the main menu

Definition at line 88 of file class.ilMainMenuGUI.php.

{
$this->login_target_par = $a_val;
}
ilMainMenuGUI::setSmallMode (   $a_small)

Definition at line 52 of file class.ilMainMenuGUI.php.

{
$this->small = $a_small;
}
ilMainMenuGUI::setTemplate ( $tpl)

set output template

Definition at line 68 of file class.ilMainMenuGUI.php.

References $tpl.

{
echo "ilMainMenu->setTemplate is deprecated. Use getHTML instead.";
return;
$this->tpl =& $tpl;
}
ilMainMenuGUI::setTemplateVars ( )

set all template variables (images, scripts, target frames, ...)

notifications

Definition at line 139 of file class.ilMainMenuGUI.php.

References $_GET, $_SESSION, $ilias, $ilSetting, $lng, $tpl, ilObjSystemFolder\_getHeaderTitle(), ilSearchSettings\_getSearchSettingRefId(), ilObject\_lookupObjId(), ilRegistrationSettings\_lookupRegistrationType(), ilObject\_lookupType(), getHeaderURL(), ilUtil\getImagePath(), getLanguageSelection(), getLoginTargetPar(), ilNotificationOSDHandler\getNotificationsForUser(), ilUtil\getStyleSheetLocation(), IL_COMP_SERVICE, IL_REG_DISABLED, iljQueryUtil\initjQuery(), renderMainMenuListEntries(), and renderStatusBox().

Referenced by getHTML().

{
global $rbacsystem, $lng, $ilias, $tree, $ilUser, $ilSetting, $ilPluginAdmin;
// get user interface plugins
$pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
// search
include_once 'Services/Search/classes/class.ilSearchSettings.php';
if($rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
{
include_once './Services/Search/classes/class.ilMainMenuSearchGUI.php';
$main_search = new ilMainMenuSearchGUI();
$html = "";
// user interface plugin slot + default rendering
include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
$uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_search",
array("main_menu_gui" => $this, "main_menu_search_gui" => $main_search));
if (!$uip->replaced())
{
$html = $main_search->getHTML();
}
$html = $uip->getHTML($html);
if (strlen($html))
{
$this->tpl->setVariable('SEARCHBOX',$html);
}
}
$this->renderStatusBox($this->tpl);
$mmle_html = "";
// user interface plugin slot + default rendering
include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
$uip = new ilUIHookProcessor("Services/MainMenu", "main_menu_list_entries",
array("main_menu_gui" => $this));
if (!$uip->replaced())
{
$mmle_tpl = new ilTemplate("tpl.main_menu_list_entries.html", true, true, "Services/MainMenu");
$mmle_html = $this->renderMainMenuListEntries($mmle_tpl);
}
$mmle_html = $uip->getHTML($mmle_html);
$this->tpl->setVariable("MAIN_MENU_LIST_ENTRIES", $mmle_html);
$link_dir = (defined("ILIAS_MODULE"))
? "../"
: "";
if (!$this->small)
{
// login stuff
if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID)
{
include_once 'Services/Registration/classes/class.ilRegistrationSettingsGUI.php';
{
$this->tpl->setCurrentBlock("registration_link");
$this->tpl->setVariable("TXT_REGISTER",$lng->txt("register"));
$this->tpl->setVariable("LINK_REGISTER", $link_dir."register.php?client_id=".rawurlencode(CLIENT_ID)."&lang=".$ilias->account->getCurrentLanguage());
$this->tpl->parseCurrentBlock();
}
// language selection
if($selection)
{
$this->tpl->setVariable("LANG_SELECT", $selection);
}
$this->tpl->setCurrentBlock("userisanonymous");
$this->tpl->setVariable("TXT_NOT_LOGGED_IN",$lng->txt("not_logged_in"));
$this->tpl->setVariable("TXT_LOGIN",$lng->txt("log_in"));
$target_str = "";
if ($this->getLoginTargetPar() != "")
{
$target_str = $this->getLoginTargetPar();
}
else if ($_GET["ref_id"] != "")
{
if ($tree->isInTree($_GET["ref_id"]) && $_GET["ref_id"] != $tree->getRootId())
{
$obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
$type = ilObject::_lookupType($obj_id);
$target_str = $type."_".$_GET["ref_id"];
}
}
$this->tpl->setVariable("LINK_LOGIN",
$link_dir."login.php?target=".$target_str."&client_id=".rawurlencode(CLIENT_ID)."&cmd=force_login&lang=".$ilias->account->getCurrentLanguage());
$this->tpl->parseCurrentBlock();
}
else
{
$notificationSettings = new ilSetting('notifications');
$chatSettings = new ilSetting('chatroom');
global $tpl;
if ($chatSettings->get('chat_enabled') && $notificationSettings->get('enable_osd')) {
$this->tpl->touchBlock('osd_enabled');
$this->tpl->touchBlock('osd_container');
$tpl->addJavaScript('Services/Notifications/templates/default/notifications.js');
$tpl->addCSS('Services/Notifications/templates/default/osd.css');
include_once "Services/jQuery/classes/class.iljQueryUtil.php";
require_once 'Services/Notifications/classes/class.ilNotificationOSDHandler.php';
$notifications = ilNotificationOSDHandler::getNotificationsForUser($ilUser->getId());
$this->tpl->setVariable('INITIAL_NOTIFICATIONS', json_encode($notifications));
$this->tpl->setVariable('OSD_POLLING_INTERVALL', $notificationSettings->get('osd_polling_intervall') ? $notificationSettings->get('osd_polling_intervall') : '5');
$this->tpl->setVariable('OSD_PLAY_SOUND', $chatSettings->get('play_invitation_sound') ? 'true' : 'false');
foreach($notifications as $notification) {
if ($notification['type'] == 'osd_maint') {
#var_dump($notification);
continue;
}
#var_dump($notification);
$this->tpl->setCurrentBlock('osd_notification_item');
$this->tpl->setVariable('NOTIFICATION_ICON_PATH', $notification['data']->iconPath);
$this->tpl->setVariable('NOTIFICATION_TITLE', $notification['data']->title);
$this->tpl->setVariable('NOTIFICATION_LINK', $notification['data']->link);
$this->tpl->setVariable('NOTIFICATION_LINKTARGET', $notification['data']->linktarget);
$this->tpl->setVariable('NOTIFICATION_ID', $notification['notification_osd_id']);
$this->tpl->setVariable('NOTIFICATION_SHORT_DESCRIPTION', $notification['data']->shortDescription);
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setCurrentBlock("userisloggedin");
$this->tpl->setVariable("TXT_LOGIN_AS",$lng->txt("login_as"));
$this->tpl->setVariable("TXT_LOGOUT2",$lng->txt("logout"));
$this->tpl->setVariable("LINK_LOGOUT2", $link_dir."logout.php?lang=".$ilias->account->getCurrentLanguage());
$this->tpl->setVariable("USERNAME",$ilias->account->getFullname());
$this->tpl->parseCurrentBlock();
}
include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
$header_top_title = ilObjSystemFolder::_getHeaderTitle();
if (trim($header_top_title) != "" && $this->tpl->blockExists("header_top_title"))
{
$this->tpl->setCurrentBlock("header_top_title");
$this->tpl->setVariable("TXT_HEADER_TITLE", $header_top_title);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->setVariable("TXT_LOGOUT", $lng->txt("logout"));
$this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
$this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
$this->tpl->setVariable("HEADER_BG_IMAGE", ilUtil::getImagePath("HeaderBackground.gif"));
include_once("./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
// set link to return to desktop, not depending on a specific position in the hierarchy
//$this->tpl->setVariable("SCRIPT_START", $this->getScriptTarget("start.php"));
}
else
{
$this->tpl->setVariable("HEADER_URL", $this->getHeaderURL());
$this->tpl->setVariable("HEADER_ICON", ilUtil::getImagePath("HeaderIcon.png"));
}
$this->tpl->setVariable("TXT_MAIN_MENU", $lng->txt("main_menu"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilMainMenuGUI::$ilias
ilMainMenuGUI::$start_template

Definition at line 23 of file class.ilMainMenuGUI.php.

ilMainMenuGUI::$target

Definition at line 22 of file class.ilMainMenuGUI.php.

ilMainMenuGUI::$tpl

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

Referenced by setTemplate(), and setTemplateVars().


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