19 require_once(__DIR__ .
'/../../../../vendor/composer/vendor/autoload.php');
21 require_once(__DIR__ .
'/Renderer/ilIndependentTemplate.php');
22 require_once(__DIR__ .
'/../../Language/classes/class.ilLanguage.php');
68 public function deck(array $cards):
I\Deck\Deck
77 public function legacy():
I\Legacy\Factory
80 public function panel():
I\Panel\Factory
83 public function modal():
I\Modal\Factory
104 public function item():
I\Item\Factory
131 public function tree():
I\Tree\Factory
134 public function menu():
I\Menu\Factory
164 public function register(
string $name):
void 172 public array $requested = array();
178 public function txt($a_topic, $a_default_lang_fallback_mod =
""): string
180 $this->requested[] = $a_topic;
188 public string $lang_module =
'common';
202 public array $on_load_code = array();
203 public array $ids = array();
204 private int $count = 0;
209 $id =
"id_" . $this->count;
216 $this->on_load_code[] = $code;
227 protected array $with_stub_renderings = [];
230 Render\
Loader $component_renderer_loader,
233 array $with_stub_renderings = [],
234 protected array $with_additional_contexts = [],
236 $this->with_stub_renderings =
array_map(
function ($component) {
237 return get_class($component);
238 }, $with_stub_renderings);
240 array_walk($this->with_additional_contexts, fn(
Component $c) => $this->pushContext($c));
247 return $this->getRendererFor($component);
252 if (in_array(get_class($component), $this->with_stub_renderings)) {
255 return parent::getRendererFor($component);
260 return $this->getContexts();
265 return str_replace(
' ',
'-', strtolower($component->getCanonicalName()));
277 return $component->getCanonicalName();
288 private $manipulate =
false;
292 $this->manipulate =
true;
297 if ($this->manipulate) {
298 return "This content was manipulated";
323 return "DummyComponent";
365 public function getRefinery()
368 ->disableOriginalConstructor()
379 return $this->createMock(DataFactory::class);
384 return new Help\TextRetriever\Echoing();
389 return $this->createMock(UploadLimitResolver::class);
396 public function getDefaultRenderer(
398 array $with_stub_renderings = [],
399 array $with_additional_contexts = [],
401 $ui_factory = $this->getUIFactory();
402 $tpl_factory = $this->getTemplateFactory();
403 $resource_registry = $this->getResourceRegistry();
406 $js_binding = $this->getJavaScriptBinding();
409 $image_path_resolver = $this->getImagePathResolver();
411 $help_text_retriever = $this->getHelpTextRetriever();
413 $component_renderer_loader =
new Render\LoaderCachingWrapper(
422 $image_path_resolver,
424 $help_text_retriever,
425 $this->getUploadLimitResolver()
432 $image_path_resolver,
434 $help_text_retriever,
435 $this->getUploadLimitResolver()
442 $image_path_resolver,
444 $help_text_retriever,
445 $this->getUploadLimitResolver()
452 $image_path_resolver,
454 $help_text_retriever,
455 $this->getUploadLimitResolver()
462 $image_path_resolver,
464 $help_text_retriever,
465 $this->getUploadLimitResolver()
470 return new TestDefaultRenderer($component_renderer_loader, $js_binding,
$lng, $with_stub_renderings, $with_additional_contexts);
473 public function getDecoratedRenderer(
Renderer $default)
478 public function normalizeHTML(
string $html):
string 480 return trim(str_replace([
"\n",
"\r"],
"", $html));
483 public function assertHTMLEquals(
string $expected_html_as_string,
string $html_as_string):
void 486 $html->formatOutput =
true;
487 $html->preserveWhiteSpace =
false;
489 $expected->formatOutput =
true;
490 $expected->preserveWhiteSpace =
false;
491 $html->loadXML($this->normalizeHTML($html_as_string));
492 $expected->loadXML($this->normalizeHTML($expected_html_as_string));
493 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
500 protected function brutallyTrimHTML(
string $html):
string 502 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
503 $html = preg_replace(
'# {2,}#',
" ", $html);
504 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
505 $html = preg_replace(
"/>(\s+)</",
"><", $html);
506 $html = str_replace(
" >",
">", $html);
507 $html = str_replace(
" <",
"<", $html);
515 protected function brutallyTrimSignals(
string $html):
string 517 $html = preg_replace(
'/il_signal_(\w+)/',
"il_signal...", $html);
Registry for resources required by rendered output like Javascript or CSS.
getRendererFor(IComponent $component)
registerResources(ResourceRegistry $registry)
card()
description: purpose: > A card is a flexible content container for small chunks of structured data...
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...
getComponentCanonicalNameAttribute(IComponent $component)
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.
Loads renderers for components from the file system.
Interface Observer Contains several chained tasks and infos about them.
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...
__construct(Render\Loader $component_renderer_loader, JavaScriptBinding $java_script_binding, \ILIAS\Language\Language $language, array $with_stub_renderings=[], protected array $with_additional_contexts=[],)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
legacy()
description: purpose: > legacy components are used as provisional elements in the UI framework while...
prompt()
description: purpose: > A Prompt requires a user to make some inputs to the system, like making choices, acknowleding an important information or filling out a form.
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...
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...
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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
helpTopics(string ... $topic)
description: purpose: > Help Topics can be attached to certain components.
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)
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
menu()
description: purpose: > Menus let the user choose from several (navigational) options.
toJS($a_lang_key, ?ilGlobalTemplateInterface $a_tpl=null)
image()
description: purpose: The Image component is used to display images of various sources.
progress()
description: purpose: > A Progress component is designed to represent the users advancement within a...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
loadLanguageModule(string $a_module)
listing()
description: purpose: > Listings are used to structure itemised textual information.
txt($a_topic, $a_default_lang_fallback_mod="")
_getRendererFor(IComponent $component)
table()
description: purpose: > Tables present a set of uniformly structured data.
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.
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.