Skip to content
Snippets Groups Projects
Unverified Commit c03a542f authored by eileen's avatar eileen :8ball: Committed by GitHub
Browse files

Add Civix example

parent d6bf6ad6
No related branches found
No related tags found
No related merge requests found
...@@ -53,8 +53,21 @@ hook_civicrm_navigationMenu(&$params) ...@@ -53,8 +53,21 @@ hook_civicrm_navigationMenu(&$params)
- bool `active`: whether the item is active - bool `active`: whether the item is active
## Examples ## Examples
* Civix example (recomended) - adds a menu item under 'Administer/System Settings'*
*Consider using the civix implementation in place of these examples (see above).* ```
function omnipaymultiprocessor_civicrm_navigationMenu(&$menu) {
_omnipaymultiprocessor_civix_insert_navigation_menu($menu, 'Administer/System Settings', [
'label' => E::ts('Omnipay Developer Settings'),
'name' => 'omnpay-dev',
'url' => 'civicrm/settings/omnipay-dev',
'permission' => 'administer payment processors',
]);
}
```
*Legacy method if for some reason you cannot use Civix.*
```php ```php
function _getMenuKeyMax($menuArray) { function _getMenuKeyMax($menuArray) {
...@@ -104,7 +117,7 @@ function civicrm_civicrm_navigationMenu(&$params) { ...@@ -104,7 +117,7 @@ function civicrm_civicrm_navigationMenu(&$params) {
} }
``` ```
To add your menu item to an existing menu Legacy example of adding your menu item to an existing menu
```php ```php
function donortrends_civicrm_navigationMenu(&$params) { function donortrends_civicrm_navigationMenu(&$params) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment