Skip to content

Commit

Permalink
Simplify managed menu
Browse files Browse the repository at this point in the history
Domain wrangling is no longer needed thanks to civicrm/civicrm-core#27876
  • Loading branch information
colemanw committed Oct 24, 2023
1 parent 8be738f commit ec64f7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<version>1.5</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.49</ver>
<ver>5.68</ver>
</compatibility>
<comments>Once installed, click on "Recent" in the menubar to access your recently viewed contacts, activities, contributions, etc.</comments>
<civix>
Expand Down
20 changes: 6 additions & 14 deletions managed/Navigation_recent_items.mgd.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?php
use CRM_Recentmenu_ExtensionUtil as E;

$menuItems = [];
$domains = \Civi\Api4\Domain::get(FALSE)
->addSelect('id')
->execute();
foreach ($domains as $domain) {
$menuItems[] = [
'name' => 'Navigation_recent_items_domain_' . $domain['id'],
return [
[
'name' => 'Navigation_recent_items',
'entity' => 'Navigation',
'cleanup' => 'always',
'update' => 'unmodified',
Expand All @@ -19,13 +15,9 @@
'url' => NULL,
'icon' => 'crm-i fa-history',
'permission' => ['access CiviCRM'],
'permission_operator' => '',
'is_active' => TRUE,
'has_separator' => NULL,
'parent_id' => NULL,
'domain_id' => $domain['id'],
],
'match' => ['name', 'domain_id'],
],
];
}
return $menuItems;
],
];

0 comments on commit ec64f7d

Please sign in to comment.