ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilSearchController Class Reference
+ Collaboration diagram for ilSearchController:

Public Member Functions

 __construct ()
 Constructor @access 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 @access public.

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

31 {
32 global $DIC;
33
34 $ilCtrl = $DIC['ilCtrl'];
35 $ilias = $DIC['ilias'];
36 $lng = $DIC['lng'];
37 $tpl = $DIC['tpl'];
38
39 $this->ilias = $ilias;
40 $this->ctrl = $ilCtrl;
41 $this->lng = $lng;
42 $this->tpl = $tpl;
43 }
$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)
global $DIC
Definition: saml.php:7

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

Member Function Documentation

◆ executeCommand()

& ilSearchController::executeCommand ( )

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

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

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

+ Here is the call graph for this function:

◆ getLastClass()

ilSearchController::getLastClass ( )

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

46 {
47 include_once './Services/Search/classes/class.ilSearchSettings.php';
48 if (ilSearchSettings::getInstance()->enabledLucene()) {
49 $default = 'illucenesearchgui';
50 } else {
51 $default = 'ilsearchgui';
52 }
53 if ($_REQUEST['root_id'] == self::TYPE_USER_SEARCH) {
54 $default = 'illuceneusersearchgui';
55 }
56
57 $this->setLastClass($default);
58
59 return $_SESSION['search_last_class'] ? $_SESSION['search_last_class'] : $default;
60 }
$default
Definition: build.php:20
$_SESSION["AccountId"]

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

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastClass()

ilSearchController::setLastClass (   $a_class)

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

62 {
63 $_SESSION['search_last_class'] = $a_class;
64 }

References $_SESSION.

Referenced by executeCommand(), and getLastClass().

+ 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: