Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
Development
CiviCRM Core
Commits
6c3405ee
Unverified
Commit
6c3405ee
authored
5 years ago
by
colemanw
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15956 from colemanw/removeFn
Remove unused functions
parents
6d90d8ea
e45ab7b5
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
CRM/Core/BAO/Navigation.php
+0
-93
0 additions, 93 deletions
CRM/Core/BAO/Navigation.php
with
0 additions
and
93 deletions
CRM/Core/BAO/Navigation.php
+
0
−
93
View file @
6c3405ee
...
...
@@ -309,50 +309,6 @@ FROM civicrm_navigation WHERE domain_id = $domainID";
}
}
/**
* Recursively check child menus.
*
* @param array $value
* @param string $navigationString
* @param array $skipMenuItems
*
* @return string
*/
public
static
function
recurseNavigation
(
&
$value
,
&
$navigationString
,
$skipMenuItems
)
{
if
(
!
empty
(
$value
[
'child'
]))
{
$navigationString
.
=
'<ul>'
;
}
else
{
$navigationString
.
=
'</li>'
;
//locate separator after
if
(
isset
(
$value
[
'attributes'
][
'separator'
])
&&
$value
[
'attributes'
][
'separator'
]
==
1
)
{
$navigationString
.
=
'<li class="menu-separator"></li>'
;
}
}
if
(
!
empty
(
$value
[
'child'
]))
{
foreach
(
$value
[
'child'
]
as
$val
)
{
$name
=
self
::
getMenuName
(
$val
,
$skipMenuItems
);
if
(
$name
)
{
//locate separator before
if
(
isset
(
$val
[
'attributes'
][
'separator'
])
&&
$val
[
'attributes'
][
'separator'
]
==
2
)
{
$navigationString
.
=
'<li class="menu-separator"></li>'
;
}
$removeCharacters
=
[
'/'
,
'!'
,
'&'
,
'*'
,
' '
,
'('
,
')'
,
'.'
];
$navigationString
.
=
'<li class="crm-'
.
str_replace
(
$removeCharacters
,
'_'
,
$val
[
'attributes'
][
'label'
])
.
'">'
.
$name
;
self
::
recurseNavigation
(
$val
,
$navigationString
,
$skipMenuItems
);
}
}
}
if
(
!
empty
(
$value
[
'child'
]))
{
$navigationString
.
=
'</ul></li>'
;
if
(
isset
(
$value
[
'attributes'
][
'separator'
])
&&
$value
[
'attributes'
][
'separator'
]
==
1
)
{
$navigationString
.
=
'<li class="menu-separator"></li>'
;
}
}
return
$navigationString
;
}
/**
* Given a navigation menu, generate navIDs for any items which are
* missing them.
...
...
@@ -401,55 +357,6 @@ FROM civicrm_navigation WHERE domain_id = $domainID";
}
}
/**
* Check permissions and format menu item as html.
*
* @param $value
* @param array $skipMenuItems
*
* @return bool|string
*/
public
static
function
getMenuName
(
&
$value
,
&
$skipMenuItems
)
{
// we need to localise the menu labels (CRM-5456) and don’t
// want to use ts() as it would throw the ts-extractor off
$i18n
=
CRM_Core_I18n
::
singleton
();
$name
=
$i18n
->
crm_translate
(
$value
[
'attributes'
][
'label'
],
[
'context'
=>
'menu'
]);
$url
=
CRM_Utils_Array
::
value
(
'url'
,
$value
[
'attributes'
]);
$parentID
=
CRM_Utils_Array
::
value
(
'parentID'
,
$value
[
'attributes'
]);
$navID
=
CRM_Utils_Array
::
value
(
'navID'
,
$value
[
'attributes'
]);
$active
=
CRM_Utils_Array
::
value
(
'active'
,
$value
[
'attributes'
]);
$target
=
CRM_Utils_Array
::
value
(
'target'
,
$value
[
'attributes'
]);
if
(
in_array
(
$parentID
,
$skipMenuItems
)
||
!
$active
||
!
self
::
checkPermission
(
$value
[
'attributes'
]))
{
$skipMenuItems
[]
=
$navID
;
return
FALSE
;
}
$makeLink
=
FALSE
;
if
(
!
empty
(
$url
))
{
$url
=
self
::
makeFullyFormedUrl
(
$url
);
$makeLink
=
TRUE
;
}
if
(
!
empty
(
$value
[
'attributes'
][
'icon'
]))
{
$menuIcon
=
sprintf
(
'<i class="%s"></i>'
,
$value
[
'attributes'
][
'icon'
]);
$name
=
$menuIcon
.
$name
;
}
if
(
$makeLink
)
{
$url
=
CRM_Utils_System
::
evalUrl
(
$url
);
if
(
$target
)
{
$name
=
"<a href=
\"
{
$url
}
\"
target=
\"
{
$target
}
\"
>
{
$name
}
</a>"
;
}
else
{
$name
=
"<a href=
\"
{
$url
}
\"
>
{
$name
}
</a>"
;
}
}
return
$name
;
}
/**
* Check if a menu item should be visible based on permissions and component.
*
...
...
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