ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 

Protected Attributes

 $user
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilSearchController::__construct ( )

Constructor public.

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

References $DIC, $ilias, $lng, $tpl, and user().

35  {
36  global $DIC;
37 
38  $ilCtrl = $DIC['ilCtrl'];
39  $ilias = $DIC['ilias'];
40  $lng = $DIC['lng'];
41  $tpl = $DIC['tpl'];
42 
43  $this->ilias = $ilias;
44  $this->ctrl = $ilCtrl;
45  $this->lng = $lng;
46  $this->tpl = $tpl;
47  $this->user = $DIC->user();
48  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
redirection script todo: (a better solution should control the processing via a xml file) ...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

& ilSearchController::executeCommand ( )

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

References $DIC, ilSearchSettings\_getSearchSettingRefId(), ANONYMOUS_USER_ID, getLastClass(), setLastClass(), and user().

72  {
73  global $DIC;
74 
75  $rbacsystem = $DIC['rbacsystem'];
76 
77  include_once 'Services/Search/classes/class.ilSearchSettings.php';
78 
79  // Check hacks
80  if (!$rbacsystem->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
81  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
82  }
83  $forward_class = $this->ctrl->getNextClass($this) ? $this->ctrl->getNextClass($this) : $this->getLastClass();
84 
85  switch ($forward_class) {
86  case 'illucenesearchgui':
87  $this->setLastClass('illucenesearchgui');
88  include_once './Services/Search/classes/Lucene/class.ilLuceneSearchGUI.php';
89  $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
90  break;
91 
92  case 'illuceneadvancedsearchgui':
93  $this->setLastClass('illuceneadvancedsearchgui');
94  include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchGUI.php';
95  $this->ctrl->forwardCommand(new ilLuceneAdvancedSearchGUI());
96  break;
97 
98  case 'illuceneusersearchgui':
99  if ($this->user->getId() == ANONYMOUS_USER_ID) {
100  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
101  }
102  $this->setLastClass('illuceneusersearchgui');
103  include_once './Services/Search/classes/Lucene/class.ilLuceneUserSearchGUI.php';
104  $this->ctrl->forwardCommand(new ilLuceneUserSearchGUI());
105  break;
106 
107  case 'iladvancedsearchgui':
108  // Remember last class
109  $this->setLastClass('iladvancedsearchgui');
110 
111  include_once 'Services/Search/classes/class.ilAdvancedSearchGUI.php';
112 
113  $this->ctrl->forwardCommand(new ilAdvancedSearchGUI());
114  break;
115 
116  case 'ilsearchgui':
117  // Remember last class
118  $this->setLastClass('ilsearchgui');
119 
120  // no break
121  default:
122  include_once 'Services/Search/classes/class.ilSearchGUI.php';
123 
124  $search_gui = new ilSearchGUI();
125  $this->ctrl->forwardCommand($search_gui);
126  break;
127  }
128  $this->tpl->printToStdout();
129 
130  return true;
131  }
const ANONYMOUS_USER_ID
Definition: constants.php:25
Class ilSearchGUI.
user()
Definition: user.php:4
GUI for simple Lucene search
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
global $DIC
Definition: goto.php:24
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 50 of file class.ilSearchController.php.

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

Referenced by executeCommand().

51  {
52  include_once './Services/Search/classes/class.ilSearchSettings.php';
53  if (ilSearchSettings::getInstance()->enabledLucene()) {
54  $default = 'illucenesearchgui';
55  } else {
56  $default = 'ilsearchgui';
57  }
58  if ($_REQUEST['root_id'] == self::TYPE_USER_SEARCH) {
59  $default = 'illuceneusersearchgui';
60  }
61 
62  $this->setLastClass($default);
63 
64  return $_SESSION['search_last_class'] ? $_SESSION['search_last_class'] : $default;
65  }
$_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 66 of file class.ilSearchController.php.

References $_SESSION.

Referenced by executeCommand(), and getLastClass().

67  {
68  $_SESSION['search_last_class'] = $a_class;
69  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilSearchController::$ctrl = null

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

◆ $ilias

ilSearchController::$ilias = null

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

Referenced by __construct().

◆ $lng

ilSearchController::$lng = null

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

Referenced by __construct().

◆ $user

ilSearchController::$user
protected

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

◆ TYPE_USER_SEARCH

const ilSearchController::TYPE_USER_SEARCH = -1

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

Referenced by ilMainMenuSearchGUI\getHTML().


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