Fix logo changes when sending messages from CLI BT#17386

pull/3291/head
Julio Montoya 6 years ago
parent 03fa0e1c7d
commit f5951859e5
  1. 6
      main/inc/lib/api.lib.php
  2. 8
      src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php

@ -5091,6 +5091,12 @@ function api_get_language_info($languageId)
function api_get_visual_theme()
{
static $visual_theme;
// If call from CLI it should be reload.
if ('cli' === PHP_SAPI) {
$visual_theme = null;
}
if (!isset($visual_theme)) {
$cacheAvailable = api_get_configuration_value('apc');
$userThemeAvailable = api_get_setting('user_selected_theme') == 'true';

@ -79,6 +79,12 @@ class ChamiloApi
public static function getPlatformLogoPath($theme = '', $getSysPath = false)
{
static $logoPath;
// If call from CLI it should be reload.
if ('cli' === PHP_SAPI) {
$logoPath = null;
}
if (!isset($logoPath)) {
$theme = empty($theme) ? api_get_visual_theme() : $theme;
$accessUrlId = api_get_current_access_url_id();
@ -86,7 +92,7 @@ class ChamiloApi
$customLogoPath = $themeDir."images/header-logo-custom$accessUrlId.png";
$svgIcons = api_get_setting('icons_mode_svg');
if ($svgIcons == 'true') {
if ($svgIcons === 'true') {
$customLogoPathSVG = substr($customLogoPath, 0, -3).'svg';
if (file_exists(api_get_path(SYS_PUBLIC_PATH)."css/$customLogoPathSVG")) {
if ($getSysPath) {

Loading…
Cancel
Save