feat: extract bookmarks as standalone module with MintyPHP\Module\Bookmarks namespace
Moves bookmarks from core hardcoding into modules/bookmarks/ as a
fully self-contained module, following the same pattern as addressbook.
Module contributions via platform slots:
- aside.tab_panel: bookmark sidebar panel
- topbar.right_item: bookmark toggle button
- layout.body_end_template: bookmark/group dialogs
- layout.head_style: bookmark CSS (form + sidebar)
- runtime.component: bookmark-save and bookmark-panel (phase: late)
- search.resource_item: bookmarks in global search (user-scoped via {{userId}})
Backend fully in module namespace (MintyPHP\Module\Bookmarks\*):
- Service: BookmarkService, BookmarkServicesFactory, BookmarkRepositoryFactory
- Repository: BookmarkRepository, BookmarkGroupRepository, BookmarkNavigationRepository
- Support: BookmarkUrlNormalizer
- Providers: BookmarksSessionProvider, BookmarksLayoutProvider, BookmarksSearchProvider
Core cleanup:
- Removed all bookmark-specific markup from core templates
- Removed core DI registrations for bookmark services
- Removed core bookmark pages, JS, CSS
- AuthSessionTenantContextService delegates to module SessionProvider
Architecture guards:
- NoBookmarksHardcodingTest: verifies zero bookmark references in core
- testModuleClassesUseModuleNamespace: prevents core namespace leakage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
242
modules/bookmarks/templates/aside-bookmarks-panel.phtml
Normal file
242
modules/bookmarks/templates/aside-bookmarks-panel.phtml
Normal file
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Module\Bookmarks\Support\BookmarkUrlNormalizer;
|
||||
|
||||
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
|
||||
$bookmarkNav = is_array($layoutNav['bookmarks.nav'] ?? null) ? $layoutNav['bookmarks.nav'] : [];
|
||||
$bookmarkData = is_array($bookmarkNav['grouped'] ?? null) ? $bookmarkNav['grouped'] : ['groups' => [], 'ungrouped' => []];
|
||||
$bookmarkGroups = is_array($bookmarkData['groups'] ?? null) ? $bookmarkData['groups'] : [];
|
||||
$bookmarkUngrouped = is_array($bookmarkData['ungrouped'] ?? null) ? $bookmarkData['ungrouped'] : [];
|
||||
$currentPath = trim((string) ($bookmarkNav['current_path'] ?? ''));
|
||||
?>
|
||||
<div data-app-bookmark-panel data-app-component="bookmark-panel"
|
||||
data-bookmark-reorder-url="<?php e(lurl('bookmarks/reorder-data')); ?>"
|
||||
data-bookmark-group-delete-url="<?php e(lurl('bookmarks/group-delete-data')); ?>"
|
||||
data-bookmark-delete-url="<?php e(lurl('bookmarks/delete-data')); ?>"
|
||||
data-bookmark-msg-group-delete-confirm="<?php e(t('Delete group and keep bookmarks?')); ?>"
|
||||
data-bookmark-msg-group-deleted="<?php e(t('Group deleted')); ?>"
|
||||
data-bookmark-msg-group-updated="<?php e(t('Group updated')); ?>"
|
||||
data-bookmark-msg-bookmark-delete-confirm="<?php e(t('Delete this bookmark?')); ?>"
|
||||
data-bookmark-msg-bookmark-deleted="<?php e(t('Bookmark deleted')); ?>"
|
||||
data-bookmark-msg-group-action-failed="<?php e(t('Group action failed')); ?>"
|
||||
data-bookmark-msg-bookmark-action-failed="<?php e(t('Bookmark action failed')); ?>"
|
||||
data-bookmark-msg-group-delete-failed="<?php e(t('Group delete failed')); ?>"
|
||||
data-bookmark-msg-bookmark-delete-failed="<?php e(t('Bookmark action failed')); ?>"
|
||||
data-bookmark-msg-reorder-saved="<?php e(t('Reorder saved')); ?>"
|
||||
data-bookmark-msg-reorder-failed="<?php e(t('Reorder failed')); ?>"
|
||||
data-bookmark-label-delete="<?php e(t('Delete')); ?>">
|
||||
<?php if (!$bookmarkGroups && !$bookmarkUngrouped): ?>
|
||||
<?php
|
||||
$emptyState = [
|
||||
'message' => t('No bookmarks yet'),
|
||||
'size' => 'compact',
|
||||
'align' => 'center',
|
||||
];
|
||||
require templatePath('partials/app-empty-state.phtml');
|
||||
?>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$bookmarkRootItems = [];
|
||||
foreach ($bookmarkUngrouped as $bookmark) {
|
||||
$bookmarkId = (int) ($bookmark['id'] ?? 0);
|
||||
if ($bookmarkId <= 0) {
|
||||
continue;
|
||||
}
|
||||
$bookmarkRootItems[] = [
|
||||
'type' => 'bookmark',
|
||||
'id' => $bookmarkId,
|
||||
'sort_order' => (int) ($bookmark['sort_order'] ?? 0),
|
||||
'bookmark' => $bookmark,
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($bookmarkGroups as $group) {
|
||||
$groupId = (int) ($group['id'] ?? 0);
|
||||
if ($groupId <= 0) {
|
||||
continue;
|
||||
}
|
||||
$bookmarkRootItems[] = [
|
||||
'type' => 'group',
|
||||
'id' => $groupId,
|
||||
'sort_order' => (int) ($group['sort_order'] ?? 0),
|
||||
'group' => $group,
|
||||
];
|
||||
}
|
||||
|
||||
usort($bookmarkRootItems, static function (array $a, array $b): int {
|
||||
$sortCmp = ((int) ($a['sort_order'] ?? 0)) <=> ((int) ($b['sort_order'] ?? 0));
|
||||
if ($sortCmp !== 0) {
|
||||
return $sortCmp;
|
||||
}
|
||||
$typeCmp = strcmp((string) ($a['type'] ?? ''), (string) ($b['type'] ?? ''));
|
||||
if ($typeCmp !== 0) {
|
||||
return $typeCmp;
|
||||
}
|
||||
return ((int) ($a['id'] ?? 0)) <=> ((int) ($b['id'] ?? 0));
|
||||
});
|
||||
|
||||
$rootCount = count($bookmarkRootItems);
|
||||
?>
|
||||
<ul data-bookmark-root-list>
|
||||
<?php foreach ($bookmarkRootItems as $rootIndex => $rootItem): ?>
|
||||
<?php
|
||||
$rootType = (string) ($rootItem['type'] ?? '');
|
||||
$rootFirst = $rootIndex === 0;
|
||||
$rootLast = $rootIndex === ($rootCount - 1);
|
||||
?>
|
||||
<?php if ($rootType === 'bookmark'): ?>
|
||||
<?php
|
||||
$bookmark = is_array($rootItem['bookmark'] ?? null) ? $rootItem['bookmark'] : [];
|
||||
$bookmarkId = (int) ($bookmark['id'] ?? 0);
|
||||
$bookmarkName = trim((string) ($bookmark['name'] ?? ''));
|
||||
$bookmarkUrl = trim((string) ($bookmark['url'] ?? ''));
|
||||
$canonicalUrl = BookmarkUrlNormalizer::canonicalizeRelative($bookmarkUrl);
|
||||
$bookmarkActive = $canonicalUrl !== '' && $currentPath === $canonicalUrl;
|
||||
?>
|
||||
<li class="app-sidebar-bookmark-root-item app-sidebar-bookmark-item"
|
||||
data-bookmark-root-kind="bookmark"
|
||||
data-bookmark-root-id="<?php e($bookmarkId); ?>"
|
||||
data-bookmark-id="<?php e($bookmarkId); ?>"
|
||||
data-bookmark-name="<?php e($bookmarkName); ?>"
|
||||
data-bookmark-group-id="">
|
||||
<a href="<?php e(lurl($bookmarkUrl)); ?>"
|
||||
class="<?php e($bookmarkActive ? 'active' : ''); ?>"
|
||||
<?php echo $bookmarkActive ? 'aria-current="page"' : ''; ?>>
|
||||
<?php e($bookmarkName); ?>
|
||||
</a>
|
||||
<details class="app-sidebar-bookmark-action-menu" data-bookmark-action-menu>
|
||||
<summary class="icon-button" title="<?php e(t('Actions')); ?>" aria-label="<?php e(t('Actions')); ?>">
|
||||
<i class="bi bi-three-dots"></i>
|
||||
</summary>
|
||||
<ul class="app-sidebar-bookmark-action-menu-list" role="menu" aria-label="<?php e(t('Bookmark actions')); ?>">
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-item-action="edit">
|
||||
<?php e(t('Edit')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-item-action="move-up" data-bookmark-item-action-scope="root" <?php if ($rootFirst): ?>disabled<?php endif; ?>>
|
||||
<?php e(t('Move bookmark up')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-item-action="move-down" data-bookmark-item-action-scope="root" <?php if ($rootLast): ?>disabled<?php endif; ?>>
|
||||
<?php e(t('Move bookmark down')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" class="app-sidebar-bookmark-action-danger" data-bookmark-item-action="delete">
|
||||
<?php e(t('Delete bookmark')); ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$group = is_array($rootItem['group'] ?? null) ? $rootItem['group'] : [];
|
||||
$groupId = (int) ($group['id'] ?? 0);
|
||||
$groupName = trim((string) ($group['name'] ?? ''));
|
||||
$groupIcon = trim((string) ($group['icon'] ?? 'bi-folder'));
|
||||
$groupBookmarks = is_array($group['bookmarks'] ?? null) ? $group['bookmarks'] : [];
|
||||
?>
|
||||
<li class="app-sidebar-group app-sidebar-bookmark-group app-sidebar-bookmark-root-item"
|
||||
data-bookmark-root-kind="group"
|
||||
data-bookmark-root-id="<?php e($groupId); ?>"
|
||||
data-bookmark-group-id="<?php e($groupId); ?>"
|
||||
data-bookmark-group-name="<?php e($groupName); ?>"
|
||||
data-bookmark-group-icon="<?php e($groupIcon); ?>">
|
||||
<div class="app-sidebar-bookmark-group-shell">
|
||||
<div class="app-sidebar-bookmark-group-header">
|
||||
<small class="app-sidebar-bookmark-group-label">
|
||||
<i class="bi <?php e($groupIcon); ?>" aria-hidden="true"></i>
|
||||
<span><?php e($groupName); ?></span>
|
||||
</small>
|
||||
<details class="app-sidebar-bookmark-action-menu app-sidebar-bookmark-group-menu" data-bookmark-action-menu>
|
||||
<summary class="icon-button" title="<?php e(t('Actions')); ?>" aria-label="<?php e(t('Actions')); ?>">
|
||||
<i class="bi bi-three-dots"></i>
|
||||
</summary>
|
||||
<ul class="app-sidebar-bookmark-action-menu-list" role="menu" aria-label="<?php e(t('Group actions')); ?>">
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-group-action="edit">
|
||||
<?php e(t('Edit')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-group-action="move-up" <?php if ($rootFirst): ?>disabled<?php endif; ?>>
|
||||
<?php e(t('Move group up')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-group-action="move-down" <?php if ($rootLast): ?>disabled<?php endif; ?>>
|
||||
<?php e(t('Move group down')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" class="app-sidebar-bookmark-action-danger" data-bookmark-group-action="delete">
|
||||
<?php e(t('Delete group')); ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</div>
|
||||
<?php if ($groupBookmarks): ?>
|
||||
<ul data-bookmark-group-bookmark-list>
|
||||
<?php $groupBookmarkCount = count($groupBookmarks); ?>
|
||||
<?php foreach ($groupBookmarks as $bookmarkIndex => $bookmark): ?>
|
||||
<?php
|
||||
$bookmarkId = (int) ($bookmark['id'] ?? 0);
|
||||
$bookmarkName = trim((string) ($bookmark['name'] ?? ''));
|
||||
$bookmarkUrl = trim((string) ($bookmark['url'] ?? ''));
|
||||
$canonicalUrl = BookmarkUrlNormalizer::canonicalizeRelative($bookmarkUrl);
|
||||
$bookmarkActive = $canonicalUrl !== '' && $currentPath === $canonicalUrl;
|
||||
$bookmarkFirst = $bookmarkIndex === 0;
|
||||
$bookmarkLast = $bookmarkIndex === ($groupBookmarkCount - 1);
|
||||
?>
|
||||
<li class="app-sidebar-bookmark-item"
|
||||
data-bookmark-id="<?php e($bookmarkId); ?>"
|
||||
data-bookmark-name="<?php e($bookmarkName); ?>"
|
||||
data-bookmark-group-id="<?php e($groupId); ?>">
|
||||
<a href="<?php e(lurl($bookmarkUrl)); ?>"
|
||||
class="<?php e($bookmarkActive ? 'active' : ''); ?>"
|
||||
<?php echo $bookmarkActive ? 'aria-current="page"' : ''; ?>>
|
||||
<?php e($bookmarkName); ?>
|
||||
</a>
|
||||
<details class="app-sidebar-bookmark-action-menu" data-bookmark-action-menu>
|
||||
<summary class="icon-button" title="<?php e(t('Actions')); ?>" aria-label="<?php e(t('Actions')); ?>">
|
||||
<i class="bi bi-three-dots"></i>
|
||||
</summary>
|
||||
<ul class="app-sidebar-bookmark-action-menu-list" role="menu" aria-label="<?php e(t('Bookmark actions')); ?>">
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-item-action="edit">
|
||||
<?php e(t('Edit')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-item-action="move-up" <?php if ($bookmarkFirst): ?>disabled<?php endif; ?>>
|
||||
<?php e(t('Move bookmark up')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" data-bookmark-item-action="move-down" <?php if ($bookmarkLast): ?>disabled<?php endif; ?>>
|
||||
<?php e(t('Move bookmark down')); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" role="menuitem" class="app-sidebar-bookmark-action-danger" data-bookmark-item-action="delete">
|
||||
<?php e(t('Delete bookmark')); ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
98
modules/bookmarks/templates/bookmark-dialogs.phtml
Normal file
98
modules/bookmarks/templates/bookmark-dialogs.phtml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Module\Bookmarks\Service\BookmarkService;
|
||||
|
||||
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
|
||||
$bookmarkNav = is_array($layoutNav['bookmarks.nav'] ?? null) ? $layoutNav['bookmarks.nav'] : [];
|
||||
$bookmarkData = is_array($bookmarkNav['grouped'] ?? null) ? $bookmarkNav['grouped'] : [];
|
||||
$bookmarkGroups = is_array($bookmarkData['groups'] ?? null) ? $bookmarkData['groups'] : [];
|
||||
?>
|
||||
<dialog
|
||||
data-app-bookmark-dialog
|
||||
data-app-component="bookmark-save"
|
||||
data-max-message="<?php e(t('Maximum bookmarks reached')); ?>"
|
||||
data-title-create="<?php e(t('Bookmarks')); ?>"
|
||||
data-title-edit="<?php e(t('Bookmarks')); ?>"
|
||||
data-label-save="<?php e(t('Save')); ?>"
|
||||
data-label-update="<?php e(t('Save')); ?>"
|
||||
data-msg-saved="<?php e(t('Bookmark saved')); ?>"
|
||||
data-msg-updated="<?php e(t('Bookmark updated')); ?>"
|
||||
data-msg-group-created="<?php e(t('Group created')); ?>"
|
||||
data-msg-error-generic="<?php e(t('Bookmark action failed')); ?>"
|
||||
data-msg-group-create-failed="<?php e(t('Group action failed')); ?>"
|
||||
data-msg-name-required="<?php e(t('Bookmark name is required')); ?>"
|
||||
data-msg-url-required="<?php e(t('Bookmark URL is invalid')); ?>"
|
||||
data-msg-group-not-found="<?php e(t('Group not found')); ?>"
|
||||
aria-labelledby="app-bookmark-dialog-title"
|
||||
>
|
||||
<article class="app-bookmark-dialog">
|
||||
<header>
|
||||
<h2 id="app-bookmark-dialog-title"><?php e(t('Bookmarks')); ?></h2>
|
||||
<button type="button" class="close" data-bookmark-dialog-close aria-label="<?php e(t('Close')); ?>" title="<?php e(t('Close')); ?>"></button>
|
||||
</header>
|
||||
<form data-bookmark-save-form>
|
||||
<label for="bookmark-name"><?php e(t('Name')); ?></label>
|
||||
<input type="text" id="bookmark-name" name="name" maxlength="120" required
|
||||
placeholder="<?php e(t('Bookmark name')); ?>">
|
||||
<label for="bookmark-group"><?php e(t('Assign to group')); ?></label>
|
||||
<select id="bookmark-group" name="group_id" data-bookmark-group-select>
|
||||
<option value=""><?php e(t('No group')); ?></option>
|
||||
<?php foreach ($bookmarkGroups as $group):
|
||||
$groupId = (int) ($group['id'] ?? 0);
|
||||
$groupName = trim((string) ($group['name'] ?? ''));
|
||||
if ($groupId <= 0 || $groupName === '') { continue; }
|
||||
?>
|
||||
<option value="<?php e($groupId); ?>"><?php e($groupName); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<button type="button" class="outline secondary app-bookmark-new-group-btn" data-bookmark-new-group>
|
||||
<i class="bi bi-plus"></i> <?php e(t('New group')); ?>
|
||||
</button>
|
||||
<footer>
|
||||
<button type="button" class="secondary outline" data-bookmark-dialog-close><?php e(t('Cancel')); ?></button>
|
||||
<button type="submit" class="app-action-success" data-bookmark-submit-label><?php e(t('Save')); ?></button>
|
||||
</footer>
|
||||
</form>
|
||||
</article>
|
||||
</dialog>
|
||||
|
||||
<dialog
|
||||
data-app-bookmark-group-dialog
|
||||
data-title-create="<?php e(t('New group')); ?>"
|
||||
data-title-edit="<?php e(t('Edit group')); ?>"
|
||||
data-label-save="<?php e(t('Save')); ?>"
|
||||
data-label-update="<?php e(t('Save')); ?>"
|
||||
data-max-message="<?php e(t('Maximum groups reached')); ?>"
|
||||
data-msg-created="<?php e(t('Group created')); ?>"
|
||||
data-msg-updated="<?php e(t('Group updated')); ?>"
|
||||
data-msg-error-generic="<?php e(t('Group action failed')); ?>"
|
||||
data-msg-name-required="<?php e(t('Group name is required')); ?>"
|
||||
aria-labelledby="app-bookmark-group-dialog-title"
|
||||
>
|
||||
<article class="app-bookmark-dialog app-bookmark-group-dialog">
|
||||
<header>
|
||||
<h2 id="app-bookmark-group-dialog-title"><?php e(t('New group')); ?></h2>
|
||||
<button type="button" class="close" data-bookmark-group-dialog-close aria-label="<?php e(t('Close')); ?>" title="<?php e(t('Close')); ?>"></button>
|
||||
</header>
|
||||
<form data-bookmark-group-save-form>
|
||||
<label for="bookmark-group-name"><?php e(t('Group name')); ?></label>
|
||||
<input type="text" id="bookmark-group-name" name="name" maxlength="100" required
|
||||
placeholder="<?php e(t('Group name')); ?>">
|
||||
<label><?php e(t('Icon')); ?></label>
|
||||
<div class="app-bookmark-group-icon-picker" data-bookmark-group-icon-picker>
|
||||
<?php foreach (BookmarkService::allowedGroupIcons() as $allowedIcon): ?>
|
||||
<button type="button" class="app-bookmark-group-icon-option"
|
||||
data-icon="<?php e($allowedIcon); ?>"
|
||||
aria-label="<?php e($allowedIcon); ?>">
|
||||
<i class="bi <?php e($allowedIcon); ?>"></i>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<input type="hidden" name="icon" value="bi-folder">
|
||||
<footer>
|
||||
<button type="button" class="secondary outline" data-bookmark-group-dialog-close><?php e(t('Cancel')); ?></button>
|
||||
<button type="submit" class="app-action-success" data-bookmark-group-submit-label><?php e(t('Save')); ?></button>
|
||||
</footer>
|
||||
</form>
|
||||
</article>
|
||||
</dialog>
|
||||
46
modules/bookmarks/templates/topbar-bookmark-button.phtml
Normal file
46
modules/bookmarks/templates/topbar-bookmark-button.phtml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Module\Bookmarks\Support\BookmarkUrlNormalizer;
|
||||
|
||||
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
|
||||
$bookmarkNav = is_array($layoutNav['bookmarks.nav'] ?? null) ? $layoutNav['bookmarks.nav'] : [];
|
||||
$bookmarkData = is_array($bookmarkNav['grouped'] ?? null) ? $bookmarkNav['grouped'] : ['groups' => [], 'ungrouped' => []];
|
||||
$bookmarkGroups = is_array($bookmarkData['groups'] ?? null) ? $bookmarkData['groups'] : [];
|
||||
$bookmarkUngrouped = is_array($bookmarkData['ungrouped'] ?? null) ? $bookmarkData['ungrouped'] : [];
|
||||
$currentPath = trim((string) ($bookmarkNav['current_path'] ?? ''));
|
||||
|
||||
$existing = null;
|
||||
if ($currentPath !== '') {
|
||||
foreach ($bookmarkUngrouped as $bookmark) {
|
||||
$bookmarkUrl = BookmarkUrlNormalizer::canonicalizeRelative((string) ($bookmark['url'] ?? ''));
|
||||
if ($bookmarkUrl !== '' && $bookmarkUrl === $currentPath) {
|
||||
$existing = $bookmark;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($existing === null) {
|
||||
foreach ($bookmarkGroups as $group) {
|
||||
foreach ((is_array($group['bookmarks'] ?? null) ? $group['bookmarks'] : []) as $bookmark) {
|
||||
$bookmarkUrl = BookmarkUrlNormalizer::canonicalizeRelative((string) ($bookmark['url'] ?? ''));
|
||||
if ($bookmarkUrl !== '' && $bookmarkUrl === $currentPath) {
|
||||
$existing = $bookmark;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<button type="button" data-bookmark-open-dialog
|
||||
aria-label="<?php e($existing ? t('Edit bookmark') : t('Bookmarks')); ?>"
|
||||
data-tooltip="<?php e($existing ? t('Edit bookmark') : t('Bookmarks')); ?>" data-tooltip-pos="bottom"
|
||||
<?php if ($existing): ?>
|
||||
data-bookmark-existing-id="<?php e((int) ($existing['id'] ?? 0)); ?>"
|
||||
data-bookmark-existing-name="<?php e(trim((string) ($existing['name'] ?? ''))); ?>"
|
||||
data-bookmark-existing-group="<?php e($existing['group_id'] ?? ''); ?>"
|
||||
<?php endif; ?>>
|
||||
<i class="bi <?php e($existing ? 'bi-bookmark-check-fill' : 'bi-bookmark-plus'); ?>"></i>
|
||||
</button>
|
||||
</li>
|
||||
Reference in New Issue
Block a user