From a3ddb0a782ba5618c5be1a0fceec8dbb3257059b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 21 Dec 2019 10:34:30 +0100 Subject: [PATCH] implement navigation actions --- Admin/Install/db.json | 6 ++++++ Admin/Installer.php | 1 + Models/NavElement.php | 1 + Models/NavElementMapper.php | 1 + Theme/Backend/top.tpl.php | 4 ++-- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Admin/Install/db.json b/Admin/Install/db.json index da0a630..f68e2cc 100644 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -46,6 +46,12 @@ "default": null, "null": true }, + "nav_action": { + "name": "nav_action", + "type": "text", + "default": null, + "null": true + }, "nav_from": { "name": "nav_from", "type": "VARCHAR(255)", diff --git a/Admin/Installer.php b/Admin/Installer.php index 485a64e..367c2cc 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -91,6 +91,7 @@ class Installer extends InstallerAbstract $navElement->icon = $data['icon'] ?? null; $navElement->uri = $data['uri'] ?? null; $navElement->target = (string) ($data['target'] ?? 'self'); + $navElement->action = $data['action'] ?? null; $navElement->from = (string) ($data['from'] ?? '0'); $navElement->order = (int) ($data['order'] ?? 1); $navElement->parent = (int) ($data['parent'] ?? 0); diff --git a/Models/NavElement.php b/Models/NavElement.php index 9dcf6f6..50fcfc9 100644 --- a/Models/NavElement.php +++ b/Models/NavElement.php @@ -32,6 +32,7 @@ class NavElement public $icon = null; public $uri = null; public $target = 'self'; + public $action = null; public $from = '0'; public $order = 1; public $parent = 0; diff --git a/Models/NavElementMapper.php b/Models/NavElementMapper.php index a646ef9..be9aa1b 100644 --- a/Models/NavElementMapper.php +++ b/Models/NavElementMapper.php @@ -41,6 +41,7 @@ final class NavElementMapper extends DataMapperAbstract 'nav_icon' => ['name' => 'nav_icon', 'type' => 'string', 'internal' => 'icon'], 'nav_uri' => ['name' => 'nav_uri', 'type' => 'string', 'internal' => 'uri'], 'nav_target' => ['name' => 'nav_target', 'type' => 'string', 'internal' => 'target'], + 'nav_action' => ['name' => 'nav_action', 'type' => 'string', 'internal' => 'action'], 'nav_from' => ['name' => 'nav_from', 'type' => 'string', 'internal' => 'from'], 'nav_order' => ['name' => 'nav_order', 'type' => 'int', 'internal' => 'order'], 'nav_parent' => ['name' => 'nav_parent', 'type' => 'int', 'internal' => 'parent'], diff --git a/Theme/Backend/top.tpl.php b/Theme/Backend/top.tpl.php index 6d9671b..bff60d2 100644 --- a/Theme/Backend/top.tpl.php +++ b/Theme/Backend/top.tpl.php @@ -22,8 +22,8 @@ if (isset($this->nav[NavigationType::TOP])): ?>