19 declare(strict_types=1);
84 $this->
logger = $DIC->logger()->src();
85 $this->
ilias = $DIC[
'ilias'];
86 $this->
locator = $DIC[
'ilLocator'];
87 $this->
ctrl = $DIC->ctrl();
88 $this->
lng = $DIC->language();
89 $this->tpl = $DIC->ui()->mainTemplate();
90 $this->tree = $DIC->repositoryTree();
92 $this->
lng->loadLanguageModule(
'search');
95 $this->
user = $DIC->user();
96 $this->clipboard = $DIC
101 $this->container_view_manager = $DIC
108 $this->
http = $DIC->http();
114 if ($this->
http->wrapper()->query()->has(
'page_number')) {
115 return $this->
http->wrapper()->query()->retrieve(
126 $this->tpl->loadStandardTemplate();
128 $this->tpl->setTitleIcon(
132 $this->tpl->setTitle($this->
lng->txt(
"search"));
138 $this->
form->setOpenTag(
false);
139 $this->
form->setCloseTag(
false);
144 $this->
form->addItem($radg);
147 if ($a_mode == self::SEARCH_FORM_STANDARD) {
157 $radg->addOption($op1);
158 $op2 =
new ilRadioOption($this->
lng->txt(
"search_details_info"), (string) ilSearchBaseGUI::SEARCH_DETAILS);
166 $cbgr->setUseValuesAsKeys(
true);
174 $cbgr->addOption($cb);
177 if ($a_mode == self::SEARCH_FORM_LUCENE) {
179 $mimes = $this->getMimeDetails();
182 if (isset($mimes[
$type])) {
185 $cbgr->addOption($op3);
191 $op2->addSubItem($cbgr);
193 if ($a_mode != self::SEARCH_FORM_STANDARD && $det) {
194 $op2->setChecked(
true);
198 $radg->addOption($op2);
199 $this->
form->addItem($radg);
201 $this->
form->addItem($op2);
205 $this->
form->setFormAction($this->
ctrl->getFormAction($this,
'performSearch'));
225 $ti->readFromSession();
229 if ($this->
http->wrapper()->post()->has(
'root_id')) {
231 $this->
http->wrapper()->post()->retrieve(
233 $this->
refinery->kindlyTo()->string()
236 $ti->writeToSession();
246 if (method_exists($this, $a_cmd)) {
256 if ($this->
http->wrapper()->query()->has(
'item_ref_id')) {
257 $this->favourites->add(
258 $this->
user->getId(),
259 $this->
http->wrapper()->query()->retrieve(
265 $this->showSavedResults();
270 if ($this->
http->wrapper()->query()->has(
'item_ref_id')) {
271 $this->favourites->remove(
272 $this->
user->getId(),
273 $this->
http->wrapper()->query()->retrieve(
279 $this->showSavedResults();
282 public function delete():
void 290 $this->showSavedResults();
295 $this->showSavedResults();
300 $this->showSavedResults();
306 $admin->performDelete();
309 public function cut(): void
331 $admin->showLinkIntoMultipleObjectsTree();
337 $admin->showPasteTree();
344 $admin->showMoveIntoObjectTree();
350 $admin->performPasteIntoMultipleObjects();
355 $this->clipboard->clear();
356 $this->
ctrl->redirect($this);
361 $this->container_view_manager->setAdminView();
362 $this->
ctrl->redirect($this);
367 $this->container_view_manager->setContentView();
368 $this->
ctrl->redirect($this);
376 $this->
ctrl->redirect($this);
382 $this->
locator->addItem($this->
lng->txt(
'search'), $this->
ctrl->getLinkTarget($this));
383 $this->tpl->setLocator();
389 protected function addPager($result,
string $a_session_key): bool
391 $max_page = max(
ilSession::get($a_session_key), $this->search_cache->getResultPageNumber());
394 if ($max_page == 1 and
395 (count($result->getResults()) < $result->getMaxHits())) {
399 if ($this->search_cache->getResultPageNumber() > 1) {
400 $this->
ctrl->setParameter($this,
'page_number', $this->search_cache->getResultPageNumber() - 1);
401 $this->prev_link = $this->
ctrl->getLinkTarget($this,
'performSearch');
403 for (
$i = 1;
$i <= $max_page;
$i++) {
404 if (
$i == $this->search_cache->getResultPageNumber()) {
408 $this->
ctrl->setParameter($this,
'page_number',
$i);
409 $link =
'<a href="' . $this->
ctrl->getLinkTarget($this,
'performSearch') .
'" /a>' .
$i .
'</a> ';
411 if (count($result->getResults()) >= $result->getMaxHits()) {
412 $this->
ctrl->setParameter($this,
'page_number', $this->search_cache->getResultPageNumber() + 1);
413 $this->next_link = $this->
ctrl->getLinkTarget($this,
'performSearch');
415 $this->
ctrl->clearParameters($this);
421 $path_arr = $this->tree->getPathFull($a_root_node,
ROOT_FOLDER_ID);
424 foreach ($path_arr as
$data) {
427 $path .= $data[
'title'];
429 $path .= $this->
lng->txt(
'repository');
438 if ($this->
http->wrapper()->post()->has(
'term')) {
439 $query = $this->
http->wrapper()->post()->retrieve(
441 $this->
refinery->kindlyTo()->string()
451 $options = $this->search_cache->getCreationFilter();
459 $enabled->setChecked((
bool) ($options[
'enabled'] ??
false));
464 $limit_sel->setValue($options[
'ontype'] ??
'');
465 $limit_sel->setOptions(
467 1 => $this->
lng->txt(
'search_created_after'),
468 2 => $this->
lng->txt(
'search_created_before'),
469 3 => $this->
lng->txt(
'search_created_on')
475 if ($options[
'date'] ??
false) {
481 $ds->setRequired(
true);
500 if (!$this->
settings->isDateFilterEnabled()) {
508 $options[
'enabled'] = $form->
getInput(
'screation');
509 $options[
'type'] = $form->
getInput(
'screation_type');
510 $options[
'ontype'] = $form->
getInput(
'screation_ontype');
512 $options[
'duration'] = $form->
getInput(
'screation_duration');
Interface GlobalHttpState.
static get(string $a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
removeFromDeskObject()
Remove from desktop public.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
showLinkIntoMultipleObjectsTree()
static getList(string $a_str)
Class ChatMainBarProvider .
Handles Administration commands (cut, delete paste)
static _getInstance(int $a_usr_id)
addToDeskObject()
Add desktop item public.
ClipboardManager $clipboard
handleCommand(string $a_cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
keepObjectsInClipboardObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
disableAdministrationPanel()
static http()
Fetches the global http state from ILIAS.
setValue(string $a_value)
cancelDelete()
Cancel delete.
header include for all ilias files.
performPasteIntoMultipleObjects()
Manages items in repository clipboard.
form( $class_path, string $cmd)
ilUserSearchCache $search_cache
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addPager($result, string $a_session_key)
initStandardSearchForm(int $a_mode)
Class for storing search result.
buildSearchAreaPath(int $a_root_node)
enableAdministrationPanel()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initPageNumberFromQuery()
const SEARCH_FORM_STANDARD
ilFavouritesManager $favourites
static set(string $a_var, $a_val)
Set a value.
ilSearchSettings $settings
ViewManager $container_view_manager
ilGlobalTemplateInterface $tpl