ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLSCurriculumBuilder Class Reference

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

+ Collaboration diagram for ilLSCurriculumBuilder:

Public Member Functions

 __construct (array $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 ( array  $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->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 }

References $language.

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->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 }
$steps
Definition: latex.php:3
$action

References $action, $steps, and translateLPStatus().

+ Here is the call graph for this function:

◆ translateLPStatus()

ilLSCurriculumBuilder::translateLPStatus ( int  $il_lp_status)
protected

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

69 : 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 }

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: