ILIAS  Release_5_0_x_branch Revision 61816
 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, $ilUser, $lng, $tpl, ilUtil\getImagePath(), ilSearchSettings\getInstance(), ilUtil\img(), iljQueryUtil\initjQuery(), and iljQueryUtil\initjQueryUI().

{
global $ilCtrl, $tpl, $lng, $ilUser;
if(!$this->isContainer)
{
#return '';
}
if($_GET['baseClass'] == 'ilSearchController')
{
// return '';
}
include_once "Services/jQuery/classes/class.iljQueryUtil.php";
$this->tpl = new ilTemplate('tpl.main_menu_search.html',true,true,'Services/Search');
if ($ilUser->getId() != ANONYMOUS_USER_ID)
{
if(ilSearchSettings::getInstance()->isLuceneUserSearchEnabled() or (int) $_GET['ref_id'])
{
$this->tpl->setCurrentBlock("position");
$this->tpl->setVariable('TXT_GLOBALLY', $lng->txt("search_globally"));
$this->tpl->setVariable('ROOT_ID', ROOT_FOLDER_ID);
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock("position_hid");
$this->tpl->setVariable('ROOT_ID_HID', ROOT_FOLDER_ID);
$this->tpl->parseCurrentBlock();
}
if((int) $_GET['ref_id'])
{
$this->tpl->setCurrentBlock('position_rep');
$this->tpl->setVariable('TXT_CURRENT_POSITION', $lng->txt("search_at_current_position"));
$this->tpl->setVariable('REF_ID', (int) $_GET["ref_id"]);
$this->tpl->parseCurrentBlock();
}
}
if($ilUser->getId() != ANONYMOUS_USER_ID && ilSearchSettings::getInstance()->isLuceneUserSearchEnabled())
{
$this->tpl->setCurrentBlock('usr_search');
$this->tpl->setVariable('TXT_USR_SEARCH',$this->lng->txt('search_users'));
$this->tpl->parseCurrentBlock();
}
$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('ID_AUTOCOMPLETE', "mm_sr_auto");
$this->tpl->setVariable('AC_DATASOURCE', "ilias.php?baseClass=ilSearchController&cmd=autoComplete");
$this->tpl->setVariable('IMG_MM_SEARCH', ilUtil::img(ilUtil::getImagePath("icon_seas.svg"),
$lng->txt("search")));
if ($ilUser->getId() != ANONYMOUS_USER_ID)
{
$this->tpl->setVariable('HREF_SEARCH_LINK', "ilias.php?baseClass=ilSearchController");
$this->tpl->setVariable('TXT_SEARCH_LINK', $lng->txt("last_search_result"));
}
// #10555 - we need the overlay for the autocomplete which is always active
$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();
}

+ Here is the call graph for this function:

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: