ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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;
51  $lng = $this->lng;
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 }
getUIChecklistStatus(int $check_list_status)
Get ui checklist status.
global $DIC
Definition: goto.php:24
ui()
Definition: ui.php:5
$txt
Definition: error.php:13
$steps
Definition: latex.php:3