ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilImagePathResolver Class Reference
+ Inheritance diagram for ilImagePathResolver:
+ Collaboration diagram for ilImagePathResolver:

Public Member Functions

 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.

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getCurrentSkin()
get the current skin use always this function instead of getting the account's skin the current skin ...
global $DIC
Definition: shib_login.php:22
static getCurrentStyle()
get the current style or sub style use always this function instead of getting the account's style th...
+ Here is the call graph for this function:

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