ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSearchControllerGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
31{
32 public const int TYPE_USER_SEARCH = -1;
33 protected ilObjUser $user;
34
35 protected ilCtrl $ctrl;
36 protected ILIAS $ilias;
37 protected ilLanguage $lng;
41 protected Factory $refinery;
42
43 public function __construct()
44 {
45 global $DIC;
46
47 $this->ctrl = $DIC->ctrl();
48 $this->ilias = $DIC['ilias'];
49 $this->lng = $DIC->language();
50 $this->tpl = $DIC->ui()->mainTemplate();
51 $this->system = $DIC->rbac()->system();
52 $this->http = $DIC->http();
53 $this->refinery = $DIC->refinery();
54 $this->user = $DIC->user();
55 }
56
57 public function executeCommand(): void
58 {
59 // Check hacks
60 if (!$this->system->checkAccess('search', ilSearchSettings::_getSearchSettingRefId())) {
61 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
62 }
63 $forward_class = $this->ctrl->getNextClass($this);
64 switch ($forward_class) {
65 case 'illucenesearchgui':
66 $this->ctrl->forwardCommand(new ilLuceneSearchGUI());
67 break;
68
69 case 'illuceneusersearchgui':
70 if ($this->user->getId() === ANONYMOUS_USER_ID) {
71 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
72 }
73 $this->ctrl->forwardCommand(new ilLuceneUserSearchGUI());
74 break;
75
76 case 'ilsearchgui':
77 default:
78 $search_gui = new ilSearchGUI();
79 $this->ctrl->forwardCommand($search_gui);
80 break;
81 }
82 $this->tpl->printToStdout();
83 }
84}
Builds data types.
Definition: Factory.php:36
Class ilCtrl provides processing control methods.
language handling
User class.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
ilGlobalTemplateInterface $tpl
GUI class for 'simple' search.
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
const ANONYMOUS_USER_ID
Definition: constants.php:27
Interface GlobalHttpState.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
Class ilObjForumAdministration.
global $DIC
Definition: shib_login.php:26