ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSearchBaseGUI Class Reference
+ Inheritance diagram for ilSearchBaseGUI:
+ Collaboration diagram for ilSearchBaseGUI:

Public Member Functions

 ilSearchBaseGUI ()
 Constructor public.
 prepareOutput ()
 initStandardSearchForm ($a_mode)
 Init standard search form.
 getSearchAreaForm ()
 Init standard search form.
 handleCommand ($a_cmd)
 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.

Data Fields

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
 $settings = null
 $ilias = null
 $lng = null
 $tpl = null

Protected Member Functions

 addPager ($result, $a_session_key)
 Add Pager.
 buildSearchAreaPath ($a_root_node)
 Build path for search area.

Protected Attributes

 $ctrl = null

Detailed Description

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

Member Function Documentation

ilSearchBaseGUI::addLocator ( )

Add Locator.

Definition at line 349 of file class.ilSearchBaseGUI.php.

{
$ilLocator->addItem($this->lng->txt('search'),$this->ctrl->getLinkTarget($this));
$this->tpl->setLocator();
}
ilSearchBaseGUI::addPager (   $result,
  $a_session_key 
)
protected

Add Pager.

public

Parameters

Definition at line 362 of file class.ilSearchBaseGUI.php.

References $_SESSION, $result, and $tpl.

Referenced by ilAdvancedSearchGUI\performAdvMDSearch(), ilAdvancedSearchGUI\performSearch(), ilLuceneAdvancedSearchGUI\performSearch(), ilLuceneSearchGUI\performSearch(), ilSearchGUI\performSearch(), ilAdvancedSearchGUI\showSavedAdvMDResults(), ilLuceneAdvancedSearchGUI\showSavedResults(), ilLuceneSearchGUI\showSavedResults(), ilSearchGUI\showSavedResults(), and ilAdvancedSearchGUI\showSavedResults().

{
global $tpl;
$_SESSION["$a_session_key"] = max($_SESSION["$a_session_key"],$this->search_cache->getResultPageNumber());
if($_SESSION["$a_session_key"] == 1 and
(count($result->getResults()) < $result->getMaxHits()))
{
return true;
}
if($this->search_cache->getResultPageNumber() > 1)
{
$this->ctrl->setParameter($this,'page_number',$this->search_cache->getResultPageNumber() - 1);
/* $this->tpl->setCurrentBlock('prev');
$this->tpl->setVariable('PREV_LINK',$this->ctrl->getLinkTarget($this,'performSearch'));
$this->tpl->setVariable('TXT_PREV',$this->lng->txt('search_page_prev'));
$this->tpl->parseCurrentBlock();
*/
$this->prev_link = $this->ctrl->getLinkTarget($this,'performSearch');
}
for($i = 1;$i <= $_SESSION["$a_session_key"];$i++)
{
if($i == $this->search_cache->getResultPageNumber())
{
/* $this->tpl->setCurrentBlock('pages_link');
$this->tpl->setVariable('NUMBER',$i);
$this->tpl->parseCurrentBlock();
*/
continue;
}
$this->ctrl->setParameter($this,'page_number',$i);
$link = '<a href="'.$this->ctrl->getLinkTarget($this,'performSearch').'" /a>'.$i.'</a> ';
/* $this->tpl->setCurrentBlock('pages_link');
$this->tpl->setVariable('NUMBER',$link);
$this->tpl->parseCurrentBlock();
*/
}
if(count($result->getResults()) >= $result->getMaxHits())
{
$this->ctrl->setParameter($this,'page_number',$this->search_cache->getResultPageNumber() + 1);
/* $this->tpl->setCurrentBlock('next');
$this->tpl->setVariable('NEXT_LINK',$this->ctrl->getLinkTarget($this,'performSearch'));
$this->tpl->setVariable('TXT_NEXT',$this->lng->txt('search_page_next'));
$this->tpl->parseCurrentBlock();
*/
$this->next_link = $this->ctrl->getLinkTarget($this,'performSearch');
}
/* $this->tpl->setCurrentBlock('prev_next');
$this->tpl->setVariable('SEARCH_PAGE',$this->lng->txt('search_page'));
$this->tpl->parseCurrentBlock();
*/
$this->ctrl->clearParameters($this);
}

