ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilProfileChecklistGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
6
14{
18 protected $ui;
19
23 protected $status;
24
28 protected $lng;
29
33 public function __construct()
34 {
35 global $DIC;
36
37 $this->ui = $DIC->ui();
38 $this->status = new ilProfileChecklistStatus();
39 $this->lng = $DIC->language();
40 }
41
48 public function render($active_step)
49 {
50 $ui = $this->ui;
52 $workflow_factory = $ui->factory()->listing()->workflow();
54
55 //setup steps
56 $steps = [];
57 $cnt = 0;
58 foreach ($this->status->getSteps() as $step => $txt) {
59 if ($step == $active_step) {
60 $active_step_nr = $cnt;
61 }
62 $cnt++;
63 $s = $workflow_factory->step($txt, $status->getStatusDetails($step))
64 ->withStatus($this->getUIChecklistStatus($status->getStatus($step)));
65 $steps[] = $s;
66 }
67
68 //setup linear workflow
69 $wf = $workflow_factory->linear($lng->txt("user_privacy_checklist"), $steps)
70 ->withActive($active_step_nr);
71
72 //render
73 return $ui->renderer()->render($wf);
74 }
75
81 protected function getUIChecklistStatus(int $check_list_status)
82 {
83 switch ($check_list_status) {
84 case ilProfileChecklistStatus::STATUS_NOT_STARTED: return Step::NOT_STARTED; break;
85 case ilProfileChecklistStatus::STATUS_IN_PROGRESS: return Step::IN_PROGRESS; break;
86 case ilProfileChecklistStatus::STATUS_SUCCESSFUL: return Step::SUCCESSFULLY; break;
87 }
88 }
89}
An exception for terminatinating execution or to throw for unit testing.
getUIChecklistStatus(int $check_list_status)
Get ui checklist status.
$txt
Definition: error.php:13
This describes a Workflow Step.
Definition: Step.php:13
$steps
Definition: latex.php:3
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46