ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Simple.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
4 /* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5 
7 
11 
15 class Simple extends Node implements ISimple
16 {
20  protected $asynch_url = '';
21 
25  protected $icon;
26 
27  public function __construct(
28  string $label,
29  Icon $icon = null,
30  URI $link = null
31  ) {
32  parent::__construct($label, $link);
33  $this->icon = $icon;
34  }
35 
39  public function getLabel() : string
40  {
41  return $this->label;
42  }
43 
47  public function getIcon() : ?\ILIAS\UI\Component\Symbol\Icon\Icon
48  {
49  return $this->icon;
50  }
51 
55  public function getAsyncLoading() : bool
56  {
57  return $this->getAsyncURL() != '';
58  }
59 
63  public function withAsyncURL(string $url) : ISimple
64  {
65  $clone = clone $this;
66  $clone->asynch_url = $url;
67  return $clone;
68  }
69 
73  public function getAsyncURL() : string
74  {
75  return $this->asynch_url;
76  }
77 
83  public function withLink(URI $link) : \ILIAS\UI\Component\Tree\Node\Node
84  {
85  $clone = clone $this;
86  $clone->link = $link;
87  return $clone;
88  }
89 }
withLink(URI $link)
Create a new node object with an URI that will be added to the UI.
Definition: Simple.php:83
Class Factory.
withAsyncURL(string $url)
Set URL for async loading.
Definition: Simple.php:63
getAsyncLoading()
Should this node load its children asyncronously?
Definition: Simple.php:55
Class ChatMainBarProvider .
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:9
This describes a Tree Node.
Definition: Node.php:15
getAsyncURL()
Get URL for async loading.
Definition: Simple.php:73
getIcon()
Get the icon for this Node.
Definition: Simple.php:47
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:17
getAsyncURL()
Get URL for async loading.
This describes a very basic Tree Node.
Definition: Simple.php:11
This describes a Tree Control.
Definition: Tree.php:13
__construct(Container $dic, ilPlugin $plugin)
getLabel()
Get the label of this Node.
Definition: Simple.php:39
$url
__construct(string $label, Icon $icon=null, URI $link=null)
Definition: Simple.php:27