mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
Put the list into a function
Former-commit-id: 11e4d0faa3512e46582530f48bab2cfa1031e89f
This commit is contained in:
parent
c49c8bc0b5
commit
a9caebbbf4
@ -76,24 +76,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);
|
||||
}
|
||||
|
@ -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>';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user