18declare(strict_types=1);
65 $factory =
$DIC->ui()->factory();
67 $get_request =
$http->wrapper()->query();
68 $data_factory = new \ILIAS\Data\Factory();
69 $refinery_factory = new \ILIAS\Refinery\Factory($data_factory,
$DIC->language());
71 $example_uri = $data_factory->uri((
string)
$http->request()->getUri());
72 $base_url_builder =
new URLBuilder($example_uri);
73 [$node_id_url_builder, $node_id_parameter] = $base_url_builder->acquireParameter(
74 explode(
'\\', __NAMESPACE__),
77 [$process_form_url_builder, $process_form_parameter] = $base_url_builder->acquireParameter(
78 explode(
'\\', __NAMESPACE__),
85 if ($get_request->has($node_id_parameter->getName())) {
86 $parent_node_id = $get_request->retrieve(
87 $node_id_parameter->getName(),
88 $refinery_factory->kindlyTo()->string(),
91 $node_generator = $node_retrieval->getNodes(
92 $factory->input()->field()->node(),
93 $factory->symbol()->icon(),
99 foreach ($node_generator as $node) {
105 ->withHeader(
'Content-Type',
'text/html; charset=utf-8')
108 $http->sendResponse();
112 $input = $factory->input()->field()->treeSelect(
114 "select a single node",
115 "you can open the select input by clicking the button above.",
118 $form = $factory->input()->container()->form()->standard(
119 (
string) $process_form_url_builder->withParameter($process_form_parameter,
'1')->buildURI(),
124 if ($get_request->has($process_form_parameter->getName())) {
125 $form = $form->withRequest(
$http->request());
126 $data = $form->getData();
128 $data =
'No submitted data yet.';
131 return '<pre>' . print_r(
$data,
true) .
'</pre>' .
$renderer->render($form);
144 NodeFactory $node_factory,
145 IconFactory $icon_factory,
146 array $sync_node_id_whitelist = [],
147 ?
string $parent_id =
null
149 if (null !== $parent_id) {
154 yield $node_factory->branch([
'1'],
'branch 1',
null, ...$this->
getExampleNodeChildren($node_factory,
'1'));
155 yield $node_factory->branch([
'2'],
'branch 2',
null, ...$this->
getExampleNodeChildren($node_factory,
'2'));
156 yield $node_factory->leaf([
'3'],
'leaf 3');
160 NodeFactory $node_factory,
161 IconFactory $icon_factory,
164 foreach ($node_ids as $node_id) {
165 yield $node_factory->leaf([$node_id],
"dummy leaf node $node_id");
172 $node_factory->branch(
173 $this->getFullNodePath($parent_id,
"1"),
174 "branch $parent_id.1",
176 $node_factory->leaf($this->getFullNodePath($parent_id,
"1.1"),
"leaf $parent_id.1.1"),
177 $node_factory->leaf($this->getFullNodePath($parent_id,
"1.2"),
"leaf $parent_id.1.2"),
178 $node_factory->leaf($this->getFullNodePath($parent_id,
"1.3"),
"leaf $parent_id.1.3"),
180 $node_factory->branch(
181 $this->getFullNodePath($parent_id,
"2"),
182 "branch $parent_id.2",
184 $node_factory->leaf($this->getFullNodePath($parent_id,
"2.1"),
"leaf $parent_id.2.1"),
185 $node_factory->leaf($this->getFullNodePath($parent_id,
"2.2"),
"leaf $parent_id.2.2"),
186 $node_factory->leaf($this->getFullNodePath($parent_id,
"2.3"),
"leaf $parent_id.2.3"),
188 $node_factory->async(
189 $this->getAsyncNodeRenderUrl(
"$parent_id.3"),
190 $this->getFullNodePath($parent_id,
"3"),
191 "async branch $parent_id.3"
193 $node_factory->leaf($this->getFullNodePath($parent_id,
"4"),
"leaf $parent_id.4"),
200 $parts = explode(
".", $parent_id);
202 for ($index = 1, $count = count(
$parts); $index <= $count; $index++) {
203 $paths[] = implode(
".", array_slice(
$parts, 0, $index));
205 $paths[] =
"{$paths[$count - 1]}.$child_id";
211 return $this->builder->
withParameter($this->node_id_parameter, (
string) $node_id)->buildURI();
The scope of this class is split ilias-conform URI's into components.
withParameter(string $key, $value)
Get URI with modified parameters.
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static ofString(string $string)
Creates a new stream with an initial value.
This is how a factory for icons looks like.
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
if(!file_exists('../ilias.ini.php'))