ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilSearchFilterGUI Class Reference
+ Collaboration diagram for ilSearchFilterGUI:

Public Member Functions

 __construct (URI $action, bool $for_lucene)
 
 getHTML ()
 
 getFilter ()
 
 getData ()
 

Protected Attributes

ilUIFilterService $filter_service
 
ILIAS UI Renderer $renderer
 
ilNavigationHistory $nav_history
 
Filter Standard $filter
 
LOMServices $lom_services
 

Detailed Description

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 28 of file class.ilSearchFilterGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSearchFilterGUI::__construct ( URI  $action,
bool  $for_lucene 
)

Definition at line 36 of file class.ilSearchFilterGUI.php.

37 {
38 global $DIC;
39
40 $this->filter_service = $DIC->uiService()->filter();
41 $this->renderer = $DIC->ui()->renderer();
42 $this->nav_history = $DIC["ilNavigationHistory"];
43 $this->lom_services = $DIC->learningObjectMetadata();
44 $field_factory = $DIC->ui()->factory()->input()->field();
45 $txt = static function (string $id) use ($DIC): string {
46 return $DIC->language()->txt($id);
47 };
48
49 $scope_options[ROOT_FOLDER_ID] = $txt("repository");
50 $last_items = $this->nav_history->getItems();
51 $cnt = 0;
52 foreach ($last_items as $item) {
53 if ($cnt++ >= 10) {
54 break;
55 }
56 $scope_options[(string) $item["ref_id"]] = strip_tags($item["title"]);
57 }
58 $inputs["search_scope"] = $field_factory->select($txt("scope"), $scope_options)
59 ->withRequired(true)
60 ->withValue(ROOT_FOLDER_ID);
61 $inputs_activated[] = true;
62
63 $enabled_types = ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions();
64
65 if ($for_lucene) {
66 $enabled_types += ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions();
67 }
68
69 if (ilSearchSettings::getInstance()->isLuceneItemFilterEnabled() && !empty($enabled_types)) {
70 $type_options = [];
71 foreach ($enabled_types as $type => $pval) {
72 $type_options[$type] = $txt($pval["trans"]);
73 }
74 $inputs["search_type"] = $field_factory->multiSelect($txt("search_type"), $type_options);
75 $inputs_activated[] = true;
76 }
77
78 if (ilSearchSettings::getInstance()->isDateFilterEnabled()) {
79 $inputs["search_date"] = $field_factory->duration($txt("create_date"));
80 $inputs_activated[] = true;
81 }
82
83 if ($this->lom_services->copyrightHelper()->isCopyrightSelectionActive()) {
84 $cp_selection = [];
85 foreach ($this->lom_services->copyrightHelper()->getAllCopyrightPresets() as $copyright) {
86 if ($copyright->isDefault()) {
87 continue;
88 }
89 $cp_selection[$copyright->identifier()] = $copyright->title();
90 }
91 $inputs["search_copyright"] = $field_factory->multiSelect($txt("search_copyright"), $cp_selection);
92 $inputs_activated[] = true;
93 }
94
95 $this->filter = $this->filter_service->standard(
96 "search_filter",
97 (string) $action,
98 $inputs,
99 $inputs_activated,
100 false,
101 true
102 );
103 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
renderer()
const ROOT_FOLDER_ID
Definition: constants.php:32
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)
global $DIC
Definition: shib_login.php:26

References $DIC, $id, ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\filter(), ilSearchSettings\getInstance(), renderer(), and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

Member Function Documentation

◆ getData()

ilSearchFilterGUI::getData ( )

Definition at line 115 of file class.ilSearchFilterGUI.php.

115 : ?array
116 {
117 return $this->filter_service->getData($this->filter);
118 }

References ILIAS\Repository\filter().

Referenced by ILIAS\Search\GUI\Direct\SearchStateHandlerImpl\loadFilterToCache(), and ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl\loadFilterToCache().

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

◆ getFilter()

ilSearchFilterGUI::getFilter ( )

Definition at line 110 of file class.ilSearchFilterGUI.php.

110 : Filter\Standard
111 {
112 return $this->filter;
113 }

References $filter.

◆ getHTML()

ilSearchFilterGUI::getHTML ( )

Definition at line 105 of file class.ilSearchFilterGUI.php.

105 : string
106 {
107 return $this->renderer->render($this->filter);
108 }

References ILIAS\Repository\filter(), and renderer().

+ Here is the call graph for this function:

Field Documentation

◆ $filter

Filter Standard ilSearchFilterGUI::$filter
protected

Definition at line 33 of file class.ilSearchFilterGUI.php.

Referenced by getFilter().

◆ $filter_service

ilUIFilterService ilSearchFilterGUI::$filter_service
protected

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

◆ $lom_services

LOMServices ilSearchFilterGUI::$lom_services
protected

Definition at line 34 of file class.ilSearchFilterGUI.php.

◆ $nav_history

ilNavigationHistory ilSearchFilterGUI::$nav_history
protected

Definition at line 32 of file class.ilSearchFilterGUI.php.

◆ $renderer

ILIAS UI Renderer ilSearchFilterGUI::$renderer
protected

Definition at line 31 of file class.ilSearchFilterGUI.php.


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