From a9caebbbf41f4dfcc6a38e7fc2a7e5093caf7f78 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 18 Feb 2019 10:24:19 +0100 Subject: [PATCH] Put the list into a function Former-commit-id: 11e4d0faa3512e46582530f48bab2cfa1031e89f --- pandora_console/godmode/servers/discovery.php | 18 ++------- .../godmode/wizards/Wizard.main.php | 40 +++++++++++++++++++ 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 024eb39e30..97b9b8a884 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -76,24 +76,12 @@ if ($classname_selected !== null) { if ($classname_selected === null) { // Load classes and print selector. - echo ''; + Wizard::printBigButtonsList($wiz_data); } diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index ecc253ad04..709e601fa5 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -467,4 +467,44 @@ class Wizard } + /** + * Print a big button element (huge image, big text and link). + * + * @param array $data Element data (link, image...). + * + * @return void Only prints the element. + */ + public static function printBigButtonElement($data) + { + if (isset($data['url']) === false) { + $data['url'] = '#'; + } + + ?> +
  • + +
    + +
    +
    +
    +
  • + '; + array_map('self::printBigButtonElement', $list_data); + echo ''; + } }