ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_lead_avatar.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
19 function with_lead_avatar()
20 {
21  global $DIC;
22  $f = $DIC->ui()->factory();
23  $renderer = $DIC->ui()->renderer();
24  $actions = $f->dropdown()->standard(array(
25  $f->button()->shy("ILIAS", "https://www.ilias.de"),
26  $f->button()->shy("GitHub", "https://www.github.com")
27  ));
28  $app_item1 = $f->item()->standard("Max Mustermann")
29  ->withActions($actions)
30  ->withProperties(array(
31  "Last Login" => "24.11.2011",
32  "Location" => "Hamburg"))
33  ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.")
34  ->withLeadAvatar($f->symbol()->avatar()->letter('mm'));
35  $app_item2 = $f->item()->standard("Erika Mustermann")
36  ->withActions($actions)
37  ->withProperties(array(
38  "Last Login" => "3.12.2018",
39  "Location" => "Berlin"))
40  ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.")
41  ->withLeadAvatar($f->symbol()->avatar()->picture('./assets/images/placeholder/no_photo_xsmall.jpg', 'demo.user'));
42  return $renderer->render([$app_item1, $f->divider()->horizontal(), $app_item2]);
43 }
with_lead_avatar()
description: > Example for rendering a standard item with an lead avatar.
$renderer
global $DIC
Definition: shib_login.php:25