ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLuceneUserSearchGUI Class Reference

GUI for Lucene user search More...

+ Inheritance diagram for ilLuceneUserSearchGUI:
+ Collaboration diagram for ilLuceneUserSearchGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute Command.
 prepareOutput ()
 Add admin panel command.
- Public Member Functions inherited from ilSearchBaseGUI
 ilSearchBaseGUI ()
 Constructor public.
 initStandardSearchForm ($a_mode)
 Init standard search form.
 getSearchAreaForm ()
 Init standard search form.
 handleCommand ($a_cmd)
 Handle command.
 addToDeskObject ()
 Interface methods.
 removeFromDeskObject ()
 Remove from dektop.
 delete ()
 Show deletion screen.
 cancelDelete ()
 Cancel delete.
 performDelete ()
 Delete objects.
 cut ()
 Interface ilAdministrationCommandHandler.
 link ()
 Interface ilAdministrationCommandHandler.
 paste ()
 Paste.
 showLinkIntoMultipleObjectsTree ()
 Target selection link.
 showMoveIntoObjectTree ()
 Target selection cut.
 performPasteIntoMultipleObjects ()
 Perform paste into multiple objects.
 clear ()
 clear clipboard
 enableAdministrationPanel ()
 Enable administration panel.
 disableAdministrationPanel ()
 Disable administration panel.
 addLocator ()
 Add Locator.
 autoComplete ()
 Data resource for autoComplete.

Protected Member Functions

 getType ()
 Get type of search (details | fast)
 getDetails ()
 Needed for base class search form.
 remoteSearch ()
 Search from main menu.
 showSavedResults ()
 Show saved results.
 search ()
 Search (button pressed)
 performSearch ()
 Perform search.
 getTabs ()
 get tabs
 initUserSearchCache ()
 Init user search cache.
 showSearchForm ()
 Show search form.
- Protected Member Functions inherited from ilSearchBaseGUI
 addPager ($result, $a_session_key)
 Add Pager.
 buildSearchAreaPath ($a_root_node)
 Build path for search area.

Protected Attributes

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

Additional Inherited Members

- 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

Detailed Description

Constructor & Destructor Documentation

ilLuceneUserSearchGUI::__construct ( )

Constructor.

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

References $ilTabs, and initUserSearchCache().

{
global $ilTabs;
$this->tabs_gui = $ilTabs;
}

+ Here is the call graph for this function:

Member Function Documentation

ilLuceneUserSearchGUI::executeCommand ( )

Execute Command.

Definition at line 40 of file class.ilLuceneUserSearchGUI.php.

References $_REQUEST, $cmd, $GLOBALS, $ilBench, $ilCtrl, $ret, ilSearchBaseGUI\handleCommand(), ilSearchBaseGUI\initStandardSearchForm(), prepareOutput(), and ilSearchBaseGUI\SEARCH_FORM_USER.

{
global $ilBench, $ilCtrl;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case "ilpublicuserprofilegui":
include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
$profile = new ilPublicUserProfileGUI((int) $_REQUEST['user']);
$profile->setBackUrl($this->ctrl->getLinkTarget($this,'showSavedResults'));
$ret = $ilCtrl->forwardCommand($profile);
$GLOBALS['tpl']->setContent($ret);
break;
default:
if(!$cmd)
{
$cmd = "showSavedResults";
}
break;
}
return true;
}

+ Here is the call graph for this function:

ilLuceneUserSearchGUI::getDetails ( )
protected

Needed for base class search form.

Todo:
rename
Returns
type

Definition at line 103 of file class.ilLuceneUserSearchGUI.php.

{
return (array) $this->search_cache->getItemFilter();
}
ilLuceneUserSearchGUI::getTabs ( )
protected

get tabs

Definition at line 197 of file class.ilLuceneUserSearchGUI.php.

References ilSearchSettings\getInstance(), and ilLuceneAdvancedSearchFields\getInstance().

Referenced by prepareOutput().

