5 require_once(
"libs/composer/vendor/autoload.php");
7 require_once(__DIR__ .
"/Renderer/ilIndependentTemplate.php");
8 require_once(__DIR__ .
"/../../Services/Language/classes/class.ilLanguage.php");
12 use ILIAS\UI\Implementaiton\Component as
I;
29 public function getTemplate($path, $purge_unfilled_vars, $purge_unused_blocks)
46 public function deck(array $cards)
119 public $resources = array();
123 $this->resources[] =
$name;
129 public $requested = array();
133 public function txt($a_topic, $a_default_lang_fallback_mod =
"")
135 $this->requested[] = $a_topic;
141 public $lang_module =
'common';
155 public $ids = array();
159 $id =
"id_" . $this->count;
163 public $on_load_code = array();
166 $this->on_load_code[] = $code;
178 protected $with_stub_renderings = [];
180 public function __construct(Render\
Loader $component_renderer_loader, $with_stub_renderings = [])
182 $this->with_stub_renderings = array_map(
function ($component) {
183 return get_class($component);
184 }, $with_stub_renderings);
190 return $this->getRendererFor($component);
195 if (in_array(get_class($component), $this->with_stub_renderings)) {
198 return parent::getRendererFor($component);
203 return $this->getContexts();
214 return $component->getCanonicalName();
220 private $manipulate =
false;
224 $this->manipulate =
true;
229 if ($this->manipulate) {
230 return "This content was manipulated";
243 return 'signal_' . ++$this->id;
255 return "DummyComponent";
266 assert_options(ASSERT_WARNING, 0);
271 assert_options(ASSERT_WARNING, 1);
302 ->disableOriginalConstructor()
313 $ui_factory = $this->getUIFactory();
314 $tpl_factory = $this->getTemplateFactory();
315 $resource_registry = $this->getResourceRegistry();
316 $lng = $this->getLanguage();
318 $js_binding = $this->getJavaScriptBinding();
321 $refinery = $this->getRefinery();
322 $image_path_resolver = $this->getImagePathResolver();
324 $component_renderer_loader =
new Render\LoaderCachingWrapper(
365 return trim(str_replace([
"\n",
"\r"],
"", $html));
374 $html =
new DOMDocument();
375 $html->formatOutput =
true;
376 $html->preserveWhiteSpace =
false;
377 $expected =
new DOMDocument();
378 $expected->formatOutput =
true;
379 $expected->preserveWhiteSpace =
false;
380 $html->loadXML($this->normalizeHTML($html_as_string));
381 $expected->loadXML($this->normalizeHTML($expected_html_as_string));
382 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
394 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
395 $html = preg_replace(
'# {2,}#',
" ", $html);
396 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
397 $html = preg_replace(
"/>(\s+)</",
"><", $html);
398 $html = str_replace(
" >",
">", $html);
399 $html = str_replace(
" <",
"<", $html);
Registry for resources required by rendered output like Javascript or CSS.
getRendererFor(IComponent $component)
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...
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.
Loads renderers for components from the file system.
Class ChatMainBarProvider .
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...
Registers resources for retreived renderers at a ResourceRegistry.
layout()
description: purpose: > Layout components are compontents used for the overall construction of the u...
messageBox()
description: purpose: > Message Boxes inform the user about the state of the system or an ongoing us...
deck(array $cards)
description: purpose: > Decks are used to display multiple Cards in a grid.
toJS($a_lang_key, ilGlobalTemplateInterface $a_tpl=null)
getOnLoadCodeAsync()
Get all the registered on-load javascript code for the async context, e.g.
Provides common functionality for UI tests.
This is how the factory for UI elements looks.
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)
render($component, ?Renderer $root=null)
Render given component.
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
assertHTMLEquals($expected_html_as_string, $html_as_string)
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.
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
image()
description: purpose: The Image component is used to display images of various sources.
addOnLoadCode($code)
Add some JavaScript-statements to the on-load handler of the page.
getTemplate($path, $purge_unfilled_vars, $purge_unused_blocks)
Get template instance.
__construct(Container $dic, ilPlugin $plugin)
listing()
description: purpose: > Listings are used to structure itemised textual information.
_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.
txt($a_topic, $a_default_lang_fallback_mod="")
loadLanguageModule($lang_module)
Interface for a factory that provides templates.
__construct(Render\Loader $component_renderer_loader, $with_stub_renderings=[])
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...
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
popover()
description: purpose: > Popovers can be used when space is scarce i.e.