ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilRepositoryObjectSearchGUI Class Reference
+ Collaboration diagram for ilRepositoryObjectSearchGUI:

Public Member Functions

 __construct (int $a_ref_id, object $a_parent_obj, string $a_parent_cmd)
 
 executeCommand ()
 
 getLang ()
 
 getCtrl ()
 
 getRefId ()
 
 getObject ()
 
 getParentGUI ()
 
 getParentCmd ()
 
 getResultTableInstance ()
 

Static Public Member Functions

static getSearchBlockHTML (string $a_title)
 

Protected Member Functions

 performSearch ()
 

Protected Attributes

ilLanguage $lng
 
ilCtrl $ctrl
 
ilAccess $access
 
ilGlobalTemplateInterface $tpl
 
ilObjectDefinition $obj_definition
 
GlobalHttpState $http
 
Factory $refinery
 

Private Attributes

int $ref_id
 
ilObject $object
 
object $parent_obj
 
string $parent_cmd
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilRepositoryObjectSearchGUI::__construct ( int  $a_ref_id,
object  $a_parent_obj,
string  $a_parent_cmd 
)

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

References $DIC, Vendor\Package\$e, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByRefId(), getRefId(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

39  {
40  global $DIC;
41 
42  $this->lng = $DIC->language();
43  $this->ctrl = $DIC->ctrl();
44  $this->access = $DIC->access();
45  $this->tpl = $DIC->ui()->mainTemplate();
46  $this->obj_definition = $DIC['objDefinition'];
47 
48  $this->ref_id = $a_ref_id;
49  $this->http = $DIC->http();
50  $this->refinery = $DIC->refinery();
51 
52  try {
53  $repo_object = ilObjectFactory::getInstanceByRefId($this->getRefId());
54  if ($repo_object instanceof ilObject) {
55  $this->object = $repo_object;
56  }
57  } catch (ilObjectNotFoundException $e) {
58  throw $e;
59  }
60  $this->parent_obj = $a_parent_obj;
61  $this->parent_cmd = $a_parent_cmd;
62  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilRepositoryObjectSearchGUI::executeCommand ( )

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

References ILIAS\Repository\access(), getCtrl(), getParentGUI(), and ILIAS\Repository\lng().

70  : void
71  {
72  if (!$this->access->checkAccess('read', '', $this->getObject()->getRefId())) {
73  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
74  $this->getCtrl()->returnToParent($this->getParentGUI());
75  }
76 
77  $next_class = $this->getCtrl()->getNextClass();
78  $cmd = $this->getCtrl()->getCmd();
79 
80 
81  switch ($next_class) {
82  default:
83  $this->$cmd();
84  break;
85  }
86  }
+ Here is the call graph for this function:

◆ getCtrl()

ilRepositoryObjectSearchGUI::getCtrl ( )

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 ( )

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

References $lng.

◆ getObject()

ilRepositoryObjectSearchGUI::getObject ( )

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

References $object.

Referenced by getResultTableInstance().

104  : ilObject
105  {
106  return $this->object;
107  }
+ Here is the caller graph for this function:

◆ getParentCmd()

ilRepositoryObjectSearchGUI::getParentCmd ( )

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

References $parent_cmd.

114  : string
115  {
116  return $this->parent_cmd;
117  }

◆ getParentGUI()

ilRepositoryObjectSearchGUI::getParentGUI ( )

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

References $parent_obj.

Referenced by executeCommand().

109  : object
110  {
111  return $this->parent_obj;
112  }
+ 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(), getResultTableInstance(), and performSearch().

99  : int
100  {
101  return $this->ref_id;
102  }
+ Here is the caller graph for this function:

◆ getResultTableInstance()

ilRepositoryObjectSearchGUI::getResultTableInstance ( )

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

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

Referenced by performSearch().

153  : ?object
154  {
155  $class = $this->obj_definition->getClassName($this->getObject()->getType());
156  $location = $this->obj_definition->getLocation($this->getObject()->getType());
157  $full_class = "ilObj" . $class . "SearchResultTableGUI";
158 
159  if (include_once($location . "/class." . $full_class . ".php")) {
160  return new $full_class(
161  $this,
162  'performSearch',
163  $this->getRefId()
164  );
165  }
166  return null;
167  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSearchBlockHTML()

static ilRepositoryObjectSearchGUI::getSearchBlockHTML ( string  $a_title)
static

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

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

64  : string
65  {
66  $block = new ilRepositoryObjectSearchBlockGUI($a_title);
67  return $block->getHTML();
68  }
+ Here is the caller graph for this function:

◆ performSearch()

ilRepositoryObjectSearchGUI::performSearch ( )
protected
Exceptions
Exception

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

References Vendor\Package\$e, ilObject\_lookupObjId(), getCtrl(), getRefId(), getResultTableInstance(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

122  : bool
123  {
124  try {
126 
127  $search_term = '';
128  if ($this->http->wrapper()->post()->has('search_term')) {
129  $search_term = $this->http->wrapper()->post()->retrieve(
130  'search_term',
131  $this->refinery->kindlyTo()->string()
132  );
133  }
134  $search->setQueryString($search_term);
135  $result = $search->performSearch();
136  } catch (Exception $e) {
137  $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
138  $this->getCtrl()->returnToParent($this);
139  return false;
140  }
141  // @todo: add a factory to allow overwriting of search result presentation
142  $result_table = $this->getResultTableInstance();
143  $result_table->setSearchTerm($search_term);
144  $result_table->setResults($result);
145 
146  $result_table->init();
147  $result_table->parse();
148 
149  $this->tpl->setContent($result_table->getHTML());
150  return true;
151  }
static _lookupObjId(int $ref_id)
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccess ilRepositoryObjectSearchGUI::$access
protected

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

◆ $ctrl

ilCtrl ilRepositoryObjectSearchGUI::$ctrl
protected

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

Referenced by getCtrl().

◆ $http

GlobalHttpState ilRepositoryObjectSearchGUI::$http
protected

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

◆ $lng

ilLanguage ilRepositoryObjectSearchGUI::$lng
protected

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

Referenced by getLang().

◆ $obj_definition

ilObjectDefinition ilRepositoryObjectSearchGUI::$obj_definition
protected

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

◆ $object

ilObject ilRepositoryObjectSearchGUI::$object
private

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

Referenced by getObject().

◆ $parent_cmd

string ilRepositoryObjectSearchGUI::$parent_cmd
private

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

Referenced by getParentCmd().

◆ $parent_obj

object ilRepositoryObjectSearchGUI::$parent_obj
private

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

Referenced by getParentGUI().

◆ $ref_id

int ilRepositoryObjectSearchGUI::$ref_id
private

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

Referenced by getRefId().

◆ $refinery

Factory ilRepositoryObjectSearchGUI::$refinery
protected

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

◆ $tpl

ilGlobalTemplateInterface ilRepositoryObjectSearchGUI::$tpl
protected

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


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