27 return $this->
renderMode($component, $default_renderer);
43 $active = $component->getActive();
45 $activate_first_item =
true;
48 foreach ($component->getLabelledActions() as $label =>
$action) {
49 $tpl->setVariable(
"ARIA", $this->
txt($component->getAriaLabel()));
50 $tpl->setVariable(
"ROLE", self::MODE_ROLE);
52 $tpl->setCurrentBlock(
"view_control");
55 if ($activate_first_item) {
56 $tpl->setVariable(
"BUTTON", $default_renderer->render($f->button()->standard($label,
$action)->WithUnavailableAction()->withAriaLabel($label)->withAriaChecked()));
57 $activate_first_item =
false;
58 } elseif ($active == $label) {
59 $tpl->setVariable(
"BUTTON", $default_renderer->render($f->button()->standard($label,
$action)->withUnavailableAction()->withAriaLabel($label)->withAriaChecked()));
61 $tpl->setVariable(
"BUTTON", $default_renderer->render($f->button()->standard($label,
$action)->withAriaLabel($label)));
63 $tpl->parseCurrentBlock();
76 $tpl->setVariable(
"BUTTON", $default_renderer->render($component->getSelectorButton()));
94 $uptype = strtoupper(
$type);
96 $action = $component->getAction();
98 if ($component->isActive()) {
99 $tpl->setCurrentBlock(
$type .
"_with_href");
101 $tpl->parseCurrentBlock();
111 $f = new \ILIAS\UI\Implementation\Factory(
117 $component = $component->withResetSignals();
118 $triggeredSignals = $component->getTriggeredSignals();
119 if ($triggeredSignals) {
120 $internal_signal = $component->getSelectSignal();
121 $signal = $triggeredSignals[0]->getSignal();
122 $options = json_encode($signal->getOptions());
124 $component = $component->withOnLoadCode(
function (
$id) use ($internal_signal, $signal) {
125 return "$(document).on('{$internal_signal}', function(event, signalData) { 126 il.UI.viewcontrol.sortation.onInternalSelect(event, signalData, '{$signal}', '{$id}'); 137 $options = $component->getOptions();
138 $init_label = $component->getLabel();
140 foreach (
$options as $val => $label) {
141 if ($triggeredSignals) {
142 $shy = $f->button()->shy($label, $val)->withOnClick($internal_signal);
144 $url = $component->getTargetURL();
145 $url .= (strpos(
$url,
'?') ===
false) ?
'?' :
'&';
146 $url .= $component->getParameterName() .
'=' . $val;
147 $shy = $f->button()->shy($label,
$url);
152 $dd = $f->dropdown()->standard($items)
153 ->withLabel($init_label);
155 $tpl->setVariable(
'SORTATION_DROPDOWN', $default_renderer->render($dd));
165 parent::registerResources($registry);
166 $registry->register(
'./src/UI/templates/js/ViewControl/sortation.js');
174 $tpl->setCurrentBlock($block);
175 $tpl->setVariable($template_var,
$id);
176 $tpl->parseCurrentBlock();
renderSection(Component\ViewControl\Section $component, RendererInterface $default_renderer)
renderSortation(Component\ViewControl\Sortation $component, RendererInterface $default_renderer)
render(Component\Component $component, RendererInterface $default_renderer)
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
getComponentInterfaceName()
renderSectionButton(Component\Button\Button $component, $tpl, $type)
txt($id)
Get a text from the language file.
registerResources(\ILIAS\UI\Implementation\Render\ResourceRegistry $registry)
renderMode(Component\ViewControl\Mode $component, RendererInterface $default_renderer)
maybeRenderId(Component\Component $component, $tpl, $block, $template_var)
Create styles array
The data for the language used.
getUIFactory()
Get a UI factory.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.