ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $ilCtrl, $lng, and getRefId().

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';
40  $factory = new ilObjectFactory();
41  $this->object = $factory->getInstanceByRefId($this->getRefId(),FALSE);
42 
43  $this->parent_obj = $a_parent_obj;
44  $this->parent_cmd = $a_parent_cmd;
45  }
Class ilObjectFactory.
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 62 of file class.ilRepositoryObjectSearchGUI.php.

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

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

◆ getCtrl()

ilRepositoryObjectSearchGUI::getCtrl ( )

Get ctrl.

Returns
ilCtrl

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

References $lng.

◆ getObject()

ilRepositoryObjectSearchGUI::getObject ( )
Returns
ilObject

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

References $parent_cmd.

◆ getParentGUI()

ilRepositoryObjectSearchGUI::getParentGUI ( )

get parent gui

Definition at line 118 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 101 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 166 of file class.ilRepositoryObjectSearchGUI.php.

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

Referenced by performSearch().

167  {
168  global $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  {
177  return new $full_class(
178  $this,
179  'performSearch',
180  $this->getRefId()
181  );
182  }
183 
184  }
$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 52 of file class.ilRepositoryObjectSearchGUI.php.

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

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

◆ performSearch()

ilRepositoryObjectSearchGUI::performSearch ( )
protected

Perform search lucene or direct search.

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

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

135  {
136  include_once './Services/Search/classes/class.ilRepositoryObjectDetailSearch.php';
137 
138  try
139  {
141  $search->setQueryString(ilUtil::stripSlashes($_POST['search_term']));
142  $result = $search->performSearch();
143  }
144  catch(Exception $e)
145  {
146  ilUtil::sendFailure($e->getMessage(),TRUE);
147  $this->getCtrl()->returnToParent($this);
148  return FALSE;
149  }
150  // @todo: add a factory to allow overwriting of search result presentation
151  $result_table = $this->getResultTableInstance();
152  $result_table->setSearchTerm(ilUtil::stripSlashes($_POST['search_term']));
153  $result_table->setResults($result);
154 
155  $result_table->init();
156  $result_table->parse();
157 
158  $GLOBALS['tpl']->setContent($result_table->getHTML());
159  }
$result
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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"]
+ 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: