koblog/bl-kernel/admin/controllers/developers.php

53 lines
1.6 KiB
PHP
Raw Normal View History

<?php defined('KOBLOG') or die('Koblog CMS.');
// ============================================================================
// Check role
// ============================================================================
2018-05-20 21:48:43 +02:00
checkRole(array('admin'));
// ============================================================================
// Functions
// ============================================================================
// This function is used on the VIEW to show the tables
function printTable($title, $array) {
2025-01-18 20:04:58 +01:00
echo '<h2 class="mb-2">'.$title.'</h2>';
echo '<div class="card mb-4">';
echo '<table class="table m-0">
<tbody>
';
2017-09-22 23:11:08 +02:00
foreach ($array as $key=>$value) {
if($value===false) { $value = 'false'; }
elseif($value===true) { $value = 'true'; }
2025-01-18 20:04:58 +01:00
echo '<tr class="card-tablebody">';
echo '<td>'.$key.'</td>';
2017-09-22 23:11:08 +02:00
if (is_array($value)) {
echo '<td>'.json_encode($value).'</td>';
} else {
echo '<td>'.Sanitize::html($value).'</td>';
}
echo '</tr>';
}
echo '
</tbody>
</table>
2025-01-18 20:04:58 +01:00
</div>
';
}
// ============================================================================
// Main before POST
// ============================================================================
// ============================================================================
// POST Method
// ============================================================================
// ============================================================================
// Main after POST
// ============================================================================
$layout['title'] .= ' - '.$L->g('Developers');