ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 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.

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

30  {
31  global $DIC;
32 
33  $lng = $DIC['lng'];
34  $ilCtrl = $DIC['ilCtrl'];
35 
36  $this->ref_id = $a_ref_id;
37  $this->lng = $lng;
38 
39  $this->ctrl = $ilCtrl;
40 
41 
42  include_once './Services/Object/classes/class.ilObjectFactory.php';
43  $factory = new ilObjectFactory();
44  $this->object = $factory->getInstanceByRefId($this->getRefId(), false);
45 
46  $this->parent_obj = $a_parent_obj;
47  $this->parent_cmd = $a_parent_cmd;
48  }
Class ilObjectFactory.
global $DIC
Definition: saml.php:7
$factory
Definition: metadata.php:43
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilRepositoryObjectSearchGUI::executeCommand ( )

Execute command.

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

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

66  {
67  if (!$GLOBALS['DIC']['ilAccess']->checkAccess('read', '', $this->getObject()->getRefId())) {
68  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
69  $this->getCtrl()->returnToParent($this->getParentGUI());
70  }
71 
72  $next_class = $this->getCtrl()->getNextClass();
73  $cmd = $this->getCtrl()->getCmd();
74 
75 
76  switch ($next_class) {
77  default:
78  $this->$cmd();
79  break;
80  }
81  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ getCtrl()

ilRepositoryObjectSearchGUI::getCtrl ( )

Get ctrl.

Returns
ilCtrl

Definition at line 96 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 87 of file class.ilRepositoryObjectSearchGUI.php.

References $lng.

◆ getObject()

ilRepositoryObjectSearchGUI::getObject ( )
Returns
ilObject

Definition at line 111 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 127 of file class.ilRepositoryObjectSearchGUI.php.

References $parent_cmd.

◆ getParentGUI()

ilRepositoryObjectSearchGUI::getParentGUI ( )

get parent gui

Definition at line 119 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 102 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 type $objDefinition.

Returns
type

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

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

Referenced by performSearch().

165  {
166  global $DIC;
167 
168  $objDefinition = $DIC['objDefinition'];
169 
170 
171  $class = $objDefinition->getClassName($this->getObject()->getType());
172  $location = $objDefinition->getLocation($this->getObject()->getType());
173  $full_class = "ilObj" . $class . "SearchResultTableGUI";
174 
175  if (include_once($location . "/class." . $full_class . ".php")) {
176  return new $full_class(
177  $this,
178  'performSearch',
179  $this->getRefId()
180  );
181  }
182  }
global $DIC
Definition: saml.php:7
$location
Definition: buildRTE.php:44
+ 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 55 of file class.ilRepositoryObjectSearchGUI.php.

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

56  {
57  include_once './Services/Search/classes/class.ilRepositoryObjectSearchBlockGUI.php';
58  $block = new ilRepositoryObjectSearchBlockGUI($a_title);
59  return $block->getHTML();
60  }
+ Here is the caller graph for this function:

◆ performSearch()

ilRepositoryObjectSearchGUI::performSearch ( )
protected

Perform search lucene or direct search.

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

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

136  {
137  include_once './Services/Search/classes/class.ilRepositoryObjectDetailSearch.php';
138 
139  try {
141  $search->setQueryString(ilUtil::stripSlashes($_POST['search_term']));
142  $result = $search->performSearch();
143  } catch (Exception $e) {
144  ilUtil::sendFailure($e->getMessage(), true);
145  $this->getCtrl()->returnToParent($this);
146  return false;
147  }
148  // @todo: add a factory to allow overwriting of search result presentation
149  $result_table = $this->getResultTableInstance();
150  $result_table->setSearchTerm(ilUtil::stripSlashes($_POST['search_term']));
151  $result_table->setResults($result);
152 
153  $result_table->init();
154  $result_table->parse();
155 
156  $GLOBALS['DIC']['tpl']->setContent($result_table->getHTML());
157  }
$result
static _lookupObjId($a_id)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getResultTableInstance()
Get result table instance type $objDefinition.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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: