Conditions | 8 |
Paths | 6 |
Total Lines | 32 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public static function getLogo(string $theme, int &$width, string $logo_small = '', string $logo = '', bool $only_company = false) |
||
19 | { |
||
20 | // Define company logo directory |
||
21 | $companyOutDir = constant('DOL_DATA_ROOT') . '/mycompany'; |
||
22 | |||
23 | // Check for small logo in thumbs directory |
||
24 | if (!empty($logo_small) && is_readable($companyOutDir . '/logos/thumbs/' . $logo_small)) { |
||
25 | return constant('BASE_URL') . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/thumbs/' . $logo_small); |
||
26 | } |
||
27 | |||
28 | // Check for main logo in logos directory |
||
29 | if (!empty($logo) && is_readable($companyOutDir . '/logos/' . $logo)) { |
||
30 | $width = 128; |
||
31 | return constant('BASE_URL') . '/viewimage.php?cache=1&modulepart=mycompany&file=' . urlencode('logos/' . $logo); |
||
32 | } |
||
33 | |||
34 | if ($only_company) { |
||
35 | return false; |
||
36 | } |
||
37 | |||
38 | // Check for theme specific logo |
||
39 | if (is_readable(constant('DOL_DOCUMENT_ROOT') . '/theme/' . $theme . '/img/alixar_rectangular_logo.svg')) { |
||
40 | return constant('BASE_URL') . '/theme/' . $theme . '/img/alixar_rectangular_logo.svg'; |
||
41 | } |
||
42 | |||
43 | // Check for default logo |
||
44 | if (is_readable(constant('DOL_DOCUMENT_ROOT') . '/theme/common/alixar_rectangular_logo.svg')) { |
||
45 | return constant('BASE_URL') . '/theme/common/alixar_rectangular_logo.svg'; |
||
46 | } |
||
47 | |||
48 | // Return default padlock logo if no other logo is found |
||
49 | return constant('BASE_URL') . '/theme/common/login_logo.png'; |
||
50 | } |
||
52 |