24 include_once
'./Services/Search/classes/class.ilSearchBaseGUI.php';
25 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchFields.php';
26 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
27 include_once
'./Services/Administration/interfaces/interface.ilAdministrationCommandHandling.php';
58 parent::__construct();
69 $next_class = $this->ctrl->getNextClass($this);
70 $cmd = $this->ctrl->getCmd();
73 switch ($next_class) {
74 case 'ilobjectcopygui':
75 $this->ctrl->setReturn($this);
76 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
78 $this->ctrl->forwardCommand($cp);
84 $cmd =
"showSavedResults";
104 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
105 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
112 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
114 $filter->loadFromDb();
117 if ($filter->getResultObjIds()) {
118 $searcher->highlight($filter->getResultObjIds());
121 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
122 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
124 $presentation->setResults($filter->getResultIds());
125 $presentation->setSearcher($searcher);
129 $this->
addPager($filter,
'max_page');
130 $presentation->setPreviousNext($this->prev_link, $this->next_link);
132 if ($presentation->render()) {
133 $this->tpl->setVariable(
'SEARCH_RESULTS', $presentation->getHTML(
true));
134 } elseif (strlen(trim($qp->getQuery()))) {
140 $this->tpl->setVariable(
'SEARCH_TABLE', $this->form->getHTML());
142 if ($filter->getResultIds()) {
154 $tree = $DIC[
'tree'];
156 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
159 $this->form->setFormAction($this->ctrl->getFormAction($this,
'search'));
160 $this->form->setTitle($this->lng->txt(
'search_advanced'));
161 $this->form->addCommandButton(
'search', $this->lng->txt(
'search'));
162 $this->form->addCommandButton(
'reset', $this->lng->txt(
'reset'));
164 foreach ($this->
fields->getActiveSections() as $definition) {
165 if ($definition[
'name'] !=
'default') {
167 $section->setTitle($definition[
'name']);
171 foreach ($definition[
'fields'] as $field_name) {
172 if (is_object($element = $this->
fields->getFormElement($this->search_cache->getQuery(), $field_name,
$this->form))) {
173 $this->form->addItem($element);
185 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
186 $this->search_cache->setQuery(array(
'lom_content' =>
ilUtil::stripSlashes($_POST[
'queryString'])));
187 $this->search_cache->save();
193 if (!is_array($this->search_cache->getQuery())) {
200 $this->search_cache->deleteCachedEntries();
203 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
214 $this->search_cache->setQuery(array());
215 $this->search_cache->save();
231 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
232 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
235 if (!strlen(trim($qp->getQuery()))) {
245 $ilBench->start(
'Lucene',
'ResultFilter');
246 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
247 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
250 $filter->setCandidates($searcher->getResult());
252 $ilBench->stop(
'Lucene',
'ResultFilter');
254 if ($filter->getResultObjIds()) {
255 $searcher->highlight($filter->getResultObjIds());
259 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
260 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
262 $presentation->setResults($filter->getResultIds());
263 $presentation->setSearcher($searcher);
266 $ilBench->start(
'Lucene',
'1500_fo');
267 $this->
addPager($filter,
'max_page');
268 $ilBench->stop(
'Lucene',
'1500_fo');
269 $presentation->setPreviousNext($this->prev_link, $this->next_link);
271 if ($presentation->render()) {
272 $this->tpl->setVariable(
'SEARCH_RESULTS', $presentation->getHTML(
true));
279 $this->tpl->setVariable(
'SEARCH_TABLE', $this->form->getHTML());
281 if ($filter->getResultIds()) {
291 parent::prepareOutput();
303 $ilHelp = $DIC[
'ilHelp'];
305 $ilHelp->setScreenIdComponent(
"src_luc");
307 $this->tabs_gui->addTarget(
'search', $this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
310 $this->tabs_gui->addTarget(
'search_user', $this->ctrl->getLinkTargetByClass(
'illuceneusersearchgui'));
315 $this->
fields->getActiveFields()) {
316 $this->tabs_gui->addTarget(
'search_advanced', $this->ctrl->getLinkTarget($this));
319 $this->tabs_gui->setTabActive(
'search_advanced');
334 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
337 if ((
int)
$_GET[
'page_number']) {
338 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
340 if (isset(
$_POST[
'query'])) {
341 $this->search_cache->setQuery(
$_POST[
'query']);
350 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
353 if ((count((array) $this->admin_panel_commands) > 0)) {
354 foreach ($this->admin_panel_commands as $cmd) {
355 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
356 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
357 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
358 $this->tpl->parseCurrentBlock();
364 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
366 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW",
$lng->txt(
"actions"));
367 $this->tpl->parseCurrentBlock();
368 $adm_view_cmp =
true;
372 if (is_array($this->admin_view_button)) {
373 if (is_array($this->admin_view_button)) {
374 $this->tpl->setCurrentBlock(
"lucene_admin_button");
375 $this->tpl->setVariable(
376 "LUCENE_ADMIN_MODE_LINK",
377 $this->admin_view_button[
"link"]
379 $this->tpl->setVariable(
380 "LUCENE_TXT_ADMIN_MODE",
381 $this->admin_view_button[
"txt"]
383 $this->tpl->parseCurrentBlock();
385 $this->tpl->setCurrentBlock(
"lucene_admin_view");
386 $this->tpl->parseCurrentBlock();
391 if (is_array($this->creation_selector)) {
392 $this->tpl->setCurrentBlock(
"lucene_add_commands");
394 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
396 $this->tpl->setVariable(
397 "LUCENE_SELECT_OBJTYPE_REPOS",
398 $this->creation_selector[
"options"]
400 $this->tpl->setVariable(
401 "LUCENE_BTN_NAME_REPOS",
402 $this->creation_selector[
"command"]
404 $this->tpl->setVariable(
405 "LUCENE_TXT_ADD_REPOS",
406 $this->creation_selector[
"txt"]
408 $this->tpl->parseCurrentBlock();
409 $creation_selector =
true;
411 if ($adm_view || $creation_selector) {
412 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
414 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
416 $this->tpl->parseCurrentBlock();
425 $this->admin_panel_commands[] =
426 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
434 $this->admin_view_button =
435 array(
"link" => $a_link,
"txt" => $a_txt);
440 $this->page_form_action = $a_action;
GUI class for the workflow of copying objects.
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
reset()
Reset search form.
remoteSearch()
Search from main menu.
setPageFormAction($a_action)
executeCommand()
Execute Command.
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
prepareOutput()
Add admin panel command.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct()
Constructor.
static _getInstance($a_usr_id)
Get singleton instance.
static getInstance($a_user_id)
addPager($result, $a_session_key)
Add Pager.
if(isset($_POST['submit'])) $form
Presentation of search results using object list gui.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
initFormSearch()
Show search form.
handleCommand($a_cmd)
Handle command.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initUserSearchCache()
Init user search cache.
addAdminPanelCommand($a_cmd, $a_txt)
Add a command to the admin panel.
showSavedResults()
Show saved results.
setAdminViewButton($a_link, $a_txt)
Show admin view button.
performSearch()
Perform search.
static getInstance()
Get singleton instance.