{
$this->tabs_gui->addTarget('search',$this->ctrl->getLinkTargetByClass('illucenesearchgui'));
if(ilSearchSettings::getInstance()->isLuceneUserSearchEnabled())
{
$this->tabs_gui->addTarget('search_user',$this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
}
if(
!ilSearchSettings::getInstance()->getHideAdvancedSearch() and
$fields->getActiveFields())
{
$this->tabs_gui->addTarget('search_advanced',$this->ctrl->getLinkTargetByClass('illuceneadvancedsearchgui'));
}
$this->tabs_gui->setTabActive('search_user');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneUserSearchGUI::getType ( )
protected

Get type of search (details | fast)

Todo:
rename Needed for base class search form

Definition at line 89 of file class.ilLuceneUserSearchGUI.php.

References ilSearchBaseGUI\SEARCH_DETAILS, and ilSearchBaseGUI\SEARCH_FAST.

{
if(count($this->search_cache))
{
}
}
ilLuceneUserSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

private

Definition at line 224 of file class.ilLuceneUserSearchGUI.php.

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

Referenced by __construct().

{
global $ilUser;
include_once('Services/Search/classes/class.ilUserSearchCache.php');
$this->search_cache = ilUserSearchCache::_getInstance($ilUser->getId());
$this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_USER_SEARCH);
if((int) $_GET['page_number'])
{
$this->search_cache->setResultPageNumber((int) $_GET['page_number']);
}
if(isset($_POST['term']))
{
$this->search_cache->setQuery(ilUtil::stripSlashes($_POST['term']));
$this->search_cache->setItemFilter(array());
$this->search_cache->setMimeFilter(array());
$this->search_cache->save();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneUserSearchGUI::performSearch ( )
protected

Perform search.

Definition at line 167 of file class.ilLuceneUserSearchGUI.php.

References $GLOBALS, ilLuceneSearcher\getInstance(), ilLuceneQueryParser\parse(), showSearchForm(), ilRepositoryUserResultTableGUI\TYPE_GLOBAL_SEARCH, and ilLuceneSearcher\TYPE_USER.

Referenced by search(), and showSavedResults().

{
include_once './Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
include_once './Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
$qp = new ilLuceneQueryParser($this->search_cache->getQuery());
$qp->parse();
$searcher->setType(ilLuceneSearcher::TYPE_USER);
$searcher->search();
$this->showSearchForm();
include_once './Services/Search/classes/class.ilRepositoryUserResultTableGUI.php';
$user_table = new ilRepositoryUserResultTableGUI(
$this,
'performSearch',
false,
);
$user_table->setLuceneResult($searcher->getResult());
$user_table->parseUserIds($searcher->getResult()->getCandidates());
$GLOBALS['tpl']->setVariable('SEARCH_RESULTS',$user_table->getHTML());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneUserSearchGUI::prepareOutput ( )

Add admin panel command.

Todo:

Reimplemented from ilSearchBaseGUI.

Definition at line 75 of file class.ilLuceneUserSearchGUI.php.

References getTabs().

Referenced by executeCommand().

{
$this->getTabs();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneUserSearchGUI::remoteSearch ( )
protected

Search from main menu.

Definition at line 112 of file class.ilLuceneUserSearchGUI.php.

References $_POST, search(), and ilUtil\stripSlashes().

{
$_POST['query'] = $_POST['queryString'];
$this->search_cache->setRoot((int) $_POST['root_id']);
$this->search_cache->setQuery(ilUtil::stripSlashes($_POST['queryString']));
$this->search_cache->save();
$this->search();
}

+ Here is the call graph for this function:

ilLuceneUserSearchGUI::search ( )
protected

Search (button pressed)

Returns

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

References $_SESSION, performSearch(), ilSubItemListGUI\resetDetails(), and showSearchForm().

Referenced by remoteSearch().

{
if(!$this->form->checkInput())
{
$this->search_cache->deleteCachedEntries();
// Reset details
include_once './Services/Object/classes/class.ilSubItemListGUI.php';
$this->showSearchForm();
return false;
}
unset($_SESSION['max_page']);
$this->search_cache->deleteCachedEntries();
// Reset details
include_once './Services/Object/classes/class.ilSubItemListGUI.php';
$this->performSearch();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLuceneUserSearchGUI::showSavedResults ( )
protected

Show saved results.

Returns

Definition at line 126 of file class.ilLuceneUserSearchGUI.php.

References $ilBench, $ilUser, performSearch(), and showSearchForm().

{
global $ilUser,$ilBench;
if(strlen($this->search_cache->getQuery()))
{
return $this->performSearch();
}
return $this->showSearchForm();
}

+ Here is the call graph for this function:

ilLuceneUserSearchGUI::showSearchForm ( )
protected

Show search form.

Returns
boolean

Definition at line 250 of file class.ilLuceneUserSearchGUI.php.

References $GLOBALS, $ilCtrl, ilSearchBaseGUI\$lng, ilOverlayGUI\initJavascript(), and ilUtil\prepareFormOutput().

Referenced by performSearch(), search(), and showSavedResults().

{
global $ilCtrl, $lng;
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.lucene_usr_search.html','Services/Search');
// include js needed
include_once("./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php");
$this->tpl->addJavascript("./Services/Search/js/Search.js");
$this->tpl->setVariable('FORM_ACTION',$GLOBALS['ilCtrl']->getFormAction($this,'performSearch'));
$this->tpl->setVariable("TERM", ilUtil::prepareFormOutput($this->search_cache->getQuery()));
$this->tpl->setVariable("TXT_SEARCH", $lng->txt("search"));
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilLuceneUserSearchGUI::$ilTabs
protected

Definition at line 22 of file class.ilLuceneUserSearchGUI.php.

Referenced by __construct().


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