ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLSCurriculumBuilder.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
11{
12 public function __construct(
13 array $ls_items,
14 ILIAS\UI\Factory $ui_factory,
16 string $goto_command,
17 LSUrlBuilder $url_builder = null
18 ) {
19 $this->items = $ls_items;
20 $this->ui_factory = $ui_factory;
21 $this->lng = $language;
22 $this->goto_command = $goto_command;
23 $this->url_builder = $url_builder;
24 }
25
26 public function getLearnerCurriculum(bool $with_action = false)//: ILIAS\UI\Component\Listing\Workflow
27 {
28 $steps = [];
29 foreach ($this->items as $item) {
30 $action = '#';
31 if ($with_action) {
32 $action = $this->query . $item->getRefId();
33 $action = $this->url_builder->getHref($this->goto_command, $item->getRefId());
34 }
35
36 $steps[] = $this->ui_factory->listing()->workflow()->step(
37 $item->getTitle(),
38 $item->getDescription(),
40 )
41 ->withAvailability($item->getAvailability())
42 ->withStatus(
43 $this->translateLPStatus(
44 $item->getLearningProgressStatus()
45 )
46 );
47 }
48
49 $workflow = $this->ui_factory->listing()->workflow()->linear(
50 $this->lng->txt('curriculum'),
51 $steps
52 );
53 return $workflow;
54 }
55
56 /*
57 ILIAS\UI\Component\Listing\Workflow\Step
58 const NOT_STARTED = 1;
59 const IN_PROGRESS = 2;
60 const SUCCESSFULLY = 3;
61 const UNSUCCESSFULLY= 4;
62
63 Services/Tracking/class.ilLPStatus.php
64 const LP_STATUS_NOT_ATTEMPTED_NUM = 0;
65 const LP_STATUS_IN_PROGRESS_NUM = 1;
66 const LP_STATUS_COMPLETED_NUM = 2;
67 const LP_STATUS_FAILED_NUM = 3;
68 */
69 protected function translateLPStatus(int $il_lp_status) : int
70 {
71 switch ($il_lp_status) {
72 case \ilLPStatus::LP_STATUS_IN_PROGRESS_NUM:
74 break;
75 case \ilLPStatus::LP_STATUS_COMPLETED_NUM:
77 break;
78 case \ilLPStatus::LP_STATUS_FAILED_NUM:
80 break;
81 case \ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM:
82 default:
84 }
85 }
86}
$steps
Definition: latex.php:3
An exception for terminatinating execution or to throw for unit testing.
Class LSUrlBuilder.
Builds the overview (curriculum) of a LearningSequence.
__construct(array $ls_items, ILIAS\UI\Factory $ui_factory, ilLanguage $language, string $goto_command, LSUrlBuilder $url_builder=null)
getLearnerCurriculum(bool $with_action=false)
language handling
$action
Class BaseForm.
Class Factory.