2020-06-21 21:29:25 +02:00
|
|
|
<?php
|
2022-02-07 10:48:55 +01:00
|
|
|
|
|
|
|
use Cake\ORM\TableRegistry;
|
|
|
|
|
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">
|
2022-02-07 10:48:55 +01:00
|
|
|
<?php if ($this->userSettingsTable->validURI($bookmark['url'])): ?>
|
|
|
|
<a href="<?= h($bookmark['url']) ?>" class="w-bold">
|
|
|
|
<?= h($bookmark['label']) ?>
|
|
|
|
</a>
|
|
|
|
<?php else: ?>
|
|
|
|
<span class="w-bold">
|
|
|
|
<?= h($bookmark['url']) ?>
|
|
|
|
</span>
|
|
|
|
<?php endif; ?>
|
2021-10-18 13:28:26 +02:00
|
|
|
<span class="ms-3 fw-light"><?= h($bookmark['name']) ?></span>
|
|
|
|
</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),
|
|
|
|
$this->Url->build([
|
|
|
|
'controller' => $modelForDisplay,
|
|
|
|
'action' => 'index',
|
|
|
|
]),
|
|
|
|
['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>
|