menu

Menu queries and removal support. The query paths reuse the menu filters:

PathResult
rsc/+idMenu resource for a page, using the menu_rsc notification, hasmenu, then main_menu.
ids/+menu_idAll resource ids in a menu, including invisible or non-existing ids, as with menu_ids.
trail/+menu_id/+idBreadcrumb ids through the visible menu, including the requested page.
subtree/+menu_id/+idVisible children below the requested page, excluding the page itself.

Resource arguments accept ids or names. For example, m.menu.rsc[id], m.menu.ids.main_menu, m.menu.trail.main_menu[id], and m.menu.subtree.main_menu[id]. Return values and ordering follow the respective filters; ids does not filter individual menu items for visibility.

removal_status accepts a list of resource ids as its payload, including every descendant of the menu item being removed. It returns:

  • remove_only: no dependent pages are included, without revision backup.
  • recover_menu: no dependent pages are included, with revision backup.
  • delete_dependent: dependent pages may be permanently deleted.
  • recover_dependent: dependent pages may be deleted but can be recovered.

The dependency check uses only the is_dependent flag. It does not inspect incoming connections, so the warning indicates possible deletion.

Edit on GitHub