From 439c96bd22bb318a0b831e4df0e788f7fefeb75a Mon Sep 17 00:00:00 2001
From: Carotte <65663837+web-cooking-factory@users.noreply.github.com>
Date: Wed, 21 Feb 2024 11:38:31 +0100
Subject: [PATCH 1/8] Add renderThemeIcon function
---
templates/_partials/helpers.tpl | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl
index dd52efe44..4fe428a5d 100644
--- a/templates/_partials/helpers.tpl
+++ b/templates/_partials/helpers.tpl
@@ -14,3 +14,22 @@
>
{/function}
+
+{function renderThemeIcon iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]}
+ {if isset($iconsMap) && $iconName && !empty($iconsMap[$iconName])}
+
+ {/if}
+{/function}
From 9950b5aed9001d503d901398f30db9516f91495f Mon Sep 17 00:00:00 2001
From: Carotte <65663837+web-cooking-factory@users.noreply.github.com>
Date: Wed, 21 Feb 2024 11:39:18 +0100
Subject: [PATCH 2/8] Create variables.tpl with icons mapping
---
templates/_partials/variables.tpl | 55 +++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 templates/_partials/variables.tpl
diff --git a/templates/_partials/variables.tpl b/templates/_partials/variables.tpl
new file mode 100644
index 000000000..4f82d7a7a
--- /dev/null
+++ b/templates/_partials/variables.tpl
@@ -0,0 +1,55 @@
+{assign
+ var=iconsMap
+ value=[
+ "chevron_right" => "",
+ "chevron_left" => "",
+ "chevron_up" => "",
+ "chevron_down" => "",
+ "previous" => "",
+ "next" => "",
+ "check" => "",
+ "cross" => "",
+ "close" => "",
+ "cart" => "",
+ "account" => "",
+ "account_info" => "",
+ "account_addresses" => "",
+ "account_orders" => "",
+ "account_slips" => "",
+ "account_vouchers" => "",
+ "account_returns" => "refresh",
+ "plus" => "",
+ "minus" => "",
+ "phone" => "",
+ "fax" => "",
+ "mail" => "",
+ "location" => "",
+ "show_plain" => "",
+ "hide_plain" => "",
+ "toggler" => "",
+ "download" => "",
+ "pdf" => "",
+ "add" => "",
+ "delete" => "",
+ "edit" => "",
+ "add_address" => "",
+ "delete_address" => "",
+ "edit_address" => "",
+ "edit_order_step" => "",
+ "search" => "",
+ "zoom" => "",
+ "info" => "",
+ "success" => "",
+ "warning" => "",
+ "danger" => "",
+ "login" => "",
+ "logout" => "",
+ "favorites" => "",
+ "add_favorite" => "",
+ "remove_favorite" => "",
+ "account_mailalerts" => "",
+ "account_rgpd" => "",
+ "clear" => ""
+ ]
+ scope="global"
+}
From 4f2e6e2397813c79037d49a146e0d9e8a1671bf6 Mon Sep 17 00:00:00 2001
From: Carotte <65663837+web-cooking-factory@users.noreply.github.com>
Date: Wed, 21 Feb 2024 11:40:07 +0100
Subject: [PATCH 3/8] Add variables partial
---
templates/layouts/layout-both-columns.tpl | 1 +
1 file changed, 1 insertion(+)
diff --git a/templates/layouts/layout-both-columns.tpl b/templates/layouts/layout-both-columns.tpl
index 32c1401f3..ea25e8dcf 100644
--- a/templates/layouts/layout-both-columns.tpl
+++ b/templates/layouts/layout-both-columns.tpl
@@ -3,6 +3,7 @@
* file that was distributed with this source code.
*}
+{include file='_partials/variables.tpl'}
{include file='_partials/helpers.tpl'}
From 9d800a3aafa0e2b2d22442ca96b1f4a045e8caa3 Mon Sep 17 00:00:00 2001
From: Carotte <65663837+web-cooking-factory@users.noreply.github.com>
Date: Wed, 21 Feb 2024 11:56:33 +0100
Subject: [PATCH 4/8] Allow multiple icon groups
---
templates/_partials/variables.tpl | 100 +++++++++++++++---------------
1 file changed, 51 insertions(+), 49 deletions(-)
diff --git a/templates/_partials/variables.tpl b/templates/_partials/variables.tpl
index 4f82d7a7a..e614bd37a 100644
--- a/templates/_partials/variables.tpl
+++ b/templates/_partials/variables.tpl
@@ -1,55 +1,57 @@
{assign
var=iconsMap
value=[
- "chevron_right" => "",
- "chevron_left" => "",
- "chevron_up" => "",
- "chevron_down" => "",
- "previous" => "",
- "next" => "",
- "check" => "",
- "cross" => "",
- "close" => "",
- "cart" => "",
- "account" => "",
- "account_info" => "",
- "account_addresses" => "",
- "account_orders" => "",
- "account_slips" => "",
- "account_vouchers" => "",
- "account_returns" => "refresh",
- "plus" => "",
- "minus" => "",
- "phone" => "",
- "fax" => "",
- "mail" => "",
- "location" => "",
- "show_plain" => "",
- "hide_plain" => "",
- "toggler" => "",
- "download" => "",
- "pdf" => "",
- "add" => "",
- "delete" => "",
- "edit" => "",
- "add_address" => "",
- "delete_address" => "",
- "edit_address" => "",
- "edit_order_step" => "",
- "search" => "",
- "zoom" => "",
- "info" => "",
- "success" => "",
- "warning" => "",
- "danger" => "",
- "login" => "",
- "logout" => "",
- "favorites" => "",
- "add_favorite" => "",
- "remove_favorite" => "",
- "account_mailalerts" => "",
- "account_rgpd" => "",
- "clear" => ""
+ "material-icons" => [
+ "chevron_right" => "",
+ "chevron_left" => "",
+ "chevron_up" => "",
+ "chevron_down" => "",
+ "previous" => "",
+ "next" => "",
+ "check" => "",
+ "cross" => "",
+ "close" => "",
+ "cart" => "",
+ "account" => "",
+ "account_info" => "",
+ "account_addresses" => "",
+ "account_orders" => "",
+ "account_slips" => "",
+ "account_vouchers" => "",
+ "account_returns" => "refresh",
+ "plus" => "",
+ "minus" => "",
+ "phone" => "",
+ "fax" => "",
+ "mail" => "",
+ "location" => "",
+ "show_plain" => "",
+ "hide_plain" => "",
+ "toggler" => "",
+ "download" => "",
+ "pdf" => "",
+ "add" => "",
+ "delete" => "",
+ "edit" => "",
+ "add_address" => "",
+ "delete_address" => "",
+ "edit_address" => "",
+ "edit_order_step" => "",
+ "search" => "",
+ "zoom" => "",
+ "info" => "",
+ "success" => "",
+ "warning" => "",
+ "danger" => "",
+ "login" => "",
+ "logout" => "",
+ "favorites" => "",
+ "add_favorite" => "",
+ "remove_favorite" => "",
+ "account_mailalerts" => "",
+ "account_rgpd" => "",
+ "clear" => ""
+ ]
]
scope="global"
}
From 5a63fc80a345089d097ac7502f9a6824185d27e3 Mon Sep 17 00:00:00 2001
From: Carotte <65663837+web-cooking-factory@users.noreply.github.com>
Date: Wed, 21 Feb 2024 11:58:48 +0100
Subject: [PATCH 5/8] Multiple icon groups in render function
---
templates/_partials/helpers.tpl | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl
index 4fe428a5d..716685c38 100644
--- a/templates/_partials/helpers.tpl
+++ b/templates/_partials/helpers.tpl
@@ -15,10 +15,10 @@
{/function}
-{function renderThemeIcon iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]}
- {if isset($iconsMap) && $iconName && !empty($iconsMap[$iconName])}
+{function renderThemeIcon iconGoup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]}
+ {if isset($iconsMap) && !empty($iconsMap[$iconGroup]) && $iconName && !empty($iconsMap[$iconGroup][$iconName])}
{/if}
{/function}
From 085f0dcb4ad452659fb53861911940970a43acd0 Mon Sep 17 00:00:00 2001
From: Carotte <65663837+web-cooking-factory@users.noreply.github.com>
Date: Wed, 21 Feb 2024 17:42:26 +0100
Subject: [PATCH 6/8] Fix
---
templates/_partials/helpers.tpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/_partials/helpers.tpl b/templates/_partials/helpers.tpl
index 716685c38..a49f3ea7a 100644
--- a/templates/_partials/helpers.tpl
+++ b/templates/_partials/helpers.tpl
@@ -15,7 +15,7 @@
{/function}
-{function renderThemeIcon iconGoup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]}
+{function renderThemeIcon iconGroup="material-icons" iconName="" ariaHidden="true" ariaLabel="" extraAttributes=[]}
{if isset($iconsMap) && !empty($iconsMap[$iconGroup]) && $iconName && !empty($iconsMap[$iconGroup][$iconName])}