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';
56 parent::__construct();
67 $next_class = $this->ctrl->getNextClass($this);
68 $cmd = $this->ctrl->getCmd();
71 switch ($next_class) {
72 case 'ilobjectcopygui':
73 $this->ctrl->setReturn($this);
74 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
76 $this->ctrl->forwardCommand($cp);
82 $cmd =
"showSavedResults";
99 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
100 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
107 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
109 $filter->loadFromDb();
112 if ($filter->getResultObjIds()) {
113 $searcher->highlight($filter->getResultObjIds());
116 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
117 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
119 $presentation->setResults($filter->getResultIds());
120 $presentation->setSearcher($searcher);
124 $this->
addPager($filter,
'max_page');
125 $presentation->setPreviousNext($this->prev_link, $this->next_link);
127 if ($presentation->render()) {
128 $this->tpl->setVariable(
'SEARCH_RESULTS', $presentation->getHTML(
true));
129 } elseif (strlen(trim($qp->getQuery()))) {
135 $this->tpl->setVariable(
'SEARCH_TABLE', $this->form->getHTML());
137 if ($filter->getResultIds()) {
149 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
152 $this->form->setFormAction($this->ctrl->getFormAction($this,
'search'));
153 $this->form->setTitle($this->lng->txt(
'search_advanced'));
154 $this->form->addCommandButton(
'search', $this->lng->txt(
'search'));
155 $this->form->addCommandButton(
'reset', $this->lng->txt(
'reset'));
157 foreach ($this->
fields->getActiveSections() as $definition) {
158 if ($definition[
'name'] !=
'default') {
160 $section->setTitle($definition[
'name']);
164 foreach ($definition[
'fields'] as $field_name) {
165 if (is_object($element = $this->
fields->getFormElement($this->search_cache->getQuery(), $field_name,
$this->form))) {
166 $this->form->addItem($element);
178 $this->search_cache->setRoot((
int)
$_POST[
'root_id']);
180 $this->search_cache->save();
186 if (!is_array($this->search_cache->getQuery())) {
193 $this->search_cache->deleteCachedEntries();
196 include_once
'./Services/Object/classes/class.ilSubItemListGUI.php';
207 $this->search_cache->setQuery(
array());
208 $this->search_cache->save();
221 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
222 include_once
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedQueryParser.php';
225 if (!strlen(trim($qp->getQuery()))) {
235 $ilBench->start(
'Lucene',
'ResultFilter');
236 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
237 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
240 $filter->setCandidates($searcher->getResult());
242 $ilBench->stop(
'Lucene',
'ResultFilter');
244 if ($filter->getResultObjIds()) {
245 $searcher->highlight($filter->getResultObjIds());
249 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.lucene_adv_search.html',
'Services/Search');
250 include_once
'./Services/Search/classes/class.ilSearchResultPresentation.php';
252 $presentation->setResults($filter->getResultIds());
253 $presentation->setSearcher($searcher);
256 $ilBench->start(
'Lucene',
'1500_fo');
257 $this->
addPager($filter,
'max_page');
258 $ilBench->stop(
'Lucene',
'1500_fo');
259 $presentation->setPreviousNext($this->prev_link, $this->next_link);
261 if ($presentation->render()) {
262 $this->tpl->setVariable(
'SEARCH_RESULTS', $presentation->getHTML(
true));
269 $this->tpl->setVariable(
'SEARCH_TABLE', $this->form->getHTML());
271 if ($filter->getResultIds()) {
281 parent::prepareOutput();
293 $ilHelp->setScreenIdComponent(
"src_luc");
295 $this->tabs_gui->addTarget(
'search', $this->ctrl->getLinkTargetByClass(
'illucenesearchgui'));
298 $this->tabs_gui->addTarget(
'search_user', $this->ctrl->getLinkTargetByClass(
'illuceneusersearchgui'));
303 $this->
fields->getActiveFields()) {
304 $this->tabs_gui->addTarget(
'search_advanced', $this->ctrl->getLinkTarget($this));
307 $this->tabs_gui->setTabActive(
'search_advanced');
320 include_once(
'Services/Search/classes/class.ilUserSearchCache.php');
323 if ((
int)
$_GET[
'page_number']) {
324 $this->search_cache->setResultPageNumber((
int) $_GET[
'page_number']);
326 if (isset(
$_POST[
'query'])) {
327 $this->search_cache->setQuery(
$_POST[
'query']);
334 $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view =
false;
337 if ((count($this->admin_panel_commands) > 0)) {
338 foreach ($this->admin_panel_commands as $cmd) {
339 $this->tpl->setCurrentBlock(
"lucene_admin_panel_cmd");
340 $this->tpl->setVariable(
"LUCENE_PANEL_CMD", $cmd[
"cmd"]);
341 $this->tpl->setVariable(
"LUCENE_TXT_PANEL_CMD", $cmd[
"txt"]);
342 $this->tpl->parseCurrentBlock();
348 $this->tpl->setCurrentBlock(
"lucene_adm_view_components");
350 $this->tpl->setVariable(
"LUCENE_ADM_ALT_ARROW", $lng->txt(
"actions"));
351 $this->tpl->parseCurrentBlock();
352 $adm_view_cmp =
true;
356 if (is_array($this->admin_view_button)) {
357 if (is_array($this->admin_view_button)) {
358 $this->tpl->setCurrentBlock(
"lucene_admin_button");
359 $this->tpl->setVariable(
360 "LUCENE_ADMIN_MODE_LINK",
361 $this->admin_view_button[
"link"]
363 $this->tpl->setVariable(
364 "LUCENE_TXT_ADMIN_MODE",
365 $this->admin_view_button[
"txt"]
367 $this->tpl->parseCurrentBlock();
369 $this->tpl->setCurrentBlock(
"lucene_admin_view");
370 $this->tpl->parseCurrentBlock();
375 if (is_array($this->creation_selector)) {
376 $this->tpl->setCurrentBlock(
"lucene_add_commands");
378 $this->tpl->setVariable(
"LUCENE_ADD_COM_WIDTH",
'width="1"');
380 $this->tpl->setVariable(
381 "LUCENE_SELECT_OBJTYPE_REPOS",
382 $this->creation_selector[
"options"]
384 $this->tpl->setVariable(
385 "LUCENE_BTN_NAME_REPOS",
386 $this->creation_selector[
"command"]
388 $this->tpl->setVariable(
389 "LUCENE_TXT_ADD_REPOS",
390 $this->creation_selector[
"txt"]
392 $this->tpl->parseCurrentBlock();
393 $creation_selector =
true;
395 if ($adm_view || $creation_selector) {
396 $this->tpl->setCurrentBlock(
"lucene_adm_panel");
398 $this->tpl->setVariable(
"LUCENE_ADM_TBL_WIDTH",
'width:"100%";');
400 $this->tpl->parseCurrentBlock();
409 $this->admin_panel_commands[] =
410 array(
"cmd" => $a_cmd,
"txt" => $a_txt);
418 $this->admin_view_button =
419 array(
"link" => $a_link,
"txt" => $a_txt);
424 $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.
Create styles array
The data for the language used.
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.