ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  }
$tpl
Definition: ilias.php:10
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 61 of file class.ilSearchController.php.

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

62  {
63  global $rbacsystem;
64 
65  include_once 'Services/Search/classes/class.ilSearchSettings.php';
66 
67  // Check hacks
68  if (!$rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
69  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
70  }
71  $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
72 
73  switch ($forward_class) {
74  case 'illucenesearchgui':
75  $this->setLastClass('illucenesearchgui');
76  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchGUI.php';
77  $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
78  break;
79 
80  case 'illuceneadvancedsearchgui':
81  $this->setLastClass('illuceneadvancedsearchgui');
82  include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchGUI.php';
83  $this->ctrl->forwardCommand(new ilLuceneAdvancedSearchGUI());
84  break;
85 
86  case 'illuceneusersearchgui':
87  $this->setLastClass('illuceneusersearchgui');
88  include_once './Services/Search/classes/Lucene/class.ilLuceneUserSearchGUI.php';
89  $this->ctrl->forwardCommand(new ilLuceneUserSearchGUI());
90  break;
91 
92  case 'iladvancedsearchgui':
93  // Remember last class
94  $this->setLastClass('iladvancedsearchgui');
95 
96  include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
97 
98  $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
99  break;
100 
101  case 'ilsearchgui':
102  // Remember last class
103  $this->setLastClass('ilsearchgui');
104 
105  // no break
106  default:
107  include_once 'Services/Search/classes/class.ilSearchGUI.php';
108 
109  $search_gui = new ilSearchGUI();
110  $this->ctrl->forwardCommand($search_gui);
111  break;
112  }
113  $this->tpl->show();
114 
115  return true;
116  }
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  $default = 'illucenesearchgui';
45  } else {
46  $default = 'ilsearchgui';
47  }
48  if ($_REQUEST['root_id'] == self::TYPE_USER_SEARCH) {
49  $default = 'illuceneusersearchgui';
50  }
51 
52  $this->setLastClass($default);
53 
54  return $_SESSION['search_last_class'] ? $_SESSION['search_last_class'] : $default;
55  }
$_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 56 of file class.ilSearchController.php.

References $_SESSION.

Referenced by executeCommand(), and getLastClass().

57  {
58  $_SESSION['search_last_class'] = $a_class;
59  }
$_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: