ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLSCurriculumBuilder Class Reference

Builds the overview (curriculum) of a LearningSequence. More...

+ Collaboration diagram for ilLSCurriculumBuilder:

Public Member Functions

 __construct (ilLSLearnerItemsQueries $ls_items, ILIAS\UI\Factory $ui_factory, ilLanguage $language, string $goto_command, LSUrlBuilder $url_builder=null)
 
 getLearnerCurriculum (bool $with_action=false)
 

Protected Member Functions

 translateLPStatus (int $il_lp_status)
 

Detailed Description

Builds the overview (curriculum) of a LearningSequence.

Author
Nils Haagen nils..nosp@m.haag.nosp@m.en@co.nosp@m.ncep.nosp@m.ts-an.nosp@m.d-tr.nosp@m.ainin.nosp@m.g.de

Definition at line 10 of file class.ilLSCurriculumBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ilLSCurriculumBuilder::__construct ( ilLSLearnerItemsQueries  $ls_items,
ILIAS\UI\Factory  $ui_factory,
ilLanguage  $language,
string  $goto_command,
LSUrlBuilder  $url_builder = null 
)

Definition at line 12 of file class.ilLSCurriculumBuilder.php.

18 {
19 $this->ls_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 }

Member Function Documentation

◆ getLearnerCurriculum()

ilLSCurriculumBuilder::getLearnerCurriculum ( bool  $with_action = false)

Definition at line 26 of file class.ilLSCurriculumBuilder.php.

27 {
28 $steps = [];
29 foreach ($this->ls_items->getItems() 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(),
39 $action
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
54 if (count($steps) > 0) {
55 $current_position = max(0, $this->ls_items->getCurrentItemPosition());
56 $workflow = $workflow->withActive($current_position);
57 }
58
59 return $workflow;
60 }
$steps
Definition: latex.php:3

References $steps, and translateLPStatus().

+ Here is the call graph for this function:

◆ translateLPStatus()

ilLSCurriculumBuilder::translateLPStatus ( int  $il_lp_status)
protected

Definition at line 75 of file class.ilLSCurriculumBuilder.php.

75 : int
76 {
77 switch ($il_lp_status) {
78 case \ilLPStatus::LP_STATUS_IN_PROGRESS_NUM:
80 break;
81 case \ilLPStatus::LP_STATUS_COMPLETED_NUM:
83 break;
84 case \ilLPStatus::LP_STATUS_FAILED_NUM:
86 break;
87 case \ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM:
88 default:
90 }
91 }

References ILIAS\UI\Component\Listing\Workflow\Step\IN_PROGRESS, ILIAS\UI\Component\Listing\Workflow\Step\NOT_STARTED, ILIAS\UI\Component\Listing\Workflow\Step\SUCCESSFULLY, and ILIAS\UI\Component\Listing\Workflow\Step\UNSUCCESSFULLY.

Referenced by getLearnerCurriculum().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: