diff --git a/pandora_console/include/rest-api/models/VisualConsole/Container.php b/pandora_console/include/rest-api/models/VisualConsole/Container.php index 96cdb52348..ffc0746d97 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Container.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Container.php @@ -223,12 +223,7 @@ final class Container extends Model $backgroundImage = static::extractBackgroundImage($row); if ($backgroundUrl === null && $backgroundImage !== null) { - $backgroundUrl = ui_get_full_url( - 'images/console/background/'.$backgroundImage, - false, - false, - false - ); + $backgroundPath = 'images/console/background/'.$backgroundImage; $width = (int) $row['width']; $height = (int) $row['height']; @@ -238,7 +233,7 @@ final class Container extends Model 'getFile' => 1, 'thumb' => 1, 'thumb_size' => $width.'x'.$height, - 'file' => $backgroundUrl, + 'file' => '../../'.$backgroundPath, ]; $row['backgroundURL'] = ui_get_full_url( 'include/Image/image_functions.php?'.http_build_query($q), @@ -247,7 +242,12 @@ final class Container extends Model false ); } else { - $row['backgroundURL'] = $backgroundUrl; + $row['backgroundURL'] = ui_get_full_url( + $backgroundPath, + false, + false, + false + ); } } diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/Group.php b/pandora_console/include/rest-api/models/VisualConsole/Items/Group.php index 74bf4527f4..2b8c6845d9 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Group.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Group.php @@ -149,8 +149,9 @@ final class Group extends Item // Get the status img src. $groupId = static::extractGroupId($data); $status = \groups_get_status($groupId); + $imagePath = \visual_map_get_image_status_element($data, $status); $data['statusImageSrc'] = \ui_get_full_url( - \visual_map_get_image_status_element($data, $status), + $imagePath, false, false, false @@ -159,7 +160,7 @@ final class Group extends Item // If the width or the height are equal to 0 we will extract them // from the real image size. if ((int) $data['width'] === 0 || (int) $data['height'] === 0) { - $sizeImage = getimagesize($data['statusImageSrc']); + $sizeImage = getimagesize($imagePath); $data['width'] = $sizeImage[0]; $data['height'] = $sizeImage[1]; } diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php b/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php index d92ed4d33f..54e4fa7e01 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php @@ -112,17 +112,13 @@ final class Icon extends Item include_once $config['homedir'].'/include/functions_visual_map.php'; // Get the img src. - $data['imageSrc'] = \ui_get_full_url( - \visual_map_get_image_status_element($data), - false, - false, - false - ); + $imagePath = \visual_map_get_image_status_element($data); + $data['imageSrc'] = \ui_get_full_url($imagePath, false, false, false); // If the width or the height are equal to 0 we will extract them // from the real image size. if ((int) $data['width'] === 0 || (int) $data['height'] === 0) { - $sizeImage = getimagesize($data['imageSrc']); + $sizeImage = getimagesize($imagePath); $data['width'] = $sizeImage[0]; $data['height'] = $sizeImage[1]; } diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php index 6747a7f46a..14c18ada29 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php @@ -179,8 +179,9 @@ final class StaticGraph extends Item } // Get the img src. + $imagePath = \visual_map_get_image_status_element($data); $data['statusImageSrc'] = \ui_get_full_url( - \visual_map_get_image_status_element($data), + $imagePath, false, false, false @@ -189,7 +190,7 @@ final class StaticGraph extends Item // If the width or the height are equal to 0 we will extract them // from the real image size. if ((int) $data['width'] === 0 || (int) $data['height'] === 0) { - $sizeImage = getimagesize($data['statusImageSrc']); + $sizeImage = getimagesize($imagePath); $data['width'] = $sizeImage[0]; $data['height'] = $sizeImage[1]; }