ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Simple.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
23 use ILIAS\Data\URI;
26 
30 class 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 }
withLink(URI $link)
Create a new node object with an URI that will be added to the UI.
Definition: Simple.php:89
Class Factory.
withAsyncURL(string $url)
Set URL for async loading.
Definition: Simple.php:71
getAsyncLoading()
Should this node load its children asynchronously?
Definition: Simple.php:63
Class ChatMainBarProvider .
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes a Tree Node.
Definition: Node.php:30
getAsyncURL()
Get URL for async loading.
Definition: Simple.php:81
getIcon()
Get the icon for this Node.
Definition: Simple.php:55
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bylined.php:21
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:34
getAsyncURL()
Get URL for async loading.
This describes a very basic Tree Node.
Definition: Simple.php:28
This describes a Tree Control.
Definition: Tree.php:28
__construct(Container $dic, ilPlugin $plugin)
getLabel()
Get the label of this Node.
Definition: Simple.php:47
$url
__construct(string $label, Icon $icon=null, URI $link=null)
Definition: Simple.php:35