From 26b3fd23f50b02cf53b4f002ac4ecfb269e368ec Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Tue, 23 Apr 2019 15:09:23 +0200 Subject: [PATCH] Visual Console Refactor: changed the default size for the items which use icons Former-commit-id: 689c7e3769ff1554ab2a5c9701d47117a122595a --- .../rest-api/models/VisualConsole/Items/Group.php | 12 +++++++++--- .../rest-api/models/VisualConsole/Items/Icon.php | 12 +++++++++--- .../models/VisualConsole/Items/StaticGraph.php | 12 +++++++++--- 3 files changed, 27 insertions(+), 9 deletions(-) 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 90ff422ad1..8d6f277315 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Group.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Group.php @@ -238,9 +238,15 @@ 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($config['homedir'].'/'.$imagePath); - $data['width'] = $sizeImage[0]; - $data['height'] = $sizeImage[1]; + // TODO: This will be the default behaviour after we finish the + // builder. Don't delete this code. + // $sizeImage = getimagesize($config['homedir'].'/'.$imagePath); + // $data['width'] = $sizeImage[0]; + // $data['height'] = $sizeImage[1]; + // Default value. Will be replaced by a dynamic image size + // calculation after the phase 3. + $data['width'] = 70; + $data['height'] = 70; } $data['html'] = ''; 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 925fad1c06..c0bc7519a9 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/Icon.php @@ -118,9 +118,15 @@ final class Icon 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($config['homedir'].'/'.$imagePath); - $data['width'] = $sizeImage[0]; - $data['height'] = $sizeImage[1]; + // TODO: This will be the default behaviour after we finish the + // builder. Don't delete this code. + // $sizeImage = getimagesize($config['homedir'].'/'.$imagePath); + // $data['width'] = $sizeImage[0]; + // $data['height'] = $sizeImage[1]; + // Default value. Will be replaced by a dynamic image size + // calculation after the phase 3. + $data['width'] = 70; + $data['height'] = 70; } return $data; 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 7167ba8c1c..95672899a1 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/StaticGraph.php @@ -177,9 +177,15 @@ 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($config['homedir'].'/'.$imagePath); - $data['width'] = $sizeImage[0]; - $data['height'] = $sizeImage[1]; + // TODO: This will be the default behaviour after we finish the + // builder. Don't delete this code. + // $sizeImage = getimagesize($config['homedir'].'/'.$imagePath); + // $data['width'] = $sizeImage[0]; + // $data['height'] = $sizeImage[1]; + // Default value. Will be replaced by a dynamic image size + // calculation after the phase 3. + $data['width'] = 70; + $data['height'] = 70; } // Get last value.