ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilRepositoryObjectSearchGUI Class Reference
+ Collaboration diagram for ilRepositoryObjectSearchGUI:

Public Member Functions

 __construct ($a_ref_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getLang ()
 Get language object. More...
 
 getCtrl ()
 Get ctrl. More...
 
 getRefId ()
 
 getObject ()
 
 getParentGUI ()
 get parent gui More...
 
 getParentCmd ()
 
 getResultTableInstance ()
 Get result table instance @global type $objDefinition. More...
 

Static Public Member Functions

static getSearchBlockHTML ($a_title)
 Get standar search block html. More...
 

Protected Member Functions

 performSearch ()
 Perform search lucene or direct search. More...
 

Private Attributes

 $lng = null
 
 $ctrl = null
 
 $ref_id = 0
 
 $object = null
 
 $parent_obj
 
 $parent_cmd
 

Detailed Description

Definition at line 15 of file class.ilRepositoryObjectSearchGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRepositoryObjectSearchGUI::__construct (   $a_ref_id,
  $a_parent_obj,
  $a_parent_cmd 
)

Constructor.

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

30 {
31 global $lng, $ilCtrl;
32
33 $this->ref_id = $a_ref_id;
34 $this->lng = $lng;
35
36 $this->ctrl = $ilCtrl;
37
38
39 include_once './Services/Object/classes/class.ilObjectFactory.php';
41 $this->object = $factory->getInstanceByRefId($this->getRefId(), false);
42
43 $this->parent_obj = $a_parent_obj;
44 $this->parent_cmd = $a_parent_cmd;
45 }
$factory
Definition: metadata.php:47
Class ilObjectFactory.
global $ilCtrl
Definition: ilias.php:18

References $factory, $ilCtrl, $lng, and getRefId().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilRepositoryObjectSearchGUI::executeCommand ( )

Execute command.

Definition at line 62 of file class.ilRepositoryObjectSearchGUI.php.

63 {
64 if (!$GLOBALS['ilAccess']->checkAccess('read', '', $this->getObject()->getRefId())) {
65 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
66 $this->getCtrl()->returnToParent($this->getParentGUI());
67 }
68
69 $next_class = $this->getCtrl()->getNextClass();
70 $cmd = $this->getCtrl()->getCmd();
71
72
73 switch ($next_class) {
74 default:
75 $this->$cmd();
76 break;
77 }
78 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $GLOBALS, getCtrl(), getObject(), getParentGUI(), getRefId(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getCtrl()

ilRepositoryObjectSearchGUI::getCtrl ( )

Get ctrl.

Returns
ilCtrl

Definition at line 93 of file class.ilRepositoryObjectSearchGUI.php.

References $ctrl.

Referenced by executeCommand(), and performSearch().

+ Here is the caller graph for this function:

◆ getLang()

ilRepositoryObjectSearchGUI::getLang ( )

Get language object.

Returns
ilLanguage

Definition at line 84 of file class.ilRepositoryObjectSearchGUI.php.

85 {
86 return $this->lng;
87 }

References $lng.

◆ getObject()

ilRepositoryObjectSearchGUI::getObject ( )
Returns
ilObject

Definition at line 108 of file class.ilRepositoryObjectSearchGUI.php.

References $object.

Referenced by executeCommand(), and getResultTableInstance().

+ Here is the caller graph for this function:

◆ getParentCmd()

ilRepositoryObjectSearchGUI::getParentCmd ( )
Returns
string

Definition at line 124 of file class.ilRepositoryObjectSearchGUI.php.

References $parent_cmd.

◆ getParentGUI()

ilRepositoryObjectSearchGUI::getParentGUI ( )

get parent gui

Definition at line 116 of file class.ilRepositoryObjectSearchGUI.php.

References $parent_obj.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getRefId()

ilRepositoryObjectSearchGUI::getRefId ( )

Definition at line 99 of file class.ilRepositoryObjectSearchGUI.php.

References $ref_id.

Referenced by __construct(), executeCommand(), getResultTableInstance(), and performSearch().

+ Here is the caller graph for this function:

◆ getResultTableInstance()

ilRepositoryObjectSearchGUI::getResultTableInstance ( )

Get result table instance @global type $objDefinition.

Returns
type

Definition at line 161 of file class.ilRepositoryObjectSearchGUI.php.

162 {
163 global $objDefinition;
164
165
166 $class = $objDefinition->getClassName($this->getObject()->getType());
167 $location = $objDefinition->getLocation($this->getObject()->getType());
168 $full_class = "ilObj" . $class . "SearchResultTableGUI";
169
170 if (include_once($location . "/class." . $full_class . ".php")) {
171 return new $full_class(
172 $this,
173 'performSearch',
174 $this->getRefId()
175 );
176 }
177 }
$location
Definition: buildRTE.php:44

References $location, getObject(), and getRefId().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSearchBlockHTML()

static ilRepositoryObjectSearchGUI::getSearchBlockHTML (   $a_title)
static

Get standar search block html.

Parameters
type$a_title
Returns
string

Definition at line 52 of file class.ilRepositoryObjectSearchGUI.php.

53 {
54 include_once './Services/Search/classes/class.ilRepositoryObjectSearchBlockGUI.php';
55 $block = new ilRepositoryObjectSearchBlockGUI($a_title);
56 return $block->getHTML();
57 }

Referenced by ilObjWikiGUI\renderSideBlock(), and ilObjForumGUI\setSideBlocks().

+ Here is the caller graph for this function:

◆ performSearch()

ilRepositoryObjectSearchGUI::performSearch ( )
protected

Perform search lucene or direct search.

Definition at line 132 of file class.ilRepositoryObjectSearchGUI.php.

133 {
134 include_once './Services/Search/classes/class.ilRepositoryObjectDetailSearch.php';
135
136 try {
138 $search->setQueryString(ilUtil::stripSlashes($_POST['search_term']));
139 $result = $search->performSearch();
140 } catch (Exception $e) {
141 ilUtil::sendFailure($e->getMessage(), true);
142 $this->getCtrl()->returnToParent($this);
143 return false;
144 }
145 // @todo: add a factory to allow overwriting of search result presentation
146 $result_table = $this->getResultTableInstance();
147 $result_table->setSearchTerm(ilUtil::stripSlashes($_POST['search_term']));
148 $result_table->setResults($result);
149
150 $result_table->init();
151 $result_table->parse();
152
153 $GLOBALS['tpl']->setContent($result_table->getHTML());
154 }
$result
$_POST["username"]
static _lookupObjId($a_id)
getResultTableInstance()
Get result table instance @global type $objDefinition.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $GLOBALS, $result, ilObject\_lookupObjId(), getCtrl(), getRefId(), getResultTableInstance(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilRepositoryObjectSearchGUI::$ctrl = null
private

Definition at line 18 of file class.ilRepositoryObjectSearchGUI.php.

Referenced by getCtrl().

◆ $lng

ilRepositoryObjectSearchGUI::$lng = null
private

Definition at line 17 of file class.ilRepositoryObjectSearchGUI.php.

Referenced by __construct(), and getLang().

◆ $object

ilRepositoryObjectSearchGUI::$object = null
private

Definition at line 20 of file class.ilRepositoryObjectSearchGUI.php.

Referenced by getObject().

◆ $parent_cmd

ilRepositoryObjectSearchGUI::$parent_cmd
private

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

Referenced by getParentCmd().

◆ $parent_obj

ilRepositoryObjectSearchGUI::$parent_obj
private

Definition at line 21 of file class.ilRepositoryObjectSearchGUI.php.

Referenced by getParentGUI().

◆ $ref_id

ilRepositoryObjectSearchGUI::$ref_id = 0
private

Definition at line 19 of file class.ilRepositoryObjectSearchGUI.php.

Referenced by getRefId().


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