koblog/bl-kernel/admin/views/categories.php

40 lines
1.2 KiB
PHP
Raw Normal View History

<?php defined('BLUDIT') or die('Bludit CMS.'); ?>
2017-04-17 12:49:03 +02:00
<div class="d-flex align-items-center mb-4">
<h2 class="m-0"><i class="bi bi-bookmark"></i><?php $L->p('Categories') ?></h2>
<div class="ms-auto">
<a id="btnNew" class="btn btn-primary btn-sm" href="<?php echo HTML_PATH_ADMIN_ROOT . 'add-category' ?>" role="button"><i class="bi bi-plus-circle"></i><?php $L->p('Add a new category') ?></a>
</div>
</div>
2017-04-17 12:49:03 +02:00
<?php
2017-04-17 12:49:03 +02:00
echo '
<table class="table table-striped mt-3">
<thead>
<tr>
2018-08-08 00:16:35 +02:00
<th class="border-bottom-0" scope="col">'.$L->g('Name').'</th>
<th class="border-bottom-0" scope="col">'.$L->g('Description').'</th>
2018-08-08 00:16:35 +02:00
<th class="border-bottom-0" scope="col">'.$L->g('URL').'</th>
</tr>
</thead>
<tbody>
2017-04-17 12:49:03 +02:00
';
2018-08-02 22:33:53 +02:00
foreach ($categories->keys() as $key) {
try {
$category = new Category($key);
echo '<tr>';
echo '<td class="pt-3 pb-3"><a href="'.HTML_PATH_ADMIN_ROOT.'edit-category/'.$key.'">'.$category->name().'</a></td>';
echo '<td class="pt-3 pb-3"><span>'.$category->description().'</span></td>';
echo '<td class="pt-3 pb-3"><a href="'.$category->permalink().'">'.$category->permalink().'</a></td>';
echo '</tr>';
} catch (Exception $e) {
// Continue
}
2017-04-17 12:49:03 +02:00
}
echo '
</tbody>
2017-04-17 12:49:03 +02:00
</table>
';