19declare(strict_types=1);
24use ILIAS\GlobalScreen\Collector\Renderer\DecoratorApplierTrait;
25use ILIAS\GlobalScreen\Collector\Renderer\isSupportedTrait;
49 use DecoratorApplierTrait;
51 protected \ilLanguage
$lng;
62 $this->ui_factory =
$DIC->ui()->factory();
63 $this->ui_renderer =
$DIC->ui()->renderer();
64 $this->
lng = $DIC->language();
69 $component = $this->applyComponentDecorator(
76 return $this->applyTopics($component, $item);
93 $content = $this->ui_factory->legacy()->content(
'...');
94 $name = $item instanceof
hasTitle ? $item->getTitle() :
"-";
95 $slate = $this->ui_factory->mainControls()->slate()->legacy(
116 if ($item instanceof
hasSymbol && $item->hasSymbol()) {
117 $c = $item->getSymbolDecorator();
119 return $this->applySymbolDecorator($item->getSymbol(), $item);
122 return $item->getSymbol();
125 if (function_exists(
'mb_substr')) {
126 $abbr = strtoupper(mb_substr($item->getTitle(), 0, 1));
128 $abbr = strtoupper(substr($item->getTitle(), 0, 1));
131 $abbr = strtoupper(substr(uniqid(
'',
true), -1));
134 return $this->ui_factory->symbol()
142 ->withAbbreviation($abbr);
151 $uri_string = trim($uri_string,
" ");
153 if (str_starts_with($uri_string,
'http')) {
155 if ($checker($uri_string)) {
156 return new URI($uri_string);
158 return new URI(rtrim(ILIAS_HTTP_PATH,
"/") .
"/" . ltrim(
$_SERVER[
'REQUEST_URI'] ??
'',
"./"));
161 return new URI(rtrim(ILIAS_HTTP_PATH,
"/") .
"/" . ltrim($uri_string,
"./"));
166 return static function (
string $v):
bool {
170 }
catch (Throwable) {
179 return static function (
string $v):
string {
180 if (str_starts_with($v,
'./')) {
181 $v = ltrim($v,
'./');
182 return ILIAS_HTTP_PATH .
'/' . $v;
Builds a Color from either hex- or rgb values.
The scope of this class is split ilias-conform URI's into components.
supportsAsyncContent(isItem $item)
MakeSlateAsync::unhash insteadof SlateSessionStateCode
getURI(string $uri_string)
getComponentForItem(isItem $item, bool $with_content=true)
getComponentWithContent(isItem $item)
This is called in cases when the Full Item with it's content is needed, e.g.
getStandardSymbol(isItem $item)
__construct()
BaseTypeRenderer constructor.
Class TypeRenderer Every Type should have a renderer, if you won't provide on in your TypeInformation...
getComponentWithoutContent(isItem $item)
This is called when only the relevant part of the item is needed during the synchronous rendering of ...
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...
getProviderIdentification()
A component is the most general form of an entity in the UI.
An entity that renders components to a string output.
addOnloadCode(Slate $slate, isItem $item)
trait MakeSlateAsync
Trait MakeSlateAsync.
addAsyncLoadingCode(Slate $slate, supportsAsynchronousLoading $item)