ILIAS  release_8 Revision v8.24
ilLSCurriculumBuilder Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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)
 

Protected Attributes

ilLSLearnerItemsQueries $ls_items
 
ILIAS UI Factory $ui_factory
 
ilLanguage $lng
 
string $goto_command
 
LSUrlBuilder $url_builder
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Builds the overview (curriculum) of a LearningSequence.

Definition at line 24 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 32 of file class.ilLSCurriculumBuilder.php.

38 {
39 $this->ls_items = $ls_items;
40 $this->ui_factory = $ui_factory;
41 $this->lng = $language;
42 $this->goto_command = $goto_command;
43 $this->url_builder = $url_builder;
44 }
ilLSLearnerItemsQueries $ls_items

References $goto_command, $ls_items, $ui_factory, $url_builder, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ getLearnerCurriculum()

ilLSCurriculumBuilder::getLearnerCurriculum ( bool  $with_action = false)

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

47 {
48 $steps = [];
49 foreach ($this->ls_items->getItems() as $item) {
50 $action = '#';
51 if ($with_action) {
52 $action = $this->url_builder->getHref($this->goto_command, $item->getRefId());
53 }
54
55 $steps[] = $this->ui_factory->listing()->workflow()->step(
56 $item->getTitle(),
57 $item->getDescription(),
58 $action
59 )
60 ->withAvailability($item->getAvailability())
61 ->withStatus(
62 $this->translateLPStatus(
63 $item->getLearningProgressStatus()
64 )
65 );
66 }
67
68 $workflow = $this->ui_factory->listing()->workflow()->linear(
69 $this->lng->txt('curriculum'),
70 $steps
71 );
72
73 if ($steps !== []) {
74 $current_position = max(0, $this->ls_items->getCurrentItemPosition());
75 $workflow = $workflow->withActive($current_position);
76 }
77
78 return $workflow;
79 }
This describes a Linear Workflow.
Definition: Linear.php:27
$steps
Definition: latex.php:3

References $steps, ILIAS\Repository\lng(), and translateLPStatus().

+ Here is the call graph for this function:

◆ translateLPStatus()

ilLSCurriculumBuilder::translateLPStatus ( int  $il_lp_status)
protected

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

94 : int
95 {
96 switch ($il_lp_status) {
97 case \ilLPStatus::LP_STATUS_IN_PROGRESS_NUM:
99 case \ilLPStatus::LP_STATUS_COMPLETED_NUM:
101 case \ilLPStatus::LP_STATUS_FAILED_NUM:
103 case \ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM:
104 default:
106 }
107 }

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:

Field Documentation

◆ $goto_command

string ilLSCurriculumBuilder::$goto_command
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilLSCurriculumBuilder::$lng
protected

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

◆ $ls_items

ilLSLearnerItemsQueries ilLSCurriculumBuilder::$ls_items
protected

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

Referenced by __construct().

◆ $ui_factory

ILIAS UI Factory ilLSCurriculumBuilder::$ui_factory
protected

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

Referenced by __construct().

◆ $url_builder

LSUrlBuilder ilLSCurriculumBuilder::$url_builder
protected

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

Referenced by __construct().


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