Merge branch 'ent-3431-discovery-host-devices' into ent-1798-monitorizacion-aws-amazon

Former-commit-id: 11a9f65a87b0b479791aa76e4936cebfb5ab7424
This commit is contained in:
fermin831 2019-02-18 10:24:35 +01:00
commit a6bbd17423
2 changed files with 43 additions and 15 deletions

View File

@ -79,24 +79,12 @@ if ($classname_selected !== null) {
if ($classname_selected === null) {
// Load classes and print selector.
echo '<ul>';
$wiz_data = [];
foreach ($classes as $classpath) {
$classname = basename($classpath, '.class.php');
$obj = new $classname();
$wiz_data = $obj->load();
?>
<li class="discovery">
<a href="<?php echo $wiz_data['url']; ?>">
<div class="data_container">
<?php html_print_image($wiz_data['icon']); ?>
<br><label id="text_wizard"><?php echo io_safe_output($wiz_data['label']); ?></label>
</div>
</a>
</li>
<?php
$wiz_data[] = $obj->load();
}
echo '</ul>';
Wizard::printBigButtonsList($wiz_data);
}

View File

@ -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'] = '#';
}
?>
<li class="discovery">
<a href="<?php echo $data['url']; ?>">
<div class="data_container">
<?php html_print_image($data['icon']); ?>
<br><label id="text_wizard">
<?php echo io_safe_output($data['label']); ?>
</label>
</div>
</a>
</li>
<?php
}
/**
* Print a list of big buttons elements.
*
* @param array $list_data Array of data for printBigButtonElement.
*
* @return void Print the full list.
*/
public static function printBigButtonsList($list_data) {
echo '<ul>';
array_map('self::printBigButtonElement', $list_data);
echo '</ul>';
}
}