2021-10-12 10:16:36 +02:00
|
|
|
<?php
|
2021-10-18 13:24:30 +02:00
|
|
|
$navLinks = [];
|
|
|
|
$tabContents = [];
|
|
|
|
|
|
|
|
foreach ($settingsProvider as $settingTitle => $settingContent) {
|
|
|
|
$navLinks[] = h($settingTitle);
|
|
|
|
$tabContents[] = $this->element('Settings/category', [
|
|
|
|
'settings' => $settingContent,
|
|
|
|
'includeScrollspy' => false,
|
2021-10-12 10:16:36 +02:00
|
|
|
]);
|
|
|
|
}
|
2021-10-18 13:24:30 +02:00
|
|
|
|
|
|
|
$navLinks[] = __('Bookmarks');
|
|
|
|
$tabContents[] = $this->element('UserSettings/saved-bookmarks', [
|
|
|
|
'bookmarks' => !empty($user->user_settings_by_name['ui.bookmarks']['value']) ? json_decode($user->user_settings_by_name['ui.bookmarks']['value'], true) : []
|
|
|
|
]);
|
2021-10-12 10:16:36 +02:00
|
|
|
|
|
|
|
$tabsOptions = [
|
|
|
|
'vertical' => true,
|
|
|
|
'vertical-size' => 2,
|
|
|
|
'card' => true,
|
|
|
|
'pills' => true,
|
|
|
|
'justify' => 'center',
|
|
|
|
'nav-class' => ['settings-tabs'],
|
|
|
|
'data' => [
|
2021-10-18 13:24:30 +02:00
|
|
|
'navs' => $navLinks,
|
|
|
|
'content' => $tabContents
|
2021-10-12 10:16:36 +02:00
|
|
|
]
|
|
|
|
];
|
|
|
|
$tabs = $this->Bootstrap->tabs($tabsOptions);
|
2021-10-18 13:24:30 +02:00
|
|
|
echo $this->Html->script('settings');
|
2021-10-12 10:16:36 +02:00
|
|
|
?>
|
|
|
|
|
2021-10-18 13:24:30 +02:00
|
|
|
<script>
|
|
|
|
window.settingsFlattened = <?= json_encode($settingsFlattened) ?>;
|
|
|
|
window.saveSettingURL = '/userSettings/saveSetting'
|
|
|
|
</script>
|
|
|
|
|
2021-10-12 10:16:36 +02:00
|
|
|
<h2 class="fw-light"><?= __('Account settings') ?></h2>
|
|
|
|
<div class="p-2">
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<span class="fw-bold font-monospace me-2 fs-5"><?= h($user->username) ?></span>
|
|
|
|
<span><?= h($user->individual->full_name) ?></span>
|
|
|
|
</div>
|
|
|
|
<div class="fw-light"><?= __('Your personnal account') ?></div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
|
|
<?= $tabs ?>
|
|
|
|
</div>
|
|
|
|
</div>
|