18declare(strict_types=1);
67 $factory =
$DIC->ui()->factory();
69 $get_request =
$http->wrapper()->query();
70 $data_factory = new \ILIAS\Data\Factory();
71 $refinery_factory = new \ILIAS\Refinery\Factory($data_factory,
$DIC->language());
73 $example_uri = $data_factory->uri((
string)
$http->request()->getUri());
74 $base_url_builder =
new URLBuilder($example_uri);
75 [$node_id_url_builder, $node_id_parameter] = $base_url_builder->acquireParameter(
76 explode(
'\\', __NAMESPACE__),
79 [$process_form_url_builder, $process_form_parameter] = $base_url_builder->acquireParameter(
80 explode(
'\\', __NAMESPACE__),
87 if ($get_request->has($node_id_parameter->getName())) {
88 $parent_node_id = $get_request->retrieve(
89 $node_id_parameter->getName(),
90 $refinery_factory->kindlyTo()->string(),
93 $node_generator = $node_retrieval->getNodes(
94 $factory->input()->field()->node(),
95 $factory->symbol()->icon(),
101 foreach ($node_generator as $node) {
107 ->withHeader(
'Content-Type',
'text/html; charset=utf-8')
110 $http->sendResponse();
114 $input = $factory->input()->field()->treeMultiSelect(
116 "select multiple nodes",
117 "you can open the select input by clicking the button above.",
120 $form = $factory->input()->container()->form()->standard(
121 (
string) $process_form_url_builder->withParameter($process_form_parameter,
'1')->buildURI(),
126 if ($get_request->has($process_form_parameter->getName())) {
127 $form = $form->withRequest(
$http->request());
128 $data = $form->getData();
130 $data =
'No submitted data yet.';
133 return '<pre>' . print_r(
$data,
true) .
'</pre>' .
$renderer->render($form);
146 NodeFactory $node_factory,
147 IconFactory $icon_factory,
148 array $sync_node_id_whitelist = [],
149 ?
string $parent_id =
null
151 if (null !== $parent_id) {
156 yield $node_factory->branch([
'1'],
'branch 1',
null, ...$this->
getExampleNodeChildren($node_factory,
'1'));
157 yield $node_factory->branch([
'2'],
'branch 2',
null, ...$this->
getExampleNodeChildren($node_factory,
'2'));
158 yield $node_factory->leaf([
'3'],
'leaf 3');
162 NodeFactory $node_factory,
163 IconFactory $icon_factory,
166 foreach ($node_ids as $node_id) {
167 yield $node_factory->leaf([$node_id],
"dummy leaf node $node_id");
174 $node_factory->branch(
175 $this->getFullNodePath($parent_id,
"1"),
176 "branch $parent_id.1",
178 $node_factory->leaf($this->getFullNodePath($parent_id,
"1.1"),
"leaf $parent_id.1.1"),
179 $node_factory->leaf($this->getFullNodePath($parent_id,
"1.2"),
"leaf $parent_id.1.2"),
180 $node_factory->leaf($this->getFullNodePath($parent_id,
"1.3"),
"leaf $parent_id.1.3"),
182 $node_factory->branch(
183 $this->getFullNodePath($parent_id,
"2"),
184 "branch $parent_id.2",
186 $node_factory->leaf($this->getFullNodePath($parent_id,
"2.1"),
"leaf $parent_id.2.1"),
187 $node_factory->leaf($this->getFullNodePath($parent_id,
"2.2"),
"leaf $parent_id.2.2"),
188 $node_factory->leaf($this->getFullNodePath($parent_id,
"2.3"),
"leaf $parent_id.2.3"),
190 $node_factory->async(
191 $this->getAsyncNodeRenderUrl(
"$parent_id.3"),
192 $this->getFullNodePath($parent_id,
"3"),
193 "async branch $parent_id.3"
195 $node_factory->leaf($this->getFullNodePath($parent_id,
"4"),
"leaf $parent_id.4"),
202 $parts = explode(
".", $parent_id);
204 for ($index = 1, $count = count(
$parts); $index <= $count; $index++) {
205 $paths[] = implode(
".", array_slice(
$parts, 0, $index));
207 $paths[] =
"{$paths[$count - 1]}.$child_id";
213 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'))