2020-06-21 21:29:25 +02:00
|
|
|
<?php
|
2022-02-07 10:48:55 +01:00
|
|
|
|
|
|
|
use Cake\ORM\TableRegistry;
|
2024-05-22 16:10:14 +02:00
|
|
|
use Cake\Routing\Router;
|
2022-02-07 10:48:55 +01:00
|
|
|
|
2021-10-20 11:28:39 +02:00
|
|
|
$bookmarks = !empty($loggedUser->user_settings_by_name['ui.bookmarks']['value']) ? json_decode($loggedUser->user_settings_by_name['ui.bookmarks']['value'], true) : [];
|
2022-02-07 10:48:55 +01:00
|
|
|
$this->userSettingsTable = TableRegistry::getTableLocator()->get('UserSettings');
|
2021-09-06 11:17:25 +02:00
|
|
|
?>
|
|
|
|
|
2021-10-18 13:28:26 +02:00
|
|
|
<h3>
|
|
|
|
<?= $this->Bootstrap->icon('bookmark', [
|
|
|
|
'class' => ['fa-fw']
|
|
|
|
]); ?>
|
|
|
|
<?= __('Bookmarks') ?>
|
|
|
|
</h3>
|
2021-09-06 11:17:25 +02:00
|
|
|
<div class="row">
|
2022-02-07 10:48:55 +01:00
|
|
|
<?php if (!empty($bookmarks)) : ?>
|
2021-10-18 13:28:26 +02:00
|
|
|
<ul class="col-sm-12 col-md-10 col-l-8 col-xl-8 mb-3">
|
|
|
|
<?php foreach ($bookmarks as $bookmark) : ?>
|
|
|
|
<li class="list-group-item">
|
2024-09-17 07:57:25 +02:00
|
|
|
<?php if (!empty($bookmark['url']) && $this->userSettingsTable->validURI($bookmark['url'])): ?>
|
2022-02-07 10:48:55 +01:00
|
|
|
<a href="<?= h($bookmark['url']) ?>" class="w-bold">
|
|
|
|
<?= h($bookmark['label']) ?>
|
|
|
|
</a>
|
|
|
|
<?php else: ?>
|
|
|
|
<span class="w-bold">
|
2024-09-17 07:57:25 +02:00
|
|
|
<?= !empty($bookmark['url']) ? h($bookmark['url']) : '' ?>
|
2022-02-07 10:48:55 +01:00
|
|
|
</span>
|
|
|
|
<?php endif; ?>
|
2024-09-17 07:57:25 +02:00
|
|
|
<span class="ms-3 fw-light"><?= !empty($bookmark['name']) ? h($bookmark['name']): '' ?></span>
|
2021-10-18 13:28:26 +02:00
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
2022-02-07 10:48:55 +01:00
|
|
|
<?php else : ?>
|
2021-10-18 13:28:26 +02:00
|
|
|
<p class="fw-light"><?= __('No bookmarks') ?></p>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3>
|
|
|
|
<?= $this->Bootstrap->icon('chart-bar', [
|
|
|
|
'class' => ['fa-fw']
|
|
|
|
]); ?>
|
|
|
|
<?= __('Activity') ?>
|
|
|
|
</h3>
|
|
|
|
<div class="row">
|
2021-11-12 15:40:03 +01:00
|
|
|
<?php foreach ($statistics as $modelName => $statisticForModel) : ?>
|
2021-11-15 11:46:15 +01:00
|
|
|
<div class="col-sm-6 col-md-5 col-lg-4 col-xl-3 mb-3">
|
2021-09-06 11:17:25 +02:00
|
|
|
<?php
|
2021-10-18 13:28:26 +02:00
|
|
|
$exploded = explode('.', $modelName);
|
|
|
|
$modelForDisplay = $exploded[count($exploded) - 1];
|
|
|
|
$panelTitle = $this->Html->link(
|
|
|
|
h($modelForDisplay),
|
2024-05-22 16:10:14 +02:00
|
|
|
Router::url([
|
2021-10-18 13:28:26 +02:00
|
|
|
'controller' => $modelForDisplay,
|
|
|
|
'action' => 'index',
|
2024-05-22 16:10:14 +02:00
|
|
|
'?' => ['sort' => 'modified', 'direction' => 'desc']
|
2021-10-18 13:28:26 +02:00
|
|
|
]),
|
|
|
|
['class' => 'text-white text-decoration-none fw-light stretched-link']
|
|
|
|
);
|
|
|
|
echo $this->element('widgets/highlight-panel', [
|
|
|
|
'titleHtml' => $panelTitle,
|
2021-11-12 15:40:03 +01:00
|
|
|
'number' => $statisticForModel['created']['amount'],
|
2021-11-23 22:07:31 +01:00
|
|
|
'variation' => $statisticForModel['created']['variation'] ?? null,
|
2021-11-12 15:40:03 +01:00
|
|
|
'timeline' => $statisticForModel ?? []
|
2021-10-18 13:28:26 +02:00
|
|
|
]);
|
2021-09-06 11:17:25 +02:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php endforeach ?>
|
2021-10-20 14:33:22 +02:00
|
|
|
</div>
|