Skip to content

Commit

Permalink
Add test for whether an "add" link should be included in the index vi…
Browse files Browse the repository at this point in the history
…ew (CO-2585) (#58)
  • Loading branch information
arlen authored Mar 29, 2023
1 parent 479d6a7 commit 0727b54
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/templates/Standard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ function _column_key($modelsName, $c, $tz=null) {
$addLink = $addLinkFilter($addLink, $this->request);
}

$action_args['vv_actions'][] = array(
'order' => $this->Menu->getMenuOrder('Add'),
'icon' => $this->Menu->getMenuIcon('Add'),
'url' => $this->Url->build($addLink),
'label' => __('match.op.add.a', __('match.ct.'.$vv_modelname, [1]))
);
if($addLink) {
$action_args['vv_actions'][] = array(
'order' => $this->Menu->getMenuOrder('Add'),
'icon' => $this->Menu->getMenuIcon('Add'),
'url' => $this->Url->build($addLink),
'label' => __('match.op.add.a', __('match.ct.'.$vv_modelname, [1]))
);
}

// Output the topLinks
if(!empty($action_args['vv_actions'])) {
Expand Down

0 comments on commit 0727b54

Please sign in to comment.