Skip to content

Add columns.inc config for hiding the default "Add" link. (CFM-90) #112

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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