Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
brienne
Developer Documentation
Commits
db4cb522
Unverified
Commit
db4cb522
authored
6 years ago
by
totten
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #561 from eileenmcnaughton/patch-7
Add Civix example
parents
47a7b105
c03a542f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/hooks/hook_civicrm_navigationMenu.md
+15
-2
15 additions, 2 deletions
docs/hooks/hook_civicrm_navigationMenu.md
with
15 additions
and
2 deletions
docs/hooks/hook_civicrm_navigationMenu.md
+
15
−
2
View file @
db4cb522
...
@@ -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
add
ing
your menu item to an existing menu
```
php
```
php
function
donortrends_civicrm_navigationMenu
(
&
$params
)
{
function
donortrends_civicrm_navigationMenu
(
&
$params
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment