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
102 $this->
http = $DIC->http();
108 if ($this->
http->wrapper()->query()->has(
'page_number')) {
109 return $this->
http->wrapper()->query()->retrieve(
120 $this->tpl->loadStandardTemplate();
122 $this->tpl->setTitleIcon(
126 $this->tpl->setTitle($this->
lng->txt(
"search"));
132 $this->
form->setOpenTag(
false);
133 $this->
form->setCloseTag(
false);
138 $this->
form->addItem($radg);
141 if ($a_mode == self::SEARCH_FORM_STANDARD) {
151 $radg->addOption($op1);
152 $op2 =
new ilRadioOption($this->
lng->txt(
"search_details_info"), (string) ilSearchBaseGUI::SEARCH_DETAILS);
160 $cbgr->setUseValuesAsKeys(
true);
168 $cbgr->addOption($cb);
171 if ($a_mode == self::SEARCH_FORM_LUCENE) {
173 $mimes = $this->getMimeDetails();
176 if (isset($mimes[$type])) {
179 $cbgr->addOption($op3);
185 $op2->addSubItem($cbgr);
187 if ($a_mode != self::SEARCH_FORM_STANDARD && $det) {
188 $op2->setChecked(
true);
192 $radg->addOption($op2);
193 $this->
form->addItem($radg);
195 $this->
form->addItem($op2);
199 $this->
form->setFormAction($this->
ctrl->getFormAction($this,
'performSearch'));
219 $ti->readFromSession();
223 if ($this->
http->wrapper()->post()->has(
'root_id')) {
225 $this->
http->wrapper()->post()->retrieve(
227 $this->
refinery->kindlyTo()->string()
230 $ti->writeToSession();
240 if (method_exists($this, $a_cmd)) {
250 if ($this->
http->wrapper()->query()->has(
'item_ref_id')) {
251 $this->favourites->add(
252 $this->
user->getId(),
253 $this->
http->wrapper()->query()->retrieve(
259 $this->showSavedResults();
264 if ($this->
http->wrapper()->query()->has(
'item_ref_id')) {
265 $this->favourites->remove(
266 $this->
user->getId(),
267 $this->
http->wrapper()->query()->retrieve(
273 $this->showSavedResults();
276 public function delete():
void 284 $this->showSavedResults();
289 $this->showSavedResults();
294 $this->showSavedResults();
300 $admin->performDelete();
303 public function cut(): void
325 $admin->showLinkIntoMultipleObjectsTree();
331 $admin->showPasteTree();
338 $admin->showMoveIntoObjectTree();
344 $admin->performPasteIntoMultipleObjects();
349 $this->clipboard->clear();
350 $this->
ctrl->redirect($this);
366 $this->
ctrl->redirect($this);
372 $this->
locator->addItem($this->
lng->txt(
'search'), $this->
ctrl->getLinkTarget($this));
373 $this->tpl->setLocator();
379 protected function addPager($result,
string $a_session_key): bool
381 $max_page = max(
ilSession::get($a_session_key), $this->search_cache->getResultPageNumber());
384 if ($max_page == 1 and
385 (count($result->getResults()) < $result->getMaxHits())) {
389 if ($this->search_cache->getResultPageNumber() > 1) {
390 $this->
ctrl->setParameter($this,
'page_number', $this->search_cache->getResultPageNumber() - 1);
391 $this->prev_link = $this->
ctrl->getLinkTarget($this,
'performSearch');
393 for ($i = 1;$i <= $max_page;$i++) {
394 if ($i == $this->search_cache->getResultPageNumber()) {
398 $this->
ctrl->setParameter($this,
'page_number', $i);
399 $link =
'<a href="' . $this->
ctrl->getLinkTarget($this,
'performSearch') .
'" /a>' . $i .
'</a> ';
401 if (count($result->getResults()) >= $result->getMaxHits()) {
402 $this->
ctrl->setParameter($this,
'page_number', $this->search_cache->getResultPageNumber() + 1);
403 $this->next_link = $this->
ctrl->getLinkTarget($this,
'performSearch');
405 $this->
ctrl->clearParameters($this);
411 $path_arr = $this->tree->getPathFull($a_root_node,
ROOT_FOLDER_ID);
414 foreach ($path_arr as
$data) {
417 $path .= $data[
'title'];
419 $path .= $this->
lng->txt(
'repository');
428 if ($this->
http->wrapper()->post()->has(
'term')) {
429 $query = $this->
http->wrapper()->post()->retrieve(
431 $this->
refinery->kindlyTo()->string()
441 $options = $this->search_cache->getCreationFilter();
449 $enabled->setChecked((
bool) ($options[
'enabled'] ??
false));
454 $limit_sel->setValue($options[
'ontype'] ??
'');
455 $limit_sel->setOptions(
457 1 => $this->
lng->txt(
'search_created_after'),
458 2 => $this->
lng->txt(
'search_created_before'),
459 3 => $this->
lng->txt(
'search_created_on')
465 if ($options[
'date'] ??
false) {
471 $ds->setRequired(
true);
490 if (!$this->
settings->isDateFilterEnabled()) {
498 $options[
'enabled'] = $form->
getInput(
'screation');
499 $options[
'type'] = $form->
getInput(
'screation_type');
500 $options[
'ontype'] = $form->
getInput(
'screation_ontype');
502 $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...
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)
ClipboardManager $clipboard
handleCommand(string $a_cmd)
Manages favourites, currently the interface for other components, needs discussion.
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, string $submit_caption="")
ilUserSearchCache $search_cache
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