ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Simple.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
30class Simple extends Node implements ISimple
31{
32 protected string $asynch_url = '';
33 protected ?Icon $icon;
34
35 public function __construct(
36 string $label,
37 ?Icon $icon = null,
38 ?URI $link = null
39 ) {
40 parent::__construct($label, $link);
41 $this->icon = $icon;
42 }
43
47 public function getLabel(): string
48 {
49 return $this->label;
50 }
51
55 public function getIcon(): ?Icon
56 {
57 return $this->icon;
58 }
59
63 public function getAsyncLoading(): bool
64 {
65 return $this->getAsyncURL() != '';
66 }
67
71 public function withAsyncURL(string $url): ISimple
72 {
73 $clone = clone $this;
74 $clone->asynch_url = $url;
75 return $clone;
76 }
77
81 public function getAsyncURL(): string
82 {
83 return $this->asynch_url;
84 }
85
89 public function withLink(URI $link): \ILIAS\UI\Component\Tree\Node\Node
90 {
91 $clone = clone $this;
92 $clone->link = $link;
93 return $clone;
94 }
95}
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
getIcon()
Get the icon for this Node.
Definition: Simple.php:55
withLink(URI $link)
Create a new node object with an URI that will be added to the UI.
Definition: Simple.php:89
getAsyncLoading()
Should this node load its children asynchronously?
Definition: Simple.php:63
__construct(string $label, ?Icon $icon=null, ?URI $link=null)
Definition: Simple.php:35
getAsyncURL()
Get URL for async loading.
Definition: Simple.php:81
getLabel()
Get the label of this Node.
Definition: Simple.php:47
withAsyncURL(string $url)
Set URL for async loading.
Definition: Simple.php:71
Definition: UI.php:24
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:29
getAsyncURL()
Get URL for async loading.
This describes a Tree Node.
Definition: Node.php:31
This describes a very basic Tree Node.
Definition: Simple.php:29
This describes a Tree Control.
Definition: Tree.php:29
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$url
Definition: shib_logout.php:68