ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSearchGUI Class Reference

Class ilSearchGUI. More...

+ Inheritance diagram for ilSearchGUI:
+ Collaboration diagram for ilSearchGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 executeCommand ()
 Control public. More...
 
 setType ($a_type)
 Set/get type of search (detail or 'fast' search) public. More...
 
 getType ()
 
 setCombination ($a_combination)
 Set/get combination of search ('and' or 'or') public. More...
 
 getCombination ()
 
 setString ($a_str)
 Set/get search string public. More...
 
 getString ()
 
 setDetails ($a_details)
 Set/get details (object types for details search) public. More...
 
 getDetails ()
 
 getRootNode ()
 
 setRootNode ($a_node_id)
 
 remoteSearch ()
 
 autoComplete ()
 Data resource for autoComplete. More...
 
 showSearch ()
 
 showSavedResults ()
 
 performSearch ()
 Perform search. More...
 
 prepareOutput ()
 
__performDetailsSearch (&$query_parser, &$result)
 
__parseQueryString ()
 parse query string, using query parser instance More...
 
__searchObjects (&$query_parser)
 Search in obect title,desctiption. More...
 
__searchMeta (&$query_parser, $a_type)
 Search in object meta data (keyword) More...
 
 __getFilter ()
 Get object type for filter (If detail search is enabled) More...
 
- Public Member Functions inherited from ilSearchBaseGUI
 ilSearchBaseGUI ()
 Constructor public. More...
 
 prepareOutput ()
 
 initStandardSearchForm ($a_mode)
 Init standard search form. More...
 
 getSearchAreaForm ()
 Init standard search form. More...
 
 handleCommand ($a_cmd)
 Handle command. More...
 
 addToDeskObject ()
 Interface methods. More...
 
 removeFromDeskObject ()
 Remove from dektop. More...
 
 delete ()
 Show deletion screen. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 cancelMoveLinkObject ()
 Cancel move/link. More...
 
 performDelete ()
 Delete objects. More...
 
 cut ()
 Interface ilAdministrationCommandHandler. More...
 
 link ()
 Interface ilAdministrationCommandHandler. More...
 
 paste ()
 Paste. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection link. More...
 
 showMoveIntoObjectTree ()
 Target selection cut. More...
 
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects. More...
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 Enable administration panel. More...
 
 disableAdministrationPanel ()
 Disable administration panel. More...
 
 addLocator ()
 Add Locator. More...
 
 autoComplete ()
 Data resource for autoComplete. More...
 

Data Fields

 $root_node
 
 $combination
 
 $string
 
 $type
 
- Data Fields inherited from ilSearchBaseGUI
const SEARCH_FAST = 1
 
const SEARCH_DETAILS = 2
 
const SEARCH_AND = 'and'
 
const SEARCH_OR = 'or'
 
const SEARCH_FORM_LUCENE = 1
 
const SEARCH_FORM_STANDARD = 2
 
const SEARCH_FORM_USER = 3
 
 $settings = null
 
 $ilias = null
 
 $lng = null
 
 $tpl = null
 

Protected Member Functions

 storeRoot ()
 Store new root node. More...
 
 initUserSearchCache ()
 Init user search cache. More...
 
- Protected Member Functions inherited from ilSearchBaseGUI
 addPager ($result, $a_session_key)
 Add Pager. More...
 
 buildSearchAreaPath ($a_root_node)
 Build path for search area. More...
 

Protected Attributes

 $search_cache = null
 
- Protected Attributes inherited from ilSearchBaseGUI
 $ctrl = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSearchGUI::__construct ( )

Constructor public.

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

References $_POST, $_SESSION, $ilUser, ilSearchBaseGUI\$lng, $type, ilSearchSettings\getInstance(), ilSearchBaseGUI\initStandardSearchForm(), ilSearchBaseGUI\SEARCH_FORM_STANDARD, setCombination(), setDetails(), setString(), and setType().

