ILIAS  Release_4_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 33 of file class.ilMainMenuSearchGUI.php.

Constructor & Destructor Documentation

ilMainMenuSearchGUI::__construct ( )

Constructor public.

Definition at line 48 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);
/*
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 72 of file class.ilMainMenuSearchGUI.php.

References $_GET, $ilCtrl, and $tpl.

{
global $ilCtrl, $tpl;
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");
return $this->tpl->get();
}

Field Documentation

ilMainMenuSearchGUI::$isContainer = true
private

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

ilMainMenuSearchGUI::$lng = null
protected

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

Referenced by __construct().

ilMainMenuSearchGUI::$obj_id = 0
private

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

ilMainMenuSearchGUI::$ref_id = ROOT_FOLDER_ID
private

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

ilMainMenuSearchGUI::$tpl = null
protected

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

Referenced by getHTML().

ilMainMenuSearchGUI::$type = ''
private

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


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