ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Search\GUI\Direct\SearchStateHandlerImpl Class Reference
+ Inheritance diagram for ILIAS\Search\GUI\Direct\SearchStateHandlerImpl:
+ Collaboration diagram for ILIAS\Search\GUI\Direct\SearchStateHandlerImpl:

Public Member Functions

 __construct (protected ilSearchSettings $settings, protected LOMServices $lom_services, HTTP $http, Refinery $refinery)
 
 fetchRequestedRemoteSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchFilter (URI $action)
 
 fetchCache (int $usr_id)
 
 loadFilterToCache (ilSearchFilterGUI $filter, ilUserSearchCache $cache)
 
- Public Member Functions inherited from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl
 __construct (protected HTTP $http, protected Refinery $refinery)
 
 fetchMaxPage ()
 
 resetMaxPage ()
 
 updateMaxPage (int $max_page)
 
 fetchRequestedPage ()
 
 fetchSortation ()
 
 fetchRequestedSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchRequestedRemoteSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchRequestedAutoCompleteSearchTerm ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchRequestedRemoteScope ()
 propably needs to be replaced with a completely different mechanism when switching to KS More...
 
 fetchCache (int $usr_id)
 
 fetchFilter (URI $action)
 
 loadFilterToCache (ilSearchFilterGUI $filter, ilUserSearchCache $cache)
 
 fetchMaxPage ()
 
 resetMaxPage ()
 
 updateMaxPage (int $max_page)
 
 fetchRequestedPage ()
 
 fetchSortation ()
 
 fetchRequestedSearchTerm ()
 
 fetchRequestedRemoteSearchTerm ()
 
 fetchRequestedAutoCompleteSearchTerm ()
 
 fetchRequestedRemoteScope ()
 
 fetchCache (int $usr_id)
 
 fetchFilter (URI $action)
 
 loadFilterToCache (ilSearchFilterGUI $filter, ilUserSearchCache $cache)
 

Detailed Description

Definition at line 32 of file SearchStateHandlerImpl.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Search\GUI\Direct\SearchStateHandlerImpl::__construct ( protected ilSearchSettings  $settings,
protected LOMServices  $lom_services,
HTTP  $http,
Refinery  $refinery 
)

Definition at line 34 of file SearchStateHandlerImpl.php.

39 {
41 }
$http
Definition: deliver.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $http, ILIAS\UI\examples\Layout\Page\Mail\$refinery, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ fetchCache()

ILIAS\Search\GUI\Direct\SearchStateHandlerImpl::fetchCache ( int  $usr_id)

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 59 of file SearchStateHandlerImpl.php.

60 {
61 return ilUserSearchCache::_getInstance($usr_id);
62 }
Class for storing search result.
static _getInstance(int $a_usr_id)

References ilUserSearchCache\_getInstance().

+ Here is the call graph for this function:

◆ fetchFilter()

ILIAS\Search\GUI\Direct\SearchStateHandlerImpl::fetchFilter ( URI  $action)

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 54 of file SearchStateHandlerImpl.php.

55 {
56 return new ilSearchFilterGUI($action, false);
57 }

◆ fetchRequestedRemoteSearchTerm()

ILIAS\Search\GUI\Direct\SearchStateHandlerImpl::fetchRequestedRemoteSearchTerm ( )

propably needs to be replaced with a completely different mechanism when switching to KS

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 43 of file SearchStateHandlerImpl.php.

43 : string
44 {
45 if ($this->http->wrapper()->post()->has('queryString')) {
46 return $this->http->wrapper()->post()->retrieve(
47 'queryString',
48 $this->refinery->kindlyTo()->string()
49 );
50 }
51 return '';
52 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ loadFilterToCache()

ILIAS\Search\GUI\Direct\SearchStateHandlerImpl::loadFilterToCache ( ilSearchFilterGUI  $filter,
ilUserSearchCache  $cache 
)

Reimplemented from ILIAS\Search\GUI\AbstractSearchStateHandlerImpl.

Definition at line 64 of file SearchStateHandlerImpl.php.

64 : void
65 {
66 $search_filter_data = $filter->getData();
67
68 $cache->setRoot((int) ($search_filter_data['search_scope'] ?? ROOT_FOLDER_ID));
69
70 $creation_filter = [];
71 if (
72 $this->settings->isDateFilterEnabled() &&
73 isset($search_filter_data['search_date'])
74 ) {
75 $creation_filter['date_start'] = $search_filter_data['search_date'][0];
76 $creation_filter['date_end'] = $search_filter_data['search_date'][1];
77 }
78 $cache->setCreationFilter($creation_filter);
79
80 $types_from_filter = (array) ($search_filter_data['search_type'] ?? []);
81 $enabled_types = [];
82 foreach ($this->settings->getEnabledLuceneItemFilterDefinitions() as $type => $data) {
83 if (in_array($type, $types_from_filter)) {
84 $enabled_types[$type] = 1;
85 }
86 }
87 $cache->setItemFilter($enabled_types);
88
89 $copyright_filter = [];
90 if (
91 $this->lom_services->copyrightHelper()->isCopyrightSelectionActive() &&
92 isset($search_filter_data['search_copyright'])
93 ) {
94 $copyright_filter = $search_filter_data['search_copyright'];
95 }
96 $cache->setCopyrightFilter(...$copyright_filter);
97 }
setCreationFilter(array $a_filter)
setItemFilter(array $a_filter)
setRoot(int $a_root)
set root node of search
setCopyrightFilter(string ... $copyright_identifiers)
const ROOT_FOLDER_ID
Definition: constants.php:32

References $data, ilSearchFilterGUI\getData(), ROOT_FOLDER_ID, ilUserSearchCache\setCopyrightFilter(), ilUserSearchCache\setCreationFilter(), ilUserSearchCache\setItemFilter(), ilUserSearchCache\setRoot(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

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