ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSearchController Class Reference
+ Collaboration diagram for ilSearchController:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 getLastClass ()
 
 setLastClass ($a_class)
 
executeCommand ()
 

Data Fields

const TYPE_USER_SEARCH = -1
 
 $ctrl = null
 
 $ilias = null
 
 $lng = null
 

Detailed Description

Definition at line 18 of file class.ilSearchController.php.

Constructor & Destructor Documentation

◆ __construct()

ilSearchController::__construct ( )

Constructor public.

Definition at line 30 of file class.ilSearchController.php.

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

31  {
32  global $ilCtrl,$ilias,$lng,$tpl;
33 
34  $this->ilias = $ilias;
35  $this->ctrl = $ilCtrl;
36  $this->lng = $lng;
37  $this->tpl = $tpl;
38  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...

Member Function Documentation

◆ executeCommand()

& ilSearchController::executeCommand ( )

Definition at line 65 of file class.ilSearchController.php.

References ilSearchSettings\_getSearchSettingRefId(), getLastClass(), and setLastClass().

66  {
67  global $rbacsystem;
68 
69  include_once 'Services/Search/classes/class.ilSearchSettings.php';
70 
71  // Check hacks
72  if(!$rbacsystem->checkAccess('search',ilSearchSettings::_getSearchSettingRefId()))
73  {
74  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
75  }
76  $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
77 
78  switch($forward_class)
79  {
80  case 'illucenesearchgui':
81  $this->setLastClass('illucenesearchgui');
82  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchGUI.php';
83  $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
84  break;
85 
86  case 'illuceneadvancedsearchgui':
87  $this->setLastClass('illuceneadvancedsearchgui');
88  include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchGUI.php';
89  $this->ctrl->forwardCommand(new ilLuceneAdvancedSearchGUI());
90  break;
91 
92  case 'illuceneusersearchgui':
93  $this->setLastClass('illuceneusersearchgui');
94  include_once './Services/Search/classes/Lucene/class.ilLuceneUserSearchGUI.php';
95  $this->ctrl->forwardCommand(new ilLuceneUserSearchGUI());
96  break;
97 
98  case 'iladvancedsearchgui':
99  // Remember last class
100  $this->setLastClass('iladvancedsearchgui');
101 
102  include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
103 
104  $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
105  break;
106 
107  case 'ilsearchgui':
108  // Remember last class
109  $this->setLastClass('ilsearchgui');
110 
111  default:
112  include_once 'Services/Search/classes/class.ilSearchGUI.php';
113 
114  $search_gui = new ilSearchGUI();
115  $this->ctrl->forwardCommand($search_gui);
116  break;
117  }
118  $this->tpl->show();
119 
120  return true;
121  }
Class ilSearchGUI.
GUI for simple Lucene search
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
redirection script todo: (a better solution should control the processing via a xml file) ...
GUI for Lucene user search
+ Here is the call graph for this function:

◆ getLastClass()

ilSearchController::getLastClass ( )

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

References $_SESSION, ilSearchSettings\getInstance(), and setLastClass().

Referenced by executeCommand().

41  {
42  include_once './Services/Search/classes/class.ilSearchSettings.php';
43  if(ilSearchSettings::getInstance()->enabledLucene())
44  {
45  $default = 'illucenesearchgui';
46  }
47  else
48  {
49  $default = 'ilsearchgui';
50  }
51  if($_REQUEST['root_id'] == self::TYPE_USER_SEARCH)
52  {
53  $default = 'illuceneusersearchgui';
54  }
55 
56  $this->setLastClass($default);
57 
58  return $_SESSION['search_last_class'] ? $_SESSION['search_last_class'] : $default;
59  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastClass()

ilSearchController::setLastClass (   $a_class)

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

References $_SESSION.

Referenced by executeCommand(), and getLastClass().

61  {
62  $_SESSION['search_last_class'] = $a_class;
63  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilSearchController::$ctrl = null

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

◆ $ilias

ilSearchController::$ilias = null

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

Referenced by __construct().

◆ $lng

ilSearchController::$lng = null

Definition at line 24 of file class.ilSearchController.php.

Referenced by __construct().

◆ TYPE_USER_SEARCH

const ilSearchController::TYPE_USER_SEARCH = -1

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


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