ILIAS  release_7 Revision v7.30-3-g800a261c036
Simple.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5
7
11
15class 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}
An exception for terminatinating execution or to throw for unit testing.
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:18
getIcon()
Get the icon for this Node.
Definition: Simple.php:47
withLink(URI $link)
Create a new node object with an URI that will be added to the UI.
Definition: Simple.php:83
getAsyncLoading()
Should this node load its children asyncronously?
Definition: Simple.php:55
getAsyncURL()
Get URL for async loading.
Definition: Simple.php:73
__construct(string $label, Icon $icon=null, URI $link=null)
Definition: Simple.php:27
getLabel()
Get the label of this Node.
Definition: Simple.php:39
withAsyncURL(string $url)
Set URL for async loading.
Definition: Simple.php:63
A component is the most general form of an entity in the UI.
Definition: Component.php:14
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:10
getAsyncURL()
Get URL for async loading.
This describes a Tree Node.
Definition: Node.php:16
This describes a very basic Tree Node.
Definition: Simple.php:12
This describes a Tree Control.
Definition: Tree.php:14
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
$url