ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 34 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 53 of file class.ilRepositoryObjectSearchGUI.php.

54 {
55 global $DIC;
56
57 $this->lng = $DIC->language();
58 $this->ctrl = $DIC->ctrl();
59 $this->access = $DIC->access();
60 $this->tpl = $DIC->ui()->mainTemplate();
61 $this->obj_definition = $DIC['objDefinition'];
62
63 $this->ref_id = $a_ref_id;
64 $this->http = $DIC->http();
65 $this->refinery = $DIC->refinery();
66
67 try {
68 $repo_object = ilObjectFactory::getInstanceByRefId($this->getRefId());
69 if ($repo_object instanceof ilObject) {
70 $this->object = $repo_object;
71 }
73 throw $e;
74 }
75 $this->parent_obj = $a_parent_obj;
76 $this->parent_cmd = $a_parent_cmd;
77 }
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilRepositoryObjectSearchGUI::executeCommand ( )

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

85 : void
86 {
87 if (!$this->access->checkAccess('read', '', $this->getObject()->getRefId())) {
88 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
89 $this->getCtrl()->returnToParent($this->getParentGUI());
90 }
91
92 $next_class = $this->getCtrl()->getNextClass();
93 $cmd = $this->getCtrl()->getCmd();
94
95
96 switch ($next_class) {
97 default:
98 $this->$cmd();
99 break;
100 }
101 }

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

+ Here is the call graph for this function:

◆ getCtrl()

ilRepositoryObjectSearchGUI::getCtrl ( )

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

108 : ilCtrl
109 {
110 return $this->ctrl;
111 }
Class ilCtrl provides processing control methods.

References $ctrl.

Referenced by executeCommand(), and performSearch().

+ Here is the caller graph for this function:

◆ getLang()

ilRepositoryObjectSearchGUI::getLang ( )

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

103 : ilLanguage
104 {
105 return $this->lng;
106 }
language handling

References $lng.

◆ getObject()

ilRepositoryObjectSearchGUI::getObject ( )

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

References $object.

Referenced by getResultTableInstance().

+ Here is the caller graph for this function:

◆ getParentCmd()

ilRepositoryObjectSearchGUI::getParentCmd ( )

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

129 : string
130 {
131 return $this->parent_cmd;
132 }

References $parent_cmd.

◆ getParentGUI()

ilRepositoryObjectSearchGUI::getParentGUI ( )

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

124 : object
125 {
126 return $this->parent_obj;
127 }

References $parent_obj.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getRefId()

ilRepositoryObjectSearchGUI::getRefId ( )

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

114 : int
115 {
116 return $this->ref_id;
117 }

References $ref_id.

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

+ Here is the caller graph for this function:

◆ getResultTableInstance()

ilRepositoryObjectSearchGUI::getResultTableInstance ( )

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

168 : ?object
169 {
170 $class = $this->obj_definition->getClassName($this->getObject()->getType());
171 $full_class = "ilObj" . $class . "SearchResultTableGUI";
172
173 if (class_exists($full_class)) {
174 return new $full_class(
175 $this,
176 'performSearch',
177 $this->getRefId()
178 );
179 }
180 return null;
181 }

References 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 ( string  $a_title)
static

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

79 : string
80 {
81 $block = new ilRepositoryObjectSearchBlockGUI($a_title);
82 return $block->getHTML();
83 }

Referenced by ilObjForumGUI\setSideBlocks().

+ Here is the caller graph for this function:

◆ performSearch()

ilRepositoryObjectSearchGUI::performSearch ( )
protected
Exceptions
Exception

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

137 : bool
138 {
139 try {
141
142 $search_term = '';
143 if ($this->http->wrapper()->post()->has('search_term')) {
144 $search_term = $this->http->wrapper()->post()->retrieve(
145 'search_term',
146 $this->refinery->kindlyTo()->string()
147 );
148 }
149 $search->setQueryString($search_term);
150 $result = $search->performSearch();
151 } catch (Exception $e) {
152 $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
153 $this->getCtrl()->returnToParent($this);
154 return false;
155 }
156 // @todo: add a factory to allow overwriting of search result presentation
157 $result_table = $this->getResultTableInstance();
158 $result_table->setSearchTerm($search_term);
159 $result_table->setResults($result);
160
161 $result_table->init();
162 $result_table->parse();
163
164 $this->tpl->setContent($result_table->getHTML());
165 return true;
166 }
static _lookupObjId(int $ref_id)

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

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccess ilRepositoryObjectSearchGUI::$access
protected

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

◆ $ctrl

ilCtrl ilRepositoryObjectSearchGUI::$ctrl
protected

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

Referenced by getCtrl().

◆ $http

GlobalHttpState ilRepositoryObjectSearchGUI::$http
protected

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

◆ $lng

ilLanguage ilRepositoryObjectSearchGUI::$lng
protected

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

Referenced by getLang().

◆ $obj_definition

ilObjectDefinition ilRepositoryObjectSearchGUI::$obj_definition
protected

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

◆ $object

ilObject ilRepositoryObjectSearchGUI::$object
private

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

Referenced by getObject().

◆ $parent_cmd

string ilRepositoryObjectSearchGUI::$parent_cmd
private

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

Referenced by getParentCmd().

◆ $parent_obj

object ilRepositoryObjectSearchGUI::$parent_obj
private

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

Referenced by getParentGUI().

◆ $ref_id

int ilRepositoryObjectSearchGUI::$ref_id
private

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

Referenced by getRefId().

◆ $refinery

Factory ilRepositoryObjectSearchGUI::$refinery
protected

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

◆ $tpl

ilGlobalTemplateInterface ilRepositoryObjectSearchGUI::$tpl
protected

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


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