ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ChecklistGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\User\Profile;
22
24use ILIAS\UI\Factory as UIFactory;
25use ILIAS\UI\Renderer as UIRenderer;
27
32{
33 protected UIFactory $ui_factory;
34 private UIRenderer $ui_renderer;
36 protected Language $lng;
37
38 public function __construct()
39 {
41 global $DIC;
42
43 $this->ui_factory = $DIC['ui.factory'];
44 $this->ui_renderer = $DIC['ui.renderer'];
45 $this->lng = $DIC['lng'];
46
47 $this->status = new ChecklistStatus(
48 $this->lng,
49 $DIC['ilSetting'],
50 $DIC['ilUser'],
51 new Visibility($this->lng, $DIC['ilSetting'], $DIC['ilUser'])
52 );
53 }
54
55 public function render(int $active_step): string
56 {
57 $active_step_nr = 0;
58 $workflow_factory = $this->ui_factory->listing()->workflow();
60
61 //setup steps
62 $steps = [];
63 $cnt = 0;
64 foreach ($this->status->getSteps() as $step => $txt) {
65 if ($step == $active_step) {
66 $active_step_nr = $cnt;
67 }
68 $cnt++;
69 $s = $workflow_factory->step($txt, $status->getStatusDetails($step))
70 ->withStatus($this->getUIChecklistStatus($status->getStatus($step)));
71 $steps[] = $s;
72 }
73
74 //setup linear workflow
75 $wf = $workflow_factory->linear($this->lng->txt("user_privacy_checklist"), $steps)
76 ->withActive($active_step_nr);
77
78 //render
79 return $this->ui_renderer->render($wf);
80 }
81
85 protected function getUIChecklistStatus(int $check_list_status): int
86 {
87 switch ($check_list_status) {
91 }
92 return 0;
93 }
94}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
getUIChecklistStatus(int $check_list_status)
Get ui checklist status.
Personal profile publishing mode of a user.
Definition: Visibility.php:30
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
$txt
Definition: error.php:31
This describes a Workflow Step.
Definition: Step.php:30
An entity that renders components to a string output.
Definition: Renderer.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26