+ Here is the caller graph for this function:

ilSearchBaseGUI::addToDeskObject ( )

Interface methods.

Implements ilDesktopItemHandling.

Definition at line 232 of file class.ilSearchBaseGUI.php.

References ilDesktopItemGUI\addToDesktop().

{
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
$this->showSavedResults();
}

+ Here is the call graph for this function:

ilSearchBaseGUI::autoComplete ( )

Data resource for autoComplete.

Reimplemented in ilSearchGUI.

Definition at line 452 of file class.ilSearchBaseGUI.php.

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

{
$q = $_REQUEST["term"];
include_once("./Services/Search/classes/class.ilSearchAutoComplete.php");
echo $list;
}

+ Here is the call graph for this function:

ilSearchBaseGUI::buildSearchAreaPath (   $a_root_node)
protected

Build path for search area.

Returns

Definition at line 427 of file class.ilSearchBaseGUI.php.

References $data, and $path.

{
global $tree;
$path_arr = $tree->getPathFull($a_root_node,ROOT_FOLDER_ID);
$counter = 0;
foreach($path_arr as $data)
{
if($counter++)
{
$path .= " > ";
$path .= $data['title'];
}
else
{
$path .= $this->lng->txt('repository');
}
}
return $path;
}
ilSearchBaseGUI::cancelDelete ( )

Cancel delete.

Implements ilAdministrationCommandHandling.

Definition at line 262 of file class.ilSearchBaseGUI.php.

{
$this->showSavedResults();
}
ilSearchBaseGUI::clear ( )

clear clipboard

Implements ilAdministrationCommandHandling.

Definition at line 327 of file class.ilSearchBaseGUI.php.

References $_SESSION.

{
unset($_SESSION['clipboard']);
$this->ctrl->redirect($this);
}
ilSearchBaseGUI::cut ( )

Interface ilAdministrationCommandHandler.

Implements ilAdministrationCommandHandling.

Definition at line 280 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->cut();
}
ilSearchBaseGUI::delete ( )

Show deletion screen.

Implements ilAdministrationCommandHandling.

Definition at line 252 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->delete();
}
ilSearchBaseGUI::disableAdministrationPanel ( )

Disable administration panel.

Implements ilAdministrationCommandHandling.

Definition at line 339 of file class.ilSearchBaseGUI.php.

References $_SESSION.

{
$_SESSION["il_cont_admin_panel"] = false;
$this->ctrl->redirect($this);
}
ilSearchBaseGUI::enableAdministrationPanel ( )

Enable administration panel.

Implements ilAdministrationCommandHandling.

Definition at line 333 of file class.ilSearchBaseGUI.php.

References $_SESSION.

{
$_SESSION["il_cont_admin_panel"] = true;
$this->ctrl->redirect($this);
}
ilSearchBaseGUI::getSearchAreaForm ( )

Init standard search form.

Definition at line 182 of file class.ilSearchBaseGUI.php.

References $_POST, $ilCtrl, $lng, ilSearchSettings\getInstance(), and ilRepositorySelectorInputGUI\setSelectText().

Referenced by ilLuceneSearchGUI\executeCommand(), ilSearchGUI\executeCommand(), ilSearchGUI\showSearch(), ilLuceneSearchGUI\showSearchForm(), ilSearchGUI\storeRoot(), and ilLuceneSearchGUI\storeRoot().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setOpenTag(false);
$form->setCloseTag(false);
// term combination
$radg = new ilHiddenInputGUI('search_term_combination');
$radg->setValue(ilSearchSettings::getInstance()->getDefaultOperator());
$form->addItem($radg);
// search area
include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
$ti = new ilRepositorySelectorInputGUI($lng->txt("search_area"), "area");
$ti->setSelectText($lng->txt("search_select_search_area"));
$form->addItem($ti);
$ti->readFromSession();
// alex, 15.8.2012: Added the following lines to get the value
// from the main menu top right input search form
if (isset($_POST["root_id"]))
{
$ti->setValue($_POST["root_id"]);
$ti->writeToSession();
}
$form->setFormAction($ilCtrl->getFormAction($this,'performSearch'));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSearchBaseGUI::handleCommand (   $a_cmd)

