19declare(strict_types=1);
58 if (self::$instance_variant_scorm) {
64 if (self::$instance_variant_short) {
70 if (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.");
174 return $this->
factory->symbol()->icon()->custom($path, $alt, \
ILIAS\UI\
Component\Symbol\Icon\Icon::SMALL);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Caches and supplies the paths to the learning progress status images.
string $image_path_running
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
string $image_path_failed
string $image_path_in_progress
static self $instance_variant_short
string $image_path_not_attempted
const ICON_VARIANT_DEFAULT
getIconComponent(string $path, string $alt)
ILIAS UI Renderer $renderer
renderIconForStatus(int $a_status, ?ilLanguage $a_lng=null)
Returns the rendered icon with alt text.
ILIAS UI Factory $factory
getImagePathRunning()
A long variant of this icon is not available.
static self $instance_variant_scorm
renderIcon(string $path, string $alt)
getImagePathForStatus(int $a_status)
__construct(int $variant, \ILIAS\UI\Renderer $renderer, \ILIAS\UI\Factory $factory)
getImagePathAsset()
A long variant of this icon is not available.
buildImagePath(string $image_name)
lookupNumStatus(string $a_status)
Transforms the string constants for the status to their interger equivalent.
static self $instance_variant_long
getImagePathNotAttempted()
string $image_path_completed
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_COMPLETED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.