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;
76 public function legacy(
string $content):
C\Legacy\Legacy
157 public function register(
string $name):
void 165 public array $requested = array();
171 public function txt($a_topic, $a_default_lang_fallback_mod =
""): string
173 $this->requested[] = $a_topic;
181 public string $lang_module =
'common';
195 public array $on_load_code = array();
196 public array $ids = array();
197 private int $count = 0;
202 $id =
"id_" . $this->count;
209 $this->on_load_code[] = $code;
220 protected array $with_stub_renderings = [];
222 public function __construct(Render\
Loader $component_renderer_loader, array $with_stub_renderings = [])
224 $this->with_stub_renderings = array_map(
function ($component) {
225 return get_class($component);
226 }, $with_stub_renderings);
232 return $this->getRendererFor($component);
237 if (in_array(get_class($component), $this->with_stub_renderings)) {
240 return parent::getRendererFor($component);
245 return $this->getContexts();
257 return $component->getCanonicalName();
268 private $manipulate =
false;
272 $this->manipulate =
true;
277 if ($this->manipulate) {
278 return "This content was manipulated";
303 return "DummyComponent";
314 assert_options(ASSERT_WARNING, 0);
319 assert_options(ASSERT_WARNING, 1);
353 ->disableOriginalConstructor()
364 return $this->createMock(DataFactory::class);
369 return new Help\TextRetriever\Echoing();
374 return $this->createMock(UploadLimitResolver::class);
379 array $with_stub_renderings = []
381 $ui_factory = $this->getUIFactory();
382 $tpl_factory = $this->getTemplateFactory();
383 $resource_registry = $this->getResourceRegistry();
386 $js_binding = $this->getJavaScriptBinding();
390 $image_path_resolver = $this->getImagePathResolver();
392 $help_text_retriever = $this->getHelpTextRetriever();
394 $component_renderer_loader =
new Render\LoaderCachingWrapper(
404 $image_path_resolver,
406 $help_text_retriever,
407 $this->getUploadLimitResolver()
415 $image_path_resolver,
417 $help_text_retriever,
418 $this->getUploadLimitResolver()
426 $image_path_resolver,
428 $help_text_retriever,
429 $this->getUploadLimitResolver()
437 $image_path_resolver,
439 $help_text_retriever,
440 $this->getUploadLimitResolver()
455 return trim(str_replace([
"\n",
"\r"],
"", $html));
458 public function assertHTMLEquals(
string $expected_html_as_string,
string $html_as_string): void
461 $html->formatOutput =
true;
462 $html->preserveWhiteSpace =
false;
464 $expected->formatOutput =
true;
465 $expected->preserveWhiteSpace =
false;
466 $html->loadXML($this->normalizeHTML($html_as_string));
467 $expected->loadXML($this->normalizeHTML($expected_html_as_string));
468 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
477 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
478 $html = preg_replace(
'# {2,}#',
" ", $html);
479 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
480 $html = preg_replace(
"/>(\s+)</",
"><", $html);
481 $html = str_replace(
" >",
">", $html);
482 $html = str_replace(
" <",
"<", $html);
492 $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.
entity()
description: purpose: > An Entity displays information about entities within the system...
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.
This describes a facility that the UI framework can use to retrieve some help text.
helpTopics(string ... $topic)
description: purpose: > Help Topics can be attached to certain components.
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)
launcher()
description: purpose: > The Launcher starts an object, a process or a workflow.
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.
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.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
popover()
description: purpose: > Popovers can be used when space is scarce i.e.
Refinery Factory $refinery