From 2c2a0b4d7a2ff1cc9050f81e7a50959609719107 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 22 Mar 2022 09:29:02 +0100 Subject: [PATCH] fixed CV in console mobile metaconsole pandora_enterprise#8676 --- .../mobile/operation/visualmaps.php | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/pandora_console/mobile/operation/visualmaps.php b/pandora_console/mobile/operation/visualmaps.php index 8ec70afb59..355b0de513 100644 --- a/pandora_console/mobile/operation/visualmaps.php +++ b/pandora_console/mobile/operation/visualmaps.php @@ -74,6 +74,13 @@ class Visualmaps */ private $type = 0; + /** + * CV favourites. + * + * @var boolean + */ + private $favourite = true; + /** * Builder. @@ -215,9 +222,42 @@ class Visualmaps private function listVisualmapsHtml() { $system = System::getInstance(); + $this->favourite = (bool) $system->getRequest('favourite', true); $ui = Ui::getInstance(); - $visualmaps = visual_map_get_user_layouts(false, false, false, true, true); + $visualmaps = visual_map_get_user_layouts( + false, + false, + false, + true, + $this->favourite + ); + + if ($this->favourite === true) { + $ui->contentAddHtml( + $ui->createButton( + [ + 'icon' => '', + 'pos' => 'right', + 'text' => __('All visualmaps'), + 'href' => 'index.php?page=visualmaps&favourite=0', + 'class' => '', + ] + ) + ); + } else { + $ui->contentAddHtml( + $ui->createButton( + [ + 'icon' => '', + 'pos' => 'right', + 'text' => __('Favourite visualmaps'), + 'href' => 'index.php?page=visualmaps&favourite=1', + 'class' => '', + ] + ) + ); + } if (empty($visualmaps) === true) { $ui->contentAddHtml('

'.__('No maps defined').'

');