Documentation
Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'
Footer
Description
- Purpose
- The Footer is a unique page section to accommodate links and shy buttons triggering Round Trip Modals that are not being used on a regular basis, such as links to the pages's imprint or a privacy policy document.
- Composition
- The Footer is composed of a list of Links or Shy Buttons triggering Round Trip Modals and an optional text-part.
- Context
- The Footer is used with the Standard Page.
Rules
- Usage
- The Footer is unique for the page - there MUST be not more than one.
- Elements in the Footer SHOULD NOT vary according to context, but MAY vary according to the user's role or state (logged in/not logged in/...).
- Although the footer is constructed only with its "static" parts, it SHOULD have attached a permanent URL for the current page/object.
Example 1: Footer
<?php declare(strict_types=1); namespace ILIAS\UI\examples\MainControls\Footer; use ILIAS\DI\Container; function footer(): string { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $url = $DIC->http()->request()->getUri()->__toString() . '&new_footer_ui=1'; $page_demo = $f->link()->standard('See UI in fullscreen-mode', $url); return $renderer->render([ $page_demo ]); } function pageFooterDemoFooter(): \ILIAS\UI\Component\MainControls\Footer { global $DIC; $f = $DIC->ui()->factory(); $df = new \ILIAS\Data\Factory(); $text = 'Additional info:'; $links = []; $links[] = $f->link()->standard("Goto ILIAS", "http://www.ilias.de"); $links[] = $f->link()->standard("Goto Mantis", "http://mantis.ilias.de"); return $f->mainControls()->footer($links, $text)->withPermanentURL( $df->uri( $DIC->http()->request()->getUri()->__toString() . '&new_footer_ui=1' ) ); } global $DIC; $request_wrapper = $DIC->http()->wrapper()->query(); $refinery = $DIC->refinery(); if ($request_wrapper->has('new_footer_ui') && $request_wrapper->retrieve('new_footer_ui', $refinery->kindlyTo()->int()) === 1 ) { \ilInitialisation::initILIAS(); echo(renderFooterInFullscreenMode($DIC)); exit(); } function renderFooterInFullscreenMode(Container $dic): string { $f = $dic->ui()->factory(); $renderer = $dic->ui()->renderer(); $logo = $f->image()->responsive("templates/default/images/logo/HeaderIcon.svg", "ILIAS"); $responsive_logo = $f->image()->responsive("templates/default/images/logo/HeaderIconResponsive.svg", "ILIAS"); $breadcrumbs = pageFooterDemoCrumbs($f); $metabar = pageFooterDemoMetabar($f); $mainbar = pageFooterDemoMainbar($f); $footer = pageFooterDemoFooter(); $tc = $dic->ui()->factory()->toast()->container(); $content = pageFooterDemoContent($f); $page = $f->layout()->page()->standard( $content, $metabar, $mainbar, $breadcrumbs, $logo, $responsive_logo, "./templates/default/images/logo/favicon.ico", $tc, $footer, 'UI PAGE FOOTER DEMO', //page title 'ILIAS', //short title 'Std. Page Footer Demo' //view title ) ->withUIDemo(true); return $renderer->render($page); } function pageFooterDemoContent(\ILIAS\UI\Factory $f): array { return [ $f->panel()->standard( 'All about the Footer', $f->legacy( "See bellow" ) ), ]; } function pageFooterDemoMetabar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\MetaBar { $help = $f->button()->bulky($f->symbol()->glyph()->help(), 'Help', '#'); return $f->mainControls()->metaBar()->withAdditionalEntry('help', $help); } function pageFooterDemoCrumbs(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\Breadcrumbs\Breadcrumbs { return $f->breadcrumbs([]); } function pageFooterDemoMainbar(\ILIAS\UI\Factory $f): \ILIAS\UI\Component\MainControls\MainBar { return $f->mainControls()->mainBar(); }
Example 2: Footer with modals
<?php declare(strict_types=1); namespace ILIAS\UI\examples\MainControls\Footer; use ILIAS\DI\Container; function footer_with_modals(): string { global $DIC; $f = $DIC->ui()->factory(); $renderer = $DIC->ui()->renderer(); $url = $DIC->http()->request()->getUri()->__toString() . '&new_footer_2_ui=1'; $page_demo = $f->link()->standard('See UI in fullscreen-mode', $url); return $renderer->render($page_demo); } function pageFooterDemo2Footer(): \ILIAS\UI\Component\MainControls\Footer { global $DIC; $f = $DIC->ui()->factory(); $text = 'Additional info:'; $links = []; $links[] = $f->link()->standard("Goto ILIAS", "http://www.ilias.de"); $footer = $f->mainControls()->footer($links, $text); $roundTripModal = $f->modal()->roundtrip('Withdrawal of Consent', $f->legacy('Withdrawal of Consent ...')); $shyButton = $f->button()->shy('Terms Of Service', '#'); return $footer->withAdditionalModalAndTrigger($roundTripModal, $shyButton); } global $DIC; $request_wrapper = $DIC->http()->wrapper()->query(); $refinery = $DIC->refinery(); if ($request_wrapper->has('new_footer_2_ui') && $request_wrapper->retrieve('new_footer_2_ui', $refinery->kindlyTo()->int()) === 1 ) { \ilInitialisation::initILIAS(); echo(renderFooterWithModalsInFullscreenMode($DIC)); exit(); } function renderFooterWithModalsInFullscreenMode(Container $dic): string { require_once("src/UI/examples/MainControls/Footer/footer.php"); $f = $dic->ui()->factory(); $renderer = $dic->ui()->renderer(); $logo = $f->image()->responsive("templates/default/images/logo/HeaderIcon.svg", "ILIAS"); $responsive_logo = $f->image()->responsive("templates/default/images/logo/HeaderIconResponsive.svg", "ILIAS"); $breadcrumbs = pageFooterDemoCrumbs($f); $metabar = pageFooterDemoMetabar($f); $mainbar = pageFooterDemoMainbar($f); $footer = pageFooterDemo2Footer(); $tc = $dic->ui()->factory()->toast()->container(); $content = pageFooterDemoContent($f); $page = $f->layout()->page()->standard( $content, $metabar, $mainbar, $breadcrumbs, $logo, $responsive_logo, "./templates/default/images/logo/favicon.ico", $tc, $footer, 'UI PAGE FOOTER DEMO', //page title 'ILIAS', //short title 'Std. Page Footer Demo' //view title )->withUIDemo(true); return $renderer->render($page); }
Relations
- Parents
- UIComponent
- Main Controls