feat(17-04): menu plugin admin with registry types, URL checks and tree reorder

- golem15.menu plugin, tables golem15_menu_menus and golem15_menu_menu_entries with the PHP columns plus a nullable url_pattern (D-02)
- MenuEntry BeforeSave ports PHP beforeSave: nest columns 0, menu from the parent, sort_order after the menu's last
- entry type dropdown: url, divider and the signpost registry types; reference depends on type through signpost.ReferenceOptions
- URL scheme allowlist (errors.url_scheme), target _self or _blank, menu and parent cycle checks
- menu filter, toolbar reorder/create/delete and config_reorder.yaml partitioned by menu
- navigation Menus with Menus and Menu entries, permission golem15.menu.manage_menu, en and pl phrasebooks
- TestMenuAdminSmoke
This commit is contained in:
2026-10-12 17:30:50 +02:00
commit 08f99b8aad
34 changed files with 2197 additions and 0 deletions

38
admin_navigation.go Normal file
View File

@@ -0,0 +1,38 @@
package menu
import (
"git.golem15.com/golem15/sm-menu-plugin/controllers"
"git.golem15.com/golem15/summercms/modules/pact"
)
// Navigation is a top-level Menus item with the side items Menus and Menu
// entries. PHP hung both screens on another plugin's side menu
// (SiteManager), which is not ported; the port registers its own.
func (*Plugin) Navigation() []pact.NavigationItem {
return []pact.NavigationItem{{
Code: "menu",
Label: "golem15.menu::lang.plugin.name",
Icon: "list",
Permissions: []string{"golem15.menu.*"},
Order: 510,
Controller: controllers.MenusControllerID,
SideMenu: []pact.NavigationItem{
{
Code: "menus",
Label: "golem15.menu::lang.models.menu.label_plural",
Icon: "list",
Permissions: []string{controllers.PermissionManageMenu},
Controller: controllers.MenusControllerID,
},
{
Code: "menuentries",
Label: "golem15.menu::lang.models.menuentry.label_plural",
Icon: "list-ordered",
Permissions: []string{controllers.PermissionManageMenu},
Controller: controllers.MenuEntriesControllerID,
},
},
}}
}
var _ pact.HasNavigation = (*Plugin)(nil)