Definition at line 216 of file class.ilSearchBaseGUI.php.

Referenced by ilLuceneAdvancedSearchGUI\executeCommand(), ilLuceneSearchGUI\executeCommand(), ilSearchGUI\executeCommand(), and ilAdvancedSearchGUI\executeCommand().

{
if(method_exists($this, $a_cmd))
{
$this->$a_cmd();
}
else
{
$a_cmd .= 'Object';
$this->$a_cmd();
}
}

+ Here is the caller graph for this function:

ilSearchBaseGUI::ilSearchBaseGUI ( )

Constructor public.

Definition at line 43 of file class.ilSearchBaseGUI.php.

References $ilCtrl, $ilias, $lng, and $tpl.

Referenced by ilAdvancedSearchGUI\ilAdvancedSearchGUI().

{
global $ilCtrl,$ilias,$lng,$tpl,$ilMainMenu;
$this->ilias =& $ilias;
$this->ctrl =& $ilCtrl;
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->lng->loadLanguageModule('search');
$ilMainMenu->setActive('search');
$this->settings =& new ilSearchSettings();
}

+ Here is the caller graph for this function:

ilSearchBaseGUI::initStandardSearchForm (   $a_mode)

Init standard search form.

$radg = new ilRadioGroupInputGUI($lng->txt("search_term_combination"), "combination"); $radg->setValue(($this->getCombination() == ilSearchBaseGUI::SEARCH_AND) ? "and" : "or"); $op1 = new ilRadioOption($lng->txt("search_any_word"), "or"); $radg->addOption($op1); $op2 = new ilRadioOption($lng->txt("search_all_words"), "and"); $radg->addOption($op2);

Definition at line 79 of file class.ilSearchBaseGUI.php.

References $data, $ilCtrl, $lng, ilSearchSettings\getInstance(), SEARCH_DETAILS, SEARCH_FAST, SEARCH_FORM_STANDARD, ilCheckboxInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), and ilRadioOption\setValue().

Referenced by ilSearchGUI\__construct(), ilLuceneSearchGUI\executeCommand(), and ilSearchGUI\showSearch().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$this->form->setOpenTag(false);
$this->form->setCloseTag(false);
// term combination
$radg = new ilHiddenInputGUI('search_term_combination');
$radg->setValue(ilSearchSettings::getInstance()->getDefaultOperator());
$this->form->addItem($radg);
// search area
/*
include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
$ti = new ilRepositorySelectorInputGUI($lng->txt("search_area"), "area");
$ti->setSelectText($lng->txt("search_select_search_area"));
$this->form->addItem($ti);
$ti->readFromSession();*/
// alex, 15.8.2012: Added the following lines to get the value
// from the main menu top right input search form
/* if (isset($_POST["root_id"]))
{
$ti->setValue($_POST["root_id"]);
$ti->writeToSession();
}*/
if(ilSearchSettings::getInstance()->isLuceneItemFilterEnabled())
{
if($a_mode == self::SEARCH_FORM_STANDARD)
{
// search type
$radg = new ilRadioGroupInputGUI($lng->txt("search_type"), "type");
$radg->setValue(
$this->getType() ==
);
$op1 = new ilRadioOption($lng->txt("search_fast_info"), ilSearchBaseGUI::SEARCH_FAST);
$radg->addOption($op1);
$op2 = new ilRadioOption($lng->txt("search_details_info"), ilSearchBaseGUI::SEARCH_DETAILS);
}
else
{
$op2 = new ilCheckboxInputGUI($this->lng->txt('search_filter_by_type'),'item_filter_enabled');
$op2->setValue(1);
// $op2->setChecked($this->getType() == ilSearchBaseGUI::SEARCH_DETAILS);
}
$cbgr = new ilCheckboxGroupInputGUI('','filter_type');
$cbgr->setUseValuesAsKeys(true);
$details = $this->getDetails();
$det = false;
foreach(ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions() as $type => $data)
{
$cb = new ilCheckboxOption($lng->txt($data['trans']), $type);
if ($details[$type])
{
$det = true;
}
$cbgr->addOption($cb);
}
$cbgr->setValue($details);
$op2->addSubItem($cbgr);
if($a_mode != self::SEARCH_FORM_STANDARD && $det)
{
$op2->setChecked(true);
}
{
$radg->addOption($op2);
$this->form->addItem($radg);
}
else
{
$this->form->addItem($op2);
}
}
$this->form->setFormAction($ilCtrl->getFormAction($this,'performSearch'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSearchBaseGUI::link ( )

Interface ilAdministrationCommandHandler.

Definition at line 292 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->link();
}
ilSearchBaseGUI::paste ( )

Paste.

Implements ilAdministrationCommandHandling.

Definition at line 299 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->paste();
}
ilSearchBaseGUI::performDelete ( )

