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');
69 public function deck(array $cards):
I\Deck\Deck
78 public function legacy():
I\Legacy\Factory
81 public function panel():
I\Panel\Factory
84 public function modal():
I\Modal\Factory
105 public function item():
I\Item\Factory
132 public function tree():
I\Tree\Factory
165 public function register(
string $name):
void 173 public array $requested = array();
179 public function txt($a_topic, $a_default_lang_fallback_mod =
""): string
181 $this->requested[] = $a_topic;
189 public string $lang_module =
'common';
203 public array $on_load_code = array();
204 public array $ids = array();
205 private int $count = 0;
210 $id =
"id_" . $this->count;
217 $this->on_load_code[] = $code;
228 protected array $with_stub_renderings = [];
231 Render\
Loader $component_renderer_loader,
234 array $with_stub_renderings = [],
235 protected array $with_additional_contexts = [],
237 $this->with_stub_renderings =
array_map(
function ($component) {
238 return get_class($component);
239 }, $with_stub_renderings);
241 array_walk($this->with_additional_contexts, fn(
Component $c) => $this->pushContext($c));
248 return $this->getRendererFor($component);
253 if (in_array(get_class($component), $this->with_stub_renderings)) {
256 return parent::getRendererFor($component);
261 return $this->getContexts();
266 return str_replace(
' ',
'-', strtolower($component->getCanonicalName()));
278 return $component->getCanonicalName();
289 private $manipulate =
false;
293 $this->manipulate =
true;
298 if ($this->manipulate) {
299 return "This content was manipulated";
326 return "DummyComponent";
368 public function getRefinery()
371 ->disableOriginalConstructor()
382 return $this->createMock(DataFactory::class);
387 return new Help\TextRetriever\Echoing();
392 return $this->createMock(UploadLimitResolver::class);
399 public function getDefaultRenderer(
401 array $with_stub_renderings = [],
402 array $with_additional_contexts = [],
404 $ui_factory = $this->getUIFactory();
405 $tpl_factory = $this->getTemplateFactory();
406 $resource_registry = $this->getResourceRegistry();
409 $js_binding = $this->getJavaScriptBinding();
412 $image_path_resolver = $this->getImagePathResolver();
414 $help_text_retriever = $this->getHelpTextRetriever();
416 $component_renderer_loader =
new Render\LoaderCachingWrapper(
425 $image_path_resolver,
427 $help_text_retriever,
428 $this->getUploadLimitResolver()
435 $image_path_resolver,
437 $help_text_retriever,
438 $this->getUploadLimitResolver()
445 $image_path_resolver,
447 $help_text_retriever,
448 $this->getUploadLimitResolver()
455 $image_path_resolver,
457 $help_text_retriever,
458 $this->getUploadLimitResolver()
465 $image_path_resolver,
467 $help_text_retriever,
468 $this->getUploadLimitResolver()
470 new I\
Menu\MenuRendererFactory(
475 $image_path_resolver,
477 $help_text_retriever,
478 $this->getUploadLimitResolver(),
483 return new TestDefaultRenderer($component_renderer_loader, $js_binding,
$lng, $with_stub_renderings, $with_additional_contexts);
486 public function getDecoratedRenderer(
Renderer $default)
491 public function normalizeHTML(
string $html):
string 493 return trim(str_replace([
"\n",
"\r"],
"", $html));
501 public function assertHTMLEquals(
string $expected_html_as_string,
string $html_as_string):
void 504 $html->formatOutput =
true;
505 $html->preserveWhiteSpace =
false;
507 $expected->formatOutput =
true;
508 $expected->preserveWhiteSpace =
false;
509 $html->loadXML($this->normalizeHTML($html_as_string));
510 $expected->loadXML($this->normalizeHTML($expected_html_as_string));
511 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
518 protected function brutallyTrimHTML(
string $html):
string 520 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
521 $html = preg_replace(
'# {2,}#',
" ", $html);
522 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
523 $html = preg_replace(
"/>(\s+)</",
"><", $html);
524 $html = str_replace(
" >",
">", $html);
525 $html = str_replace(
" <",
"<", $html);
533 protected function brutallyTrimSignals(
string $html):
string 535 $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.