diff --git a/classes/ColdTrick/GroupTools/TitleMenu.php b/classes/ColdTrick/GroupTools/TitleMenu.php index 298f86b..e56621a 100644 --- a/classes/ColdTrick/GroupTools/TitleMenu.php +++ b/classes/ColdTrick/GroupTools/TitleMenu.php @@ -290,6 +290,7 @@ public static function pendingApproval(\Elgg\Hook $hook) { $allowed_items = [ 'edit', + 'delete', ]; /* @var $return MenuItems */ @@ -297,9 +298,16 @@ public static function pendingApproval(\Elgg\Hook $hook) { // cleanup all items $items = []; - /* @var $menu_item \ElggMenuItem */ foreach ($allowed_items as $name) { - $items[] = $return->get($name); + /* @var $item \ElggMenuItem */ + $item = $return->get($name); + $items[] = $item; + + // some items could be in a submenu + $parent_name = $item->getParentName(); + if (!empty($parent_name)) { + $items[] = $return->get($parent_name); + } } $return->fill($items); @@ -358,6 +366,7 @@ public static function conceptGroup(\Elgg\Hook $hook) { $allowed_items = [ 'edit', + 'delete', ]; /* @var $return MenuItems */ @@ -365,9 +374,16 @@ public static function conceptGroup(\Elgg\Hook $hook) { // cleanup all items $items = []; - /* @var $menu_item \ElggMenuItem */ foreach ($allowed_items as $name) { - $items[] = $return->get($name); + /* @var $item \ElggMenuItem */ + $item = $return->get($name); + $items[] = $item; + + // some items could be in a submenu + $parent_name = $item->getParentName(); + if (!empty($parent_name)) { + $items[] = $return->get($parent_name); + } } $return->fill($items);