mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-19 08:39:06 +01:00
Fix LS_THEME usage
This commit is contained in:
parent
c66e3bffc8
commit
37e573a247
1 changed files with 16 additions and 2 deletions
|
@ -132,6 +132,20 @@ class LStemplate {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default directory path of files
|
||||
*
|
||||
* Return LS_THEME contanst value or 'default' if not defined
|
||||
*
|
||||
* @retval string The default directory path of files
|
||||
**/
|
||||
public static function getDefaultDir() {
|
||||
if (defined('LS_THEME'))
|
||||
return LS_THEME;
|
||||
else
|
||||
return 'default';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the path of the file to use
|
||||
*
|
||||
|
@ -144,7 +158,7 @@ class LStemplate {
|
|||
**/
|
||||
public static function getFilePath($file, $root_dir, $default_dir=null, $with_nocache=false) {
|
||||
if ($default_dir === null)
|
||||
$default_dir = 'default';
|
||||
$default_dir = self :: getDefaultDir();
|
||||
foreach(self :: $directories as $dir) {
|
||||
if (file_exists($root_dir.'/'.$dir.'/'.$file)) {
|
||||
$path = $root_dir.'/'.$dir.'/'.$file;
|
||||
|
@ -173,7 +187,7 @@ class LStemplate {
|
|||
$path = self :: getFilePath("$image.$ext", self :: $config['image_dir'], False, $with_nocache);
|
||||
if ($path) return $path;
|
||||
}
|
||||
return self :: $config['image_dir']."/default/$image.png";
|
||||
return self :: $config['image_dir']."/".self :: getDefaultDir()."/$image.png";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue