26 $tpl->setVariable(
'FORCE_RENDERING',
'');
37 'title' => $this->
escape($popover->getTitle()),
38 'placement' => $popover->getPosition(),
40 'template' => str_replace(array_keys($replacement), array_values($replacement),
$tpl->get()),
43 if ($popover->isFixedPosition()) {
47 $is_async = $popover->getAsyncContentUrl();
50 $options[
'url'] = $popover->getAsyncContentUrl();
53 $show = $popover->getShowSignal();
54 $replace = $popover->getReplaceContentSignal();
56 $popover = $popover->withAdditionalOnLoadCode(
function (
$id) use (
$options, $show, $replace, $is_async) {
63 "$(document).on('{$show}', function(event, signalData) { 64 il.UI.popover.showFromSignal(signalData, JSON.parse('{$options}')); 66 "$(document).on('{$replace}', function(event, signalData) { 67 il.UI.popover.replaceContentFromSignal('{$show}', signalData); 73 if ($popover->getAsyncContentUrl()) {
94 parent::registerResources($registry);
95 $registry->
register(
'./libs/bower/bower_components/webui-popover/dist/jquery.webui-popover.js');
96 $registry->
register(
'./src/UI/templates/js/Popover/popover.js');
109 $tpl = $this->
getTemplate(
'tpl.standard-popover-content.html',
true,
true);
111 $tpl->setVariable(
'CONTENT', $default_renderer->render($popover->getContent()));
126 $tpl = $this->
getTemplate(
'tpl.listing-popover-content.html',
true,
true);
128 foreach ($popover->getItems() as $item) {
129 $tpl->setCurrentBlock(
'item');
130 $tpl->setVariable(
'ITEM', $default_renderer->render($item));
131 $tpl->parseCurrentBlock();
145 return strip_tags(htmlentities($str, ENT_QUOTES,
'UTF-8'));
Registry for resources required by rendered output like Javascript or CSS.
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
if(!array_key_exists('StateId', $_REQUEST)) $id
renderListingPopover(Component\Popover\Listing $popover, RendererInterface $default_renderer, $id)
renderStandardPopover(Component\Popover\Standard $popover, RendererInterface $default_renderer, $id)
register($name)
Add a dependency.
render(Component $component, Renderer $default_renderer)
Render the component if possible and delegate additional rendering to the default_renderer.
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.null
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.
getComponentInterfaceName()
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.