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

Add a search box to main menu. More...

+ Collaboration diagram for ilMainMenuSearchGUI:

Public Member Functions

 __construct ()
 Constructor public.
 getHTML ()

Protected Attributes

 $tpl = null
 $lng = null

Private Attributes

 $ref_id = ROOT_FOLDER_ID
 $obj_id = 0
 $type = ''
 $isContainer = true

Detailed Description

Add a search box to main menu.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilMainMenuSearchGUI.php.

Constructor & Destructor Documentation

ilMainMenuSearchGUI::__construct ( )

Constructor public.

Definition at line 28 of file class.ilMainMenuSearchGUI.php.

References $_GET, $lng, ilObject\_lookupObjId(), and ilObject\_lookupType().

{
global $lng,$objDefinition,$tree;
$this->lng = $lng;
if(isset($_GET['ref_id']))
{
$this->ref_id = (int )$_GET['ref_id'];
}
$this->obj_id = ilObject::_lookupObjId($this->ref_id);
$this->type = ilObject::_lookupType($this->obj_id);
$lng->loadLanguageModule("search");
/*
if(!$objDefinition->isContainer($this->type))
{
$this->isContainer = false;
$parent_id = $tree->getParentId($this->ref_id);
$this->obj_id = ilObject::_lookupObjId($parent_id);
$this->type = ilObject::_lookupType($this->obj_id);
}
*/
}

+ Here is the call graph for this function:

Member Function Documentation

ilMainMenuSearchGUI::getHTML ( )

Definition at line 54 of file class.ilMainMenuSearchGUI.php.

References $_GET, $ilCtrl, $lng, and $tpl.

{
global $ilCtrl, $tpl, $lng, $ilUser;
if(!$this->isContainer)
{
#return '';
}
if($_GET['baseClass'] == 'ilSearchController')
{
// return '';
}
include_once("./Services/YUI/classes/class.ilYuiUtil.php");
ilYuiUtil::initAutocomplete();
$this->tpl = new ilTemplate('tpl.main_menu_search.html',true,true,'Services/Search');
$this->tpl->setVariable('FORMACTION','ilias.php?baseClass=ilSearchController&cmd=post'.
'&rtoken='.$ilCtrl->getRequestToken().'&fallbackCmd=remoteSearch');
$this->tpl->setVariable('BTN_SEARCH',$this->lng->txt('search'));
$this->tpl->setVariable('CONT_REF_ID',ROOT_FOLDER_ID);
$this->tpl->setVariable('ID_AUTOCOMPLETE', "mm_sr_auto");
$this->tpl->setVariable('YUI_DATASOURCE', "ilias.php?baseClass=ilSearchController&cmd=autoComplete");
// search link menu
//$this->tpl->setVariable('ARROW', ilUtil::getImagePath("mm_down_arrow_dark.gif"));
//$this->tpl->setVariable('SRC_ICON', ilUtil::getImagePath("icon_seas_s.gif"));
//$this->tpl->setVariable('TXT_LAST_SEARCH', " > ".$lng->txt("last_search_result"));
//$this->tpl->setVariable('HREF_LAST_SEARCH', "ilias.php?baseClass=ilSearchController");
if ($ilUser->getId() != ANONYMOUS_USER_ID)
{
include_once("./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php");
$list = new ilGroupedListGUI();
$list->addEntry($lng->txt("last_search_result"), "ilias.php?baseClass=ilSearchController");
$this->tpl->setVariable('SEARCH_LINK_MENU', $list->getHTML());
$this->tpl->setVariable('TXT_SEARCH', $lng->txt("search"));
include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
$ov = new ilOverlayGUI("mm_search_menu");
//$ov->setTrigger("main_menu_search", "none",
// "main_menu_search", "tr", "br");
//$ov->setAnchor("main_menu_search", "tr", "br");
$ov->setAutoHide(false);
$ov->add();
}
return $this->tpl->get();
}

Field Documentation

ilMainMenuSearchGUI::$isContainer = true
private

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

ilMainMenuSearchGUI::$lng = null
protected

Definition at line 17 of file class.ilMainMenuSearchGUI.php.

Referenced by __construct(), and getHTML().

ilMainMenuSearchGUI::$obj_id = 0
private

Definition at line 20 of file class.ilMainMenuSearchGUI.php.

ilMainMenuSearchGUI::$ref_id = ROOT_FOLDER_ID
private

Definition at line 19 of file class.ilMainMenuSearchGUI.php.

ilMainMenuSearchGUI::$tpl = null
protected

Definition at line 16 of file class.ilMainMenuSearchGUI.php.

Referenced by getHTML().

ilMainMenuSearchGUI::$type = ''
private

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


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