19 require_once(
"libs/composer/vendor/autoload.php");
21 require_once(__DIR__ .
"/Renderer/ilIndependentTemplate.php");
22 require_once(__DIR__ .
"/../../Services/Language/classes/class.ilLanguage.php");
26 use ILIAS\UI\Implementaiton\Component as
I;
73 public function legacy(
string $content):
C\Legacy\Legacy
145 public function register(
string $name):
void 147 $this->resources[] =
$name;
153 public array $requested = array();
159 public function txt($a_topic, $a_default_lang_fallback_mod =
""): string
161 $this->requested[] = $a_topic;
169 public string $lang_module =
'common';
183 public array $on_load_code = array();
184 public array $ids = array();
185 private int $count = 0;
190 $id =
"id_" . $this->count;
197 $this->on_load_code[] = $code;
208 protected array $with_stub_renderings = [];
210 public function __construct(Render\
Loader $component_renderer_loader, array $with_stub_renderings = [])
212 $this->with_stub_renderings = array_map(
function ($component) {
213 return get_class($component);
214 }, $with_stub_renderings);
220 return $this->getRendererFor($component);
225 if (in_array(get_class($component), $this->with_stub_renderings)) {
228 return parent::getRendererFor($component);
233 return $this->getContexts();
245 return $component->getCanonicalName();
256 private $manipulate =
false;
260 $this->manipulate =
true;
265 if ($this->manipulate) {
266 return "This content was manipulated";
291 return "DummyComponent";
302 assert_options(ASSERT_WARNING, 0);
307 assert_options(ASSERT_WARNING, 1);
341 ->disableOriginalConstructor()
352 return $this->createMock(DataFactory::class);
357 array $with_stub_renderings = []
359 $ui_factory = $this->getUIFactory();
360 $tpl_factory = $this->getTemplateFactory();
361 $resource_registry = $this->getResourceRegistry();
364 $js_binding = $this->getJavaScriptBinding();
368 $image_path_resolver = $this->getImagePathResolver();
371 $component_renderer_loader =
new Render\LoaderCachingWrapper(
381 $image_path_resolver,
390 $image_path_resolver,
399 $image_path_resolver,
408 $image_path_resolver,
424 return trim(str_replace([
"\n",
"\r"],
"", $html));
427 public function assertHTMLEquals(
string $expected_html_as_string,
string $html_as_string): void
430 $html->formatOutput =
true;
431 $html->preserveWhiteSpace =
false;
433 $expected->formatOutput =
true;
434 $expected->preserveWhiteSpace =
false;
435 $html->loadXML($this->normalizeHTML($html_as_string));
436 $expected->loadXML($this->normalizeHTML($expected_html_as_string));
437 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
446 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
447 $html = preg_replace(
'# {2,}#',
" ", $html);
448 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
449 $html = preg_replace(
"/>(\s+)</",
"><", $html);
450 $html = str_replace(
" >",
">", $html);
451 $html = str_replace(
" <",
"<", $html);
461 $html = preg_replace(
'/il_signal_(\w+)/',
"il_signal...", $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Registry for resources required by rendered output like Javascript or CSS.
getRendererFor(IComponent $component)
registerResources(ResourceRegistry $registry)
An entity that renders components to a string output.
card()
description: purpose: > A card is a flexible content container for small chunks of structured data...
loadLanguageModule(string $a_module)
item()
description: purpose: > An item displays a unique entity within the system.
breadcrumbs(array $crumbs)
description: purpose: > Breadcrumbs is a supplemental navigation scheme.
dropzone()
description: purpose: > Dropzones are containers used to drop either files or other HTML elements...
getDecoratedRenderer(Renderer $default)
getCanonicalName()
Get the canonical name of the component.
mainControls()
description: purpose: > Main Controls are components that are always usable, depending only on overa...
viewControl()
description: purpose: > View Controls switch between different visualisation of data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Loads renderers for components from the file system.
Class ChatMainBarProvider .
An entity that renders components to a string output.
link()
description: purpose: > Links are used navigate to other resources or views of the system by clickin...
symbol()
description: purpose: > Symbols are graphical representations of concepts or contexts quickly compre...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
legacy(string $content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
__construct(Render\Loader $component_renderer_loader, array $with_stub_renderings=[])
Registers resources for retreived renderers at a ResourceRegistry.
layout()
description: purpose: > Layout components are components used for the overall construction of the us...
messageBox()
description: purpose: > Message Boxes inform the user about the state of the system or an ongoing us...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
deck(array $cards)
description: purpose: > Decks are used to display multiple Cards in a grid.
toast()
description: purpose: Toasts are temporary messages from the system published to the user...
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
getTemplate(string $path, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template instance.
toJS($a_lang_key, ilGlobalTemplateInterface $a_tpl=null)
getOnLoadCodeAsync()
Get all the registered on-load javascript code for the async context, e.g.
player()
description: purpose: > The Player component is used to play and control a media source...
render(ILIAS\UI\Component\Component $component, ILIAS\UI\Renderer $default_renderer)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provides common functionality for UI tests.
tree()
description: purpose: > Trees present hierarchically structured data.
chart()
description: purpose: > Charts are used to graphically represent data in various forms such as maps...
panel()
description: purpose: > Panels are used to group titled content.
manipulateRendering($component, Renderer $root)
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
modal()
description: purpose: The Modal forces users to focus on the task at hand.
Provides methods to interface with javascript.
dropdown()
description: purpose: > Dropdowns reveal a list of interactions that change the system’s status or ...
menu()
description: purpose: > Menus let the user choose from several (navigational) options.
image()
description: purpose: The Image component is used to display images of various sources.
__construct(Container $dic, ilPlugin $plugin)
listing()
description: purpose: > Listings are used to structure itemised textual information.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
brutallyTrimSignals(string $html)
A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output...
_getRendererFor(IComponent $component)
table()
description: purpose: > Tables present a set of uniformly structured data.
normalizeHTML(string $html)
createId()
Create a fresh unique id.
button()
description: purpose: > Buttons trigger interactions that change the system’s or view's status...
Loads renderers for components.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt($a_topic, $a_default_lang_fallback_mod="")
Interface for a factory that provides templates.
divider()
description: purpose: > A divider marks a thematic change in a sequence of other components...
counter()
description: purpose: > Counter inform users about the quantity of items indicated by a glyph...
popover()
description: purpose: > Popovers can be used when space is scarce i.e.
Refinery Factory $refinery