37  {
38  global $ilUser, $lng;
39 
40  $lng->loadLanguageModule("search");
41 
42  // put form values into "old" post variables
44  $this->form->checkInput();
45 
46  $new_search = isset($_POST['cmd']['performSearch']) ? true : false;
47 
48  $enabled_types = ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions();
49  foreach($enabled_types as $type => $pval)
50  {
51  if($_POST['filter_type'][$type] == 1)
52  {
53  $_POST["search"]["details"][$type] = $_POST['filter_type'][$type];
54  }
55  }
56 
57  $_POST["search"]["string"] = $_POST["term"];
58  $_POST["search"]["combination"] = $_POST["combination"];
59  $_POST["search"]["type"] = $_POST["type"];
60  $_SESSION['search_root'] = $_POST["area"];
61 
62  $this->root_node = $_SESSION['search_root'] ? $_SESSION['search_root'] : ROOT_FOLDER_ID;
63  $this->setType($_POST['search']['type'] ? $_POST['search']['type'] : $_SESSION['search']['type']);
64  $this->setCombination($_POST['search']['combination'] ? $_POST['search']['combination'] : $_SESSION['search']['combination']);
65  $this->setString($_POST['search']['string'] ? $_POST['search']['string'] : $_SESSION['search']['string']);
66  #$this->setDetails($_POST['search']['details'] ? $_POST['search']['details'] : $_SESSION['search']['details']);
67  $this->setDetails($new_search ? $_POST['search']['details'] : $_SESSION['search']['details']);
68  parent::__construct();
69  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setType($a_type)
Set/get type of search (detail or &#39;fast&#39; search) public.
$_POST['username']
Definition: cron.php:12
setCombination($a_combination)
Set/get combination of search (&#39;and&#39; or &#39;or&#39;) public.
initStandardSearchForm($a_mode)
Init standard search form.
setDetails($a_details)
Set/get details (object types for details search) public.
setString($a_str)
Set/get search string public.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

Member Function Documentation

◆ __getFilter()

ilSearchGUI::__getFilter ( )

Get object type for filter (If detail search is enabled)

Returns
array object types public

Definition at line 577 of file class.ilSearchGUI.php.

References getDetails(), getType(), and ilSearchBaseGUI\SEARCH_DETAILS.

Referenced by __performDetailsSearch(), __searchMeta(), and __searchObjects().

578  {
580  {
581  return false;
582  }
583 
584  foreach($this->getDetails() as $key => $detail_type)
585  {
586  if(!$detail_type)
587  {
588  continue;
589  }
590 
591  switch($key)
592  {
593  case 'lms':
594  $filter[] = 'lm';
595  $filter[] = 'dbk';
596  $filter[] = 'pg';
597  $filter[] = 'st';
598  $filter[] = 'sahs';
599  $filter[] = 'htlm';
600  break;
601 
602  case 'frm':
603  $filter[] = 'frm';
604  break;
605 
606  case 'glo':
607  $filter[] = 'glo';
608  break;
609 
610  case 'exc':
611  $filter[] = 'exc';
612  break;
613 
614  case 'mcst':
615  $filter[] = 'mcst';
616  break;
617 
618  case 'tst':
619  $filter[] = 'tst';
620  $filter[] = 'svy';
621  $filter[] = 'qpl';
622  $filter[] = 'spl';
623  break;
624 
625  case 'mep':
626  $filter[] = 'mep';
627  $filter[] = 'mob';
628  break;
629 
630  case 'fil':
631  $filter[] = 'file';
632  break;
633 
634  case 'wiki':
635  $filter[] = 'wpg';
636  break;
637 
638  default:
639  $filter[] = $key;
640  }
641  }
642  return $filter ? $filter : array();
643  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __parseQueryString()

& ilSearchGUI::__parseQueryString ( )

parse query string, using query parser instance

Returns
object of query parser or error message if an error occured public

Definition at line 506 of file class.ilSearchGUI.php.

References getCombination(), getString(), and ilUtil\stripSlashes().

Referenced by performSearch().

507  {
508  include_once 'Services/Search/classes/class.ilQueryParser.php';
509 
510  $query_parser = new ilQueryParser(ilUtil::stripSlashes($this->getString()));
511  $query_parser->setCombination($this->getCombination());
512  $query_parser->parse();
513 
514  if(!$query_parser->validate())
515  {
516  return $query_parser->getMessage();
517  }
518  return $query_parser;
519  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performDetailsSearch()

& ilSearchGUI::__performDetailsSearch ( $query_parser,
$result 
)

Definition at line 411 of file class.ilSearchGUI.php.

References $result, __getFilter(), ilObjectSearchFactory\_getExerciseSearchInstance(), ilObjectSearchFactory\_getForumSearchInstance(), ilObjectSearchFactory\_getGlossaryDefinitionSearchInstance(), ilObjectSearchFactory\_getLMContentSearchInstance(), ilObjectSearchFactory\_getMediaPoolSearchInstance(), ilObjectSearchFactory\_getObjectSearchInstance(), ilObjectSearchFactory\_getTestSearchInstance(), ilObjectSearchFactory\_getWikiContentSearchInstance(), and getDetails().

Referenced by performSearch().

412  {
413  foreach($this->getDetails() as $type => $enabled)
414  {
415  if(!$enabled)
416  {
417  continue;
418  }
419 
420  switch($type)
421  {
422  case 'crs':
423  $crs_search = ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
424  $crs_search->setFilter(array('crs'));
425  $result->mergeEntries($crs_search->performSearch());
426  break;
427 
428  case 'grp':
429  $grp_search = ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
430  $grp_search->setFilter(array('grp'));
431  $result->mergeEntries($grp_search->performSearch());
432  break;
433 
434  case 'lms':
435  $content_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
436  $content_search->setFilter($this->__getFilter());
437  $result->mergeEntries($content_search->performSearch());
438  break;
439 
440  case 'frm':
441  $forum_search =& ilObjectSearchFactory::_getForumSearchInstance($query_parser);
442  $forum_search->setFilter($this->__getFilter());
443  $result->mergeEntries($forum_search->performSearch());
444  break;
445 
446  case 'glo':
447  // Glossary term definition pages
448  $gdf_search =& ilObjectSearchFactory::_getLMContentSearchInstance($query_parser);
449  $gdf_search->setFilter(array('gdf'));
450  $result->mergeEntries($gdf_search->performSearch());
451  // Glossary terms
452  $gdf_term_search =& ilObjectSearchFactory::_getGlossaryDefinitionSearchInstance($query_parser);
453  $result->mergeEntries($gdf_term_search->performSearch());
454  break;
455 
456  case 'exc':
457  $exc_search =& ilObjectSearchFactory::_getExerciseSearchInstance($query_parser);
458  $exc_search->setFilter($this->__getFilter());
459  $result->mergeEntries($exc_search->performSearch());
460  break;
461 
462  case 'mcst':
463  $mcst_search =& ilObjectSearchFactory::_getMediaCastSearchInstance($query_parser);
464  $result->mergeEntries($mcst_search->performSearch());
465  break;
466 
467  case 'tst':
468  $tst_search =& ilObjectSearchFactory::_getTestSearchInstance($query_parser);
469  $tst_search->setFilter($this->__getFilter());
470  $result->mergeEntries($tst_search->performSearch());
471  break;
472 
473  case 'mep':
474  $mep_search =& ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
475  $mep_search->setFilter($this->__getFilter());
476  $result->mergeEntries($mep_search->performSearch());
477 
478  // Mob keyword search
479  $mob_search = ilObjectSearchFactory::_getMediaPoolSearchInstance($query_parser);
480  $mob_search->setFilter($this->__getFilter());
481  $result->mergeEntries($mob_search->performKeywordSearch());
482 
483  break;
484 
485  case 'wiki':
486  $wiki_search =& ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
487  $wiki_search->setFilter($this->__getFilter());
488  $result->mergeEntries($wiki_search->performSearch());
489 
490  /*$result_meta =& $this->__searchMeta($query_parser,'title');
491  $result->mergeEntries($result_meta);
492  $result_meta =& $this->__searchMeta($query_parser,'description');
493  $result->mergeEntries($result_meta);*/
494  break;
495 
496  }
497  }
498  return $result;
499  }
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch
$result
static _getMediaPoolSearchInstance($query_parser)
get reference of ilFulltextMediapoolSearch
static _getForumSearchInstance($query_parser)
get reference of ilFulltextForumSearch
static _getExerciseSearchInstance($query_parser)
get reference of ilFulltextExerciseSearch
static _getGlossaryDefinitionSearchInstance($query_parser)
get reference of ilFulltextGlossaryDefinitionSearch
static _getLMContentSearchInstance($query_parser)
get reference of ilFulltextLMContentSearch
__getFilter()
Get object type for filter (If detail search is enabled)
static _getObjectSearchInstance($query_parser)
get reference of ilFulltext/LikeObjectSearch.
static _getTestSearchInstance($query_parser)
get reference of ilFulltextTestSearch
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchMeta()

& ilSearchGUI::__searchMeta ( $query_parser,
  $a_type 
)

Search in object meta data (keyword)

Returns
object result object public

Definition at line 543 of file class.ilSearchGUI.php.

References __getFilter(), ilObjectSearchFactory\_getMetaDataSearchInstance(), getType(), and ilSearchBaseGUI\SEARCH_DETAILS.

Referenced by performSearch().

544  {
545  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
546 
547  $meta_search =& ilObjectSearchFactory::_getMetaDataSearchInstance($query_parser);
549  {
550  $meta_search->setFilter($this->__getFilter());
551  }
552  switch($a_type)
553  {
554  case 'keyword':
555  $meta_search->setMode('keyword');
556  break;
557 
558  case 'contribute':
559  $meta_search->setMode('contribute');
560  break;
561 
562  case 'title':
563  $meta_search->setMode('title');
564  break;
565 
566  case 'description':
567  $meta_search->setMode('description');
568  break;
569  }
570  return $meta_search->performSearch();
571  }
static _getMetaDataSearchInstance($query_parser)
get reference of ilFulltext/LikeMetaDataSearch.
__getFilter()
Get object type for filter (If detail search is enabled)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __searchObjects()

& ilSearchGUI::__searchObjects ( $query_parser)

Search in obect title,desctiption.

Returns
object result object public

Definition at line 525 of file class.ilSearchGUI.php.

References __getFilter(), ilObjectSearchFactory\_getObjectSearchInstance(), getType(), and ilSearchBaseGUI\SEARCH_DETAILS.

Referenced by performSearch().

526  {
527  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
528 
529  $obj_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
531  {
532  $obj_search->setFilter($this->__getFilter());
533  }
534  return $obj_search->performSearch();
535  }
__getFilter()
Get object type for filter (If detail search is enabled)
static _getObjectSearchInstance($query_parser)
get reference of ilFulltext/LikeObjectSearch.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autoComplete()

ilSearchGUI::autoComplete ( )

Data resource for autoComplete.

Definition at line 203 of file class.ilSearchGUI.php.

References $_REQUEST, exit, and ilSearchAutoComplete\getList().

204  {
205  $q = $_REQUEST["term"];
206  include_once("./Services/Search/classes/class.ilSearchAutoComplete.php");
207  $list = ilSearchAutoComplete::getList($q);
208  echo $list;
209  exit;
210 
211  }
exit
Definition: login.php:54
static getList($a_str)
Get completion list.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ executeCommand()

ilSearchGUI::executeCommand ( )

Control public.

Definition at line 76 of file class.ilSearchGUI.php.

References $cmd, $ilCtrl, ilSearchBaseGUI\getSearchAreaForm(), ilSearchBaseGUI\handleCommand(), initUserSearchCache(), and prepareOutput().

77  {
78  global $rbacsystem, $ilCtrl;
79 
80 
81 
82  $next_class = $this->ctrl->getNextClass($this);
83  $cmd = $this->ctrl->getCmd();
84 
85  switch($next_class)
86  {
87  case "ilpropertyformgui":
88  //$this->initStandardSearchForm(ilSearchBaseGUI::SEARCH_FORM_STANDARD);
89  $form = $this->getSearchAreaForm();
90  $this->prepareOutput();
91  $ilCtrl->setReturn($this, 'storeRoot');
92  return $ilCtrl->forwardCommand($form);
93 
94  case 'ilobjectcopygui':
95  $this->prepareOutput();
96  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
97  $cp = new ilObjectCopyGUI($this);
98  $this->ctrl->forwardCommand($cp);
99  break;
100 
101  default:
102  $this->initUserSearchCache();
103  if(!$cmd)
104  {
105  $cmd = "showSavedResults";
106  }
107  $this->prepareOutput();
108  $this->handleCommand($cmd);
109  break;
110  }
111  return true;
112  }
getSearchAreaForm()
Init standard search form.
GUI class for the workflow of copying objects.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
handleCommand($a_cmd)
Handle command.
initUserSearchCache()
Init user search cache.
+ Here is the call graph for this function:

◆ getCombination()

ilSearchGUI::getCombination ( )

Definition at line 134 of file class.ilSearchGUI.php.

References ilSearchBaseGUI\SEARCH_OR.

Referenced by __parseQueryString().

135  {
136  return $this->combination ? $this->combination : ilSearchBaseGUI::SEARCH_OR;
137  }
+ Here is the caller graph for this function:

◆ getDetails()

ilSearchGUI::getDetails ( )

Definition at line 158 of file class.ilSearchGUI.php.

Referenced by __getFilter(), __performDetailsSearch(), and performSearch().

159  {
160  return $this->details ? $this->details : array();
161  }
+ Here is the caller graph for this function:

◆ getRootNode()

ilSearchGUI::getRootNode ( )

Definition at line 164 of file class.ilSearchGUI.php.

Referenced by performSearch(), and showSavedResults().

165  {
166  return $this->root_node ? $this->root_node : ROOT_FOLDER_ID;
167  }
+ Here is the caller graph for this function:

◆ getString()

ilSearchGUI::getString ( )

Definition at line 146 of file class.ilSearchGUI.php.

References $string.

Referenced by __parseQueryString(), and showSearch().

147  {
148  return $this->string;
149  }
+ Here is the caller graph for this function:

◆ getType()

ilSearchGUI::getType ( )

Definition at line 122 of file class.ilSearchGUI.php.

References ilSearchBaseGUI\SEARCH_FAST.

Referenced by __getFilter(), __searchMeta(), __searchObjects(), and performSearch().

123  {
124  return $this->type ? $this->type : ilSearchBaseGUI::SEARCH_FAST;
125  }
+ Here is the caller graph for this function:

◆ initUserSearchCache()

ilSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

private

Definition at line 651 of file class.ilSearchGUI.php.

References $_GET, $_POST, $ilUser, ilUserSearchCache\_getInstance(), ilUserSearchCache\DEFAULT_SEARCH, and ilUtil\stripSlashes().

Referenced by executeCommand().

652  {
653  global $ilUser;
654 
655  include_once('Services/Search/classes/class.ilUserSearchCache.php');
656  $this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
657  $this->search_cache->switchSearchType(ilUserSearchCache::DEFAULT_SEARCH);
658  if($_GET['page_number'])
659  {
660  $this->search_cache->setResultPageNumber((int) $_GET['page_number']);
661  }
662  if(isset($_POST['cmd']['performSearch']))
663  {
664  $this->search_cache->setQuery(ilUtil::stripSlashes($_POST['term']));
665  $this->search_cache->save();
666  }
667  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static _getInstance($a_usr_id)
Get singleton instance.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilSearchGUI::performSearch ( )

Perform search.

Definition at line 296 of file class.ilSearchGUI.php.

References $_GET, $_SESSION, $ilUser, $result, __parseQueryString(), __performDetailsSearch(), __searchMeta(), __searchObjects(), ilSearchBaseGUI\addPager(), getDetails(), getRootNode(), getType(), ilSearchResultPresentation\MODE_STANDARD, ilSearchResult\read(), ilSearchBaseGUI\SEARCH_DETAILS, ilUtil\sendInfo(), and showSearch().

Referenced by remoteSearch(), and storeRoot().

297  {
298  global $ilUser;
299 
300  if(!isset($_GET['page_number']) and $this->search_mode != 'in_results' )
301  {
302  unset($_SESSION['max_page']);
303  $this->search_cache->deleteCachedEntries();
304  }
305 
306  if($this->getType() == ilSearchBaseGUI::SEARCH_DETAILS and !$this->getDetails())
307  {
308  ilUtil::sendInfo($this->lng->txt('search_choose_object_type'));
309  $this->showSearch();
310  return false;
311  }
312 
313  // Step 1: parse query string
314  if(!is_object($query_parser =& $this->__parseQueryString()))
315  {
316  ilUtil::sendInfo($query_parser);
317  $this->showSearch();
318 
319  return false;
320  }
321  // Step 2: perform object search. Get an ObjectSearch object via factory. Depends on fulltext or like search type.
322  $result =& $this->__searchObjects($query_parser);
323 
324  // Step 3: perform meta keyword search. Get an MetaDataSearch object.
325  $result_meta =& $this->__searchMeta($query_parser,'keyword');
326  $result->mergeEntries($result_meta);
327 
328  $result_meta =& $this->__searchMeta($query_parser,'contribute');
329  $result->mergeEntries($result_meta);
330 
331  $result_meta =& $this->__searchMeta($query_parser,'title');
332  $result->mergeEntries($result_meta);
333 
334  $result_meta =& $this->__searchMeta($query_parser,'description');
335  $result->mergeEntries($result_meta);
336 
337  // Perform details search in object specific tables
339  {
340  $result = $this->__performDetailsSearch($query_parser,$result);
341  }
342  // Step 5: Search in results
343  if($this->search_mode == 'in_results')
344  {
345  include_once 'Services/Search/classes/class.ilSearchResult.php';
346 
347  $old_result_obj = new ilSearchResult($ilUser->getId());
348  $old_result_obj->read();
349 
350  $result->diffEntriesFromResult($old_result_obj);
351  }
352 
353 
354  // Step 4: merge and validate results
355  $result->filter($this->getRootNode(),$query_parser->getCombination() == 'and');
356  $result->save();
357  $this->showSearch();
358 
359  if(!count($result->getResults()))
360  {
361  ilUtil::sendInfo($this->lng->txt('search_no_match'));
362  }
363 
364  if($result->isLimitReached())
365  {
366  #$message = sprintf($this->lng->txt('search_limit_reached'),$this->settings->getMaxHits());
367  #ilUtil::sendInfo($message);
368  }
369 
370  // Step 6: show results
371  $this->addPager($result,'max_page');
372 
373  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
375  $presentation->setResults($result->getResultsForPresentation());
376  $presentation->setSubitemIds($result->getSubitemIds());
377  $presentation->setPreviousNext($this->prev_link, $this->next_link);
378 
379  if($presentation->render())
380  {
381 // $this->tpl->setVariable('SEARCH_RESULTS',$presentation->getHTML());
382  $this->tpl->setVariable('RESULTS_TABLE',$presentation->getHTML(true));
383  }
384 
385  return true;
386  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
read($a_type=DEFAULT_SEARCH)
read search results
& __performDetailsSearch(&$query_parser, &$result)
$result
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
& __parseQueryString()
parse query string, using query parser instance
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
& __searchObjects(&$query_parser)
Search in obect title,desctiption.
global $ilUser
Definition: imgupload.php:15
& __searchMeta(&$query_parser, $a_type)
Search in object meta data (keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilSearchGUI::prepareOutput ( )

Definition at line 390 of file class.ilSearchGUI.php.

Referenced by executeCommand().

391  {
392  global $ilTabs, $ilHelp;
393 
394  parent::prepareOutput();
395 
396  $ilHelp->setScreenIdComponent("src");
397 
398  $ilTabs->addTab("search", $this->lng->txt("search"),
399  $this->ctrl->getLinkTarget($this));
400 
401  if (!$this->settings->getHideAdvancedSearch())
402  {
403  $ilTabs->addTab("adv_search", $this->lng->txt("search_advanced"),
404  $this->ctrl->getLinkTargetByClass('iladvancedsearchgui'));
405  }
406 
407  $ilTabs->activateTab("search");
408  }
+ Here is the caller graph for this function:

◆ remoteSearch()

ilSearchGUI::remoteSearch ( )

Definition at line 174 of file class.ilSearchGUI.php.

References $_POST, performSearch(), setRootNode(), setString(), and ilUtil\stripSlashes().

175  {
176  $this->setString(ilUtil::stripSlashes($_POST['queryString']));
177  $this->setRootNode((int) $_POST['root_id']);
178  $this->performSearch();
179 
180  }
$_POST['username']
Definition: cron.php:12
performSearch()
Perform search.
setRootNode($a_node_id)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setString($a_str)
Set/get search string public.
+ Here is the call graph for this function:

◆ setCombination()

ilSearchGUI::setCombination (   $a_combination)

Set/get combination of search ('and' or 'or') public.

Definition at line 130 of file class.ilSearchGUI.php.

References $_SESSION.

Referenced by __construct().

131  {
132  $_SESSION['search']['combination'] = $this->combination = $a_combination;
133  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setDetails()

ilSearchGUI::setDetails (   $a_details)

Set/get details (object types for details search) public.

Definition at line 154 of file class.ilSearchGUI.php.

References $_SESSION.

Referenced by __construct().

155  {
156  $_SESSION['search']['details'] = $this->details = $a_details;
157  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setRootNode()

ilSearchGUI::setRootNode (   $a_node_id)

Definition at line 168 of file class.ilSearchGUI.php.

References $_SESSION.

Referenced by remoteSearch().

169  {
170  $_SESSION['search_root'] = $this->root_node = $a_node_id;
171  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setString()

ilSearchGUI::setString (   $a_str)

Set/get search string public.

Definition at line 142 of file class.ilSearchGUI.php.

References $_SESSION.

Referenced by __construct(), and remoteSearch().

143  {
144  $_SESSION['search']['string'] = $this->string = $a_str;
145  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ setType()

ilSearchGUI::setType (   $a_type)

Set/get type of search (detail or 'fast' search) public.

Definition at line 118 of file class.ilSearchGUI.php.

References $_SESSION.

Referenced by __construct().

119  {
120  $_SESSION['search']['type'] = $this->type = $a_type;
121  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the caller graph for this function:

◆ showSavedResults()

ilSearchGUI::showSavedResults ( )

Definition at line 257 of file class.ilSearchGUI.php.

References $ilUser, ilSearchBaseGUI\addPager(), getRootNode(), ilSearchResultPresentation\MODE_STANDARD, ilSearchResult\read(), and showSearch().

258  {
259  global $ilUser;
260 
261  // Read old result sets
262  include_once 'Services/Search/classes/class.ilSearchResult.php';
263 
264  $result_obj = new ilSearchResult($ilUser->getId());
265  $result_obj->read();
266  $result_obj->filterResults($this->getRootNode());
267 
268  $this->showSearch();
269 
270  // Show them
271  if(count($result_obj->getResults()))
272  {
273  $this->addPager($result_obj,'max_page');
274 
275  include_once './Services/Search/classes/class.ilSearchResultPresentation.php';
277  $presentation->setResults($result_obj->getResultsForPresentation());
278  $presentation->setSubitemIds($result_obj->getSubitemIds());
279  $presentation->setPreviousNext($this->prev_link, $this->next_link);
280  #$presentation->setSearcher($searcher);
281 
282  if($presentation->render())
283  {
284 // $this->tpl->setVariable('SEARCH_RESULTS',$presentation->getHTML());
285  $this->tpl->setVariable('RESULTS_TABLE',$presentation->getHTML(true));
286  }
287  }
288 
289  return true;
290  }
read($a_type=DEFAULT_SEARCH)
read search results
addPager($result, $a_session_key)
Add Pager.
Presentation of search results using object list gui.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ showSearch()

ilSearchGUI::showSearch ( )

Definition at line 213 of file class.ilSearchGUI.php.

References $ilCtrl, ilSearchBaseGUI\$lng, ilGlyphGUI\CARET, ilGlyphGUI\get(), ilSubmitButton\getInstance(), ilSearchSettings\getInstance(), ilSearchBaseGUI\getSearchAreaForm(), getString(), ilOverlayGUI\initJavascript(), ilSearchBaseGUI\initStandardSearchForm(), ilSearchSettings\OPERATOR_AND, ilUtil\prepareFormOutput(), and ilSearchBaseGUI\SEARCH_FORM_STANDARD.

Referenced by performSearch(), and showSavedResults().

214  {
215  global $ilLocator, $ilCtrl, $lng;
216 
217  // include js needed
218  include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
220  $this->tpl->addJavascript("./Services/Search/js/Search.js");
221 
222  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
223 
224  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.search.html','Services/Search');
225  $this->tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this,'performSearch'));
226  $this->tpl->setVariable("TERM", ilUtil::prepareFormOutput($this->getString()));
227  include_once("./Services/UIComponent/Button/classes/class.ilSubmitButton.php");
229  $btn->setCommand("performSearch");
230  $btn->setCaption("search");
231  $this->tpl->setVariable("SUBMIT_BTN",$btn->render());
232  $this->tpl->setVariable("TXT_OPTIONS", $lng->txt("options"));
233  $this->tpl->setVariable("ARR_IMG", ilGlyphGUI::get(ilGlyphGUI::CARET));
234  $this->tpl->setVariable("TXT_COMBINATION", $lng->txt("search_term_combination"));
235  $this->tpl->setVariable('TXT_COMBINATION_DEFAULT', ilSearchSettings::getInstance()->getDefaultOperator() == ilSearchSettings::OPERATOR_AND ? $lng->txt('search_all_words') : $lng->txt('search_any_word'));
236 
237  if (ilSearchSettings::getInstance()->isLuceneItemFilterEnabled())
238  {
239  $this->tpl->setCurrentBlock("type_sel");
240  $this->tpl->setVariable('TXT_TYPE_DEFAULT',$lng->txt("search_fast_info"));
241  $this->tpl->setVariable("TXT_TYPE", $lng->txt("search_type"));
243  $this->tpl->setVariable("ARR_IMGT", ilGlyphGUI::get(ilGlyphGUI::CARET));
244  $this->tpl->setVariable("FORM", $this->form->getHTML());
245  $this->tpl->parseCurrentBlock();
246  }
247 
248  $this->tpl->setVariable("TXT_AREA", $lng->txt("search_area"));
249 
250 
251  // search area form
252  $this->tpl->setVariable('SEARCH_AREA_FORM', $this->getSearchAreaForm()->getHTML());
253 
254  return true;
255  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getSearchAreaForm()
Init standard search form.
static get($a_glyph, $a_text="")
Get glyph html.
global $ilCtrl
Definition: ilias.php:18
initStandardSearchForm($a_mode)
Init standard search form.
static initJavascript()
Init javascript.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeRoot()

ilSearchGUI::storeRoot ( )
protected

Store new root node.

Definition at line 185 of file class.ilSearchGUI.php.

References ilSearchBaseGUI\getSearchAreaForm(), performSearch(), and ilSubItemListGUI\resetDetails().

186  {
187  $form = $this->getSearchAreaForm();
188 
189  $this->root_node = $form->getItemByPostVar('area')->getValue();
190  $this->search_cache->setRoot($this->root_node);
191  $this->search_cache->save();
192  $this->search_cache->deleteCachedEntries();
193 
194  include_once './Services/Object/classes/class.ilSubItemListGUI.php';
196 
197  $this->performSearch();
198  }
getSearchAreaForm()
Init standard search form.
performSearch()
Perform search.
static resetDetails()
reset details As long as static::resetDetails is not possible this method is final ...
+ Here is the call graph for this function:

Field Documentation

◆ $combination

ilSearchGUI::$combination

Definition at line 27 of file class.ilSearchGUI.php.

◆ $root_node

ilSearchGUI::$root_node

Definition at line 26 of file class.ilSearchGUI.php.

◆ $search_cache

ilSearchGUI::$search_cache = null
protected

Definition at line 24 of file class.ilSearchGUI.php.

◆ $string

ilSearchGUI::$string

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

Referenced by getString().

◆ $type

ilSearchGUI::$type

Definition at line 29 of file class.ilSearchGUI.php.

Referenced by __construct().


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