From 58da87bb0e116bfb5b3dbf0964608257ea2ef2a6 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Wed, 15 Jan 2025 09:18:58 +0300 Subject: [PATCH] menu fixes --- examples/arangodb/collections/menu/cart.json | 18 +++++++++++++++++ examples/arangodb/collections/menu/index.json | 20 +++++++++++++++++++ mirzaev/huesos/system/controllers/cart.php | 3 +++ mirzaev/huesos/system/controllers/catalog.php | 3 +++ mirzaev/huesos/system/controllers/index.php | 3 +++ mirzaev/huesos/system/controllers/order.php | 3 +++ 6 files changed, 50 insertions(+) create mode 100644 examples/arangodb/collections/menu/cart.json create mode 100644 examples/arangodb/collections/menu/index.json diff --git a/examples/arangodb/collections/menu/cart.json b/examples/arangodb/collections/menu/cart.json new file mode 100644 index 0000000..4e6a160 --- /dev/null +++ b/examples/arangodb/collections/menu/cart.json @@ -0,0 +1,18 @@ +{ + "urn": "/cart", + "name": { + "en": "Cart", + "ru": "Корзина" + }, + "style": { + "order": 1 + }, + "class": {}, + "icon": { + "style": {}, + "class": "shopping cart" + }, + "image": { + "storage": null + } +} diff --git a/examples/arangodb/collections/menu/index.json b/examples/arangodb/collections/menu/index.json new file mode 100644 index 0000000..1b46b98 --- /dev/null +++ b/examples/arangodb/collections/menu/index.json @@ -0,0 +1,20 @@ +{ + "urn": "/", + "name": { + "en": "Main page", + "ru": "Главная страница" + }, + "style": { + "order": 0 + }, + "class": {}, + "icon": { + "style": { + "rotate": "-135deg" + }, + "class": "arrow circle" + }, + "image": { + "storage": null + } +} diff --git a/mirzaev/huesos/system/controllers/cart.php b/mirzaev/huesos/system/controllers/cart.php index 7b64ff1..3c45ce8 100755 --- a/mirzaev/huesos/system/controllers/cart.php +++ b/mirzaev/huesos/system/controllers/cart.php @@ -74,6 +74,9 @@ final class cart extends core parameters: ['language' => $this->language->name], errors: $this->errors['menu'] ); + + // Universalizing + if ($this->view->menu instanceof _document) $this->view->menu = [$this->view->menu]; } // Initializing the cart diff --git a/mirzaev/huesos/system/controllers/catalog.php b/mirzaev/huesos/system/controllers/catalog.php index 114795a..3d88018 100755 --- a/mirzaev/huesos/system/controllers/catalog.php +++ b/mirzaev/huesos/system/controllers/catalog.php @@ -293,6 +293,9 @@ final class catalog extends core parameters: ['language' => $this->language->name], errors: $this->errors['menu'] ); + + // Universalizing + if ($this->view->menu instanceof _document) $this->view->menu = [$this->view->menu]; } if (str_contains($this->request->headers['accept'], content::json->value)) { diff --git a/mirzaev/huesos/system/controllers/index.php b/mirzaev/huesos/system/controllers/index.php index 4280c52..9c80231 100755 --- a/mirzaev/huesos/system/controllers/index.php +++ b/mirzaev/huesos/system/controllers/index.php @@ -56,6 +56,9 @@ final class index extends core parameters: ['language' => $this->language->name], errors: $this->errors['menu'] ); + + // Universalizing + if ($this->view->menu instanceof _document) $this->view->menu = [$this->view->menu]; } if (str_contains($this->request->headers['accept'], content::any->value)) { diff --git a/mirzaev/huesos/system/controllers/order.php b/mirzaev/huesos/system/controllers/order.php index 4677937..b08c726 100755 --- a/mirzaev/huesos/system/controllers/order.php +++ b/mirzaev/huesos/system/controllers/order.php @@ -74,6 +74,9 @@ final class cart extends core parameters: ['language' => $this->language->name], errors: $this->errors['menu'] ); + + // Universalizing + if ($this->view->menu instanceof _document) $this->view->menu = [$this->view->menu]; } // Initializing the cart