Delete objects.

Implements ilAdministrationCommandHandling.

Definition at line 270 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->performDelete();
}
ilSearchBaseGUI::performPasteIntoMultipleObjects ( )

Perform paste into multiple objects.

Returns

Implements ilAdministrationCommandHandling.

Definition at line 320 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->performPasteIntoMultipleObjects();
}
ilSearchBaseGUI::prepareOutput ( )

Reimplemented in ilAdvancedSearchGUI, ilSearchGUI, ilLuceneAdvancedSearchGUI, and ilLuceneSearchGUI.

Definition at line 57 of file class.ilSearchBaseGUI.php.

References $lng, ilUtil\getImagePath(), and ilUtil\infoPanel().

{
global $ilLocator, $lng;
$this->tpl->getStandardTemplate();
// $ilLocator->addItem($this->lng->txt('search'),$this->ctrl->getLinkTarget($this));
// $this->tpl->setLocator();
//$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_src_b.gif"),
// $lng->txt("search"));
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_src_b.png"),
"");
$this->tpl->setTitle($lng->txt("search"));
}

+ Here is the call graph for this function:

ilSearchBaseGUI::removeFromDeskObject ( )

Remove from dektop.

Implements ilDesktopItemHandling.

Definition at line 242 of file class.ilSearchBaseGUI.php.

References ilDesktopItemGUI\removeFromDesktop().

{
include_once './Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
$this->showSavedResults();
}

+ Here is the call graph for this function:

ilSearchBaseGUI::showLinkIntoMultipleObjectsTree ( )

Target selection link.

Returns

Implements ilAdministrationCommandHandling.

Definition at line 306 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->showLinkIntoMultipleObjectsTree();
}
ilSearchBaseGUI::showMoveIntoObjectTree ( )

Target selection cut.

Returns

Implements ilAdministrationCommandHandling.

Definition at line 313 of file class.ilSearchBaseGUI.php.

{
include_once './Services/Administration/classes/class.ilAdministrationCommandGUI.php';
$admin = new ilAdministrationCommandGUI($this);
$admin->showMoveIntoObjectTree();
}

Field Documentation

ilSearchBaseGUI::$ctrl = null
protected

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

ilSearchBaseGUI::$ilias = null

Definition at line 35 of file class.ilSearchBaseGUI.php.

Referenced by ilSearchBaseGUI().

ilSearchBaseGUI::$settings = null

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

ilSearchBaseGUI::$tpl = null

Definition at line 37 of file class.ilSearchBaseGUI.php.

Referenced by addPager(), and ilSearchBaseGUI().

const ilSearchBaseGUI::SEARCH_AND = 'and'

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

const ilSearchBaseGUI::SEARCH_FAST = 1
const ilSearchBaseGUI::SEARCH_FORM_LUCENE = 1

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

Referenced by ilLuceneSearchGUI\executeCommand().

const ilSearchBaseGUI::SEARCH_FORM_STANDARD = 2
const ilSearchBaseGUI::SEARCH_OR = 'or'

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

Referenced by ilSearchGUI\getCombination().


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