Skip to content

Commit

Permalink
Add columns.inc config for hiding the default "Add" link. (CFM-90) (#112
Browse files Browse the repository at this point in the history
)
  • Loading branch information
arlen authored Jul 27, 2023
1 parent 0b1db78 commit bf13ef9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
4 changes: 3 additions & 1 deletion app/templates/ExternalIdentities/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ $bulkActions = [
$subnav = [
'name' => 'person',
'active' => 'external_identities'
];
];

$suppressAddLink = true;
30 changes: 17 additions & 13 deletions app/templates/Standard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,23 @@
if($vv_permissions['add']) {
$action_args = array();
$action_args['vv_attr_id'] = $vv_user['username'];

$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder('Add'),
'icon' => $this->Menu->getMenuIcon('Add'),
'url' => $this->Url->build(
[
'controller' => $modelsName,
'action' => 'add',
'?' => $linkFilter
]
),
'label' => __d('operation', 'add.a', __d('controller', $modelsName, [1])),
];
$action_args['vv_actions'] = array();

// Include the Add link to actions menu unless suppressed by the page
if(empty($suppressAddLink)) {
$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder('Add'),
'icon' => $this->Menu->getMenuIcon('Add'),
'url' => $this->Url->build(
[
'controller' => $modelsName,
'action' => 'add',
'?' => $linkFilter
]
),
'label' => __d('operation', 'add.a', __d('controller', $modelsName, [1])),
];
}

foreach(($topLinks ?? []) as $t) {
if($vv_permissions[ $t['link']['action'] ]) {
Expand Down

0 comments on commit bf13ef9

Please sign in to comment.