diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php
index 9a10ee5ca..751378bfc 100644
--- a/app/templates/Standard/index.php
+++ b/app/templates/Standard/index.php
@@ -91,38 +91,52 @@ function _column_key($modelsName, $c, $tz=null) {
= $vv_title; ?>
-
-
- -
- = $this->Html->link('add_circle ' .
- __d('operation', 'add.a', __d('controller', $modelsName, [1])),
- ['action' => 'add', '?' => $linkFilter],
- ['escape' => false]); ?>
-
- ' .
- $this->Html->link(
- '' . $t['icon']. ' ' . $t['label'],
- $t['link'],
- ['escape' => false, 'class' => $t['class']]
- ) . '
- ';
- }
- }
+ $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'] ]) {
+ // We need to inject $linkFilter, but not overwrite any existing query params
+ if(!empty($t['link']['?'])) {
+ $t['link']['?'] = array_merge($t['link']['?'], $linkFilter);
+ } else {
+ $t['link']['?'] = $linkFilter;
}
- ?>
-
-
+
+ $action_args['vv_actions'][] = [
+ 'order' => $this->Menu->getMenuOrder($t['icon']),
+ 'icon' => $this->Menu->getMenuIcon($t['icon']),
+ 'url' => $this->Url->build($t['link']),
+ 'label' => $t['label'],
+ ];
+ }
+ }
+ }
+
+ if(!empty($action_args['vv_actions'])) {
+ print '';
+ print $this->element('menuAction', $action_args);
+ print '
';
+ }
+ ?>