19 declare(strict_types=1);
50 if (!$renderer || !$factory) {
52 $renderer = $DIC->ui()->renderer();
53 $factory = $DIC->ui()->factory();
58 if (self::$instance_variant_scorm) {
59 return self::$instance_variant_scorm;
64 if (self::$instance_variant_short) {
65 return self::$instance_variant_short;
70 if (self::$instance_variant_long) {
71 return self::$instance_variant_long;
76 throw new ilLPException(
"No such variant of the LP icons exists.");
87 $this->image_path_in_progress = $this->
buildImagePath(
'scorm/incomplete.svg');
88 $this->image_path_completed = $this->
buildImagePath(
'scorm/complete.svg');
89 $this->image_path_not_attempted = $this->
buildImagePath(
'scorm/not_attempted.svg');
90 $this->image_path_failed = $this->
buildImagePath(
'scorm/failed.svg');
91 $this->image_path_asset = $this->
buildImagePath(
'scorm/asset.svg');
92 $this->image_path_running = $this->
buildImagePath(
'scorm/running.svg');
96 $this->image_path_in_progress = $this->
buildImagePath(
'learning_progress/short/in_progress.svg');
97 $this->image_path_completed = $this->
buildImagePath(
'learning_progress/short/completed.svg');
98 $this->image_path_not_attempted = $this->
buildImagePath(
'learning_progress/short/not_attempted.svg');
99 $this->image_path_failed = $this->
buildImagePath(
'learning_progress/short/failed.svg');
100 $this->image_path_asset = $this->
buildImagePath(
'learning_progress/short/asset.svg');
101 $this->image_path_running = $this->
buildImagePath(
'learning_progress/short/running.svg');
105 $this->image_path_in_progress = $this->
buildImagePath(
'learning_progress/in_progress.svg');
106 $this->image_path_completed = $this->
buildImagePath(
'learning_progress/completed.svg');
107 $this->image_path_not_attempted = $this->
buildImagePath(
'learning_progress/not_attempted.svg');
108 $this->image_path_failed = $this->
buildImagePath(
'learning_progress/failed.svg');
112 throw new ilLPException(
"No such variant of the LP icons exists.");
146 if ($this->image_path_asset) {
149 throw new ilLPException(
"A long variant of the 'asset' LP icon does not exist.");
157 if ($this->image_path_running) {
160 throw new ilLPException(
"A long variant of the 'running' LP icon does not exist.");
165 if ($this === self::$instance_variant_scorm) {
166 throw new ilLPException(
"SCORM variants of the LP icons cannot be rendered.");
const LP_STATUS_COMPLETED_NUM
string $image_path_failed
string $image_path_completed
string $image_path_running
Interface Observer Contains several chained tasks and infos about them.
const LP_STATUS_NOT_ATTEMPTED
getImagePathNotAttempted()
const LP_STATUS_IN_PROGRESS_NUM
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
static self $instance_variant_scorm
string $image_path_in_progress
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renderIconForStatus(int $a_status, ?ilLanguage $a_lng=null)
Returns the rendered icon with alt text.
const LP_STATUS_IN_PROGRESS
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getIconComponent(string $path, string $alt)
__construct(int $variant, \ILIAS\UI\Renderer $renderer, \ILIAS\UI\Factory $factory)
const ICON_VARIANT_DEFAULT
getImagePathRunning()
A long variant of this icon is not available.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
renderIcon(string $path, string $alt)
ILIAS UI Factory $factory
ILIAS UI Renderer $renderer
static self $instance_variant_long
const LP_STATUS_NOT_ATTEMPTED_NUM
string $image_path_not_attempted
lookupNumStatus(string $a_status)
Transforms the string constants for the status to their interger equivalent.
buildImagePath(string $image_name)
getImagePathAsset()
A long variant of this icon is not available.
const LP_STATUS_COMPLETED
static self $instance_variant_short
const LP_STATUS_FAILED_NUM
getImagePathForStatus(int $a_status)