ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilImagePathResolver Class Reference
+ Inheritance diagram for ilImagePathResolver:
+ Collaboration diagram for ilImagePathResolver:

Public Member Functions

 resolveImagePath (string $image_path)
 
 resolveImagePath (string $image_path)
 

Detailed Description

Definition at line 23 of file class.ilImagePathResolver.php.

Member Function Documentation

◆ resolveImagePath()

ilImagePathResolver::resolveImagePath ( string  $image_path)

Implements ILIAS\UI\Implementation\Render\ImagePathResolver.

Definition at line 25 of file class.ilImagePathResolver.php.

25 : string
26 {
27 global $DIC;
28
29 $styleDefinition = $DIC["styleDefinition"] ?? null;
30
31 // default image
32 $default_img = "./assets/images/" . $image_path;
33
34 // use ilStyleDefinition instead of account to get the current skin and style
35 $current_skin = ilStyleDefinition::getCurrentSkin();
36 $current_style = ilStyleDefinition::getCurrentStyle();
37
38 $skin_img = "";
39
40 if (is_object($styleDefinition) && $current_skin != "default") {
41 $image_dir = $styleDefinition->getImageDirectory($current_style);
42 $skin_img = "./Customizing/skin/" .
43 $current_skin . "/" . $current_style . "/" . $image_dir . "/" . $image_path;
44 }
45
46 if (file_exists($skin_img)) {
47 return $skin_img; // found image for skin and style
48 }
49
50 return $default_img; // take image in default
51 }
static getCurrentSkin()
get the current skin use always this function instead of getting the account's skin the current skin ...
static getCurrentStyle()
get the current style or sub style use always this function instead of getting the account's style th...
global $DIC
Definition: shib_login.php:26

References $DIC, ilStyleDefinition\getCurrentSkin(), and ilStyleDefinition\getCurrentStyle().

+ Here is the call graph for this function:

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