ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
NodeRetrievalGUI Class Reference
+ Inheritance diagram for NodeRetrievalGUI:
+ Collaboration diagram for NodeRetrievalGUI:

Public Member Functions

 executeCommand ()
 
 getNodeRetrieval ()
 

Protected Member Functions

 renderAsyncNodeChildren (int $parent_node_id)
 
 sendHtmlResponse (string $html)
 

Protected Attributes

const string PARENT_NODE_ID_PARAMETER = 'parent_node_id'
 
const int MAX_BRANCH_NODE_DEPTH = 2
 
UINodeRetrieval $node_retrieval
 
URLBuilderToken $async_node_id_parameter
 
Factory $ui_factory
 
Renderer $renderer
 
RequestWrapper $get_request
 
GlobalHttpState $http
 
ILIAS Refinery Factory $refinery
 
ilObjMainMenuAccess $access
 
ilCtrlInterface $ctrl
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 34 of file NodeRetrievalGUI.php.

Member Function Documentation

◆ executeCommand()

NodeRetrievalGUI::executeCommand ( )

Definition at line 98 of file NodeRetrievalGUI.php.

98 : void
99 {
100 if (!$this->ctrl->isAsynch()) {
101 throw new \RuntimeException(self::class . ' must be called asynchronously.');
102 }
103 if ($this->ctrl->getNextClass($this)) {
104 throw new \LogicException(self::class . ' must be the only command class.');
105 }
106
107 if (!$this->get_request->has($this->async_node_id_parameter->getName())) {
108 $this->sendHtmlResponse('');
109 return;
110 }
111 $parent_node_id = (int) $this->get_request->retrieve(
112 $this->async_node_id_parameter->getName(),
113 $this->refinery->kindlyTo()->int(),
114 );
115 $this->renderAsyncNodeChildren($parent_node_id);
116 }
renderAsyncNodeChildren(int $parent_node_id)
sendHtmlResponse(string $html)

References ILIAS\Repository\ctrl(), ILIAS\Repository\int(), ILIAS\Repository\refinery(), renderAsyncNodeChildren(), and sendHtmlResponse().

+ Here is the call graph for this function:

◆ getNodeRetrieval()

NodeRetrievalGUI::getNodeRetrieval ( )

Definition at line 118 of file NodeRetrievalGUI.php.

118 : UINodeRetrieval
119 {
121 }
UINodeRetrieval $node_retrieval

References $node_retrieval.

◆ renderAsyncNodeChildren()

NodeRetrievalGUI::renderAsyncNodeChildren ( int  $parent_node_id)
protected

Definition at line 123 of file NodeRetrievalGUI.php.

123 : void
124 {
125 $child_node_iterator = $this->node_retrieval->getNodes(
126 $this->ui_factory->input()->field()->node(),
127 $this->ui_factory->symbol()->icon(),
128 (string) $parent_node_id,
129 );
130
131 $html = '';
132 foreach ($child_node_iterator as $node) {
133 $html .= $this->renderer->renderAsync($node);
134 }
135 $this->sendHtmlResponse($html);
136 }
renderer()

References renderer(), and sendHtmlResponse().

Referenced by executeCommand().

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

◆ sendHtmlResponse()

NodeRetrievalGUI::sendHtmlResponse ( string  $html)
protected

Definition at line 138 of file NodeRetrievalGUI.php.

138 : void
139 {
140 $this->http->saveResponse(
141 $this->http->response()
142 ->withHeader('Content-Type', 'text/html; charset=utf-8')
143 ->withBody(Streams::ofString($html))
144 );
145 $this->http->sendResponse();
146 $this->http->close();
147 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\FileDelivery\http().

Referenced by executeCommand(), and renderAsyncNodeChildren().

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

Field Documentation

◆ $access

ilObjMainMenuAccess NodeRetrievalGUI::$access
protected

Definition at line 46 of file NodeRetrievalGUI.php.

◆ $async_node_id_parameter

URLBuilderToken NodeRetrievalGUI::$async_node_id_parameter
protected

Definition at line 40 of file NodeRetrievalGUI.php.

◆ $ctrl

ilCtrlInterface NodeRetrievalGUI::$ctrl
protected

Definition at line 47 of file NodeRetrievalGUI.php.

◆ $get_request

RequestWrapper NodeRetrievalGUI::$get_request
protected

Definition at line 43 of file NodeRetrievalGUI.php.

◆ $http

GlobalHttpState NodeRetrievalGUI::$http
protected

Definition at line 44 of file NodeRetrievalGUI.php.

◆ $node_retrieval

UINodeRetrieval NodeRetrievalGUI::$node_retrieval
protected

Definition at line 39 of file NodeRetrievalGUI.php.

Referenced by getNodeRetrieval().

◆ $refinery

ILIAS Refinery Factory NodeRetrievalGUI::$refinery
protected

Definition at line 45 of file NodeRetrievalGUI.php.

◆ $renderer

Renderer NodeRetrievalGUI::$renderer
protected

Definition at line 42 of file NodeRetrievalGUI.php.

◆ $ui_factory

Factory NodeRetrievalGUI::$ui_factory
protected

Definition at line 41 of file NodeRetrievalGUI.php.

◆ MAX_BRANCH_NODE_DEPTH

const int NodeRetrievalGUI::MAX_BRANCH_NODE_DEPTH = 2
protected

Definition at line 37 of file NodeRetrievalGUI.php.

◆ PARENT_NODE_ID_PARAMETER

const string NodeRetrievalGUI::PARENT_NODE_ID_PARAMETER = 'parent_node_id'
protected

Definition at line 36 of file NodeRetrievalGUI.php.


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