Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Use echo() format for direct output that doesn't use htmlentities to also allow using content filters (data-filter) in html templates.

givanz3198de811a6c
diff --git a/app/template/components/breadcrumb.tpl b/app/template/components/breadcrumb.tpl
index 9c54bd6..eed18cb 100755
--- a/app/template/components/breadcrumb.tpl
+++ b/app/template/components/breadcrumb.tpl
@@ -12,7 +12,7 @@ $breadcrumb = $current_component = $this->_component['breadcrumb'][$_breadcrumb_
$_pagination_count = $breadcrumb['count'] ?? 0;
$_pagination_limit = isset($breadcrumb['limit']) ? $breadcrumb['limit'] : 5;
-
+$index = 0;
?>
@@ -21,7 +21,7 @@ $_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => []] : f
$breadcrumb['breadcrumb'] = empty($breadcrumb['breadcrumb']) ? $_default : $breadcrumb['breadcrumb'];
if($breadcrumb && is_array($breadcrumb['breadcrumb'])) {
- foreach ($breadcrumb['breadcrumb'] as $index => $breadcrumb) {?>
+ foreach ($breadcrumb['breadcrumb'] as $index => $breadcrumb) {$index++;?>
@item [data-v-breadcrumb-item-*]|innerText = $breadcrumb['@@__data-v-breadcrumb-item-(*)__@@']
diff --git a/app/template/components/comments.tpl b/app/template/components/comments.tpl
index 46b4b56..d9764dc 100755
--- a/app/template/components/comments.tpl
+++ b/app/template/components/comments.tpl
@@ -28,7 +28,7 @@ if($_comments && is_array($_comments)) {
@comment|id = <?php echo 'comment-' . $comment['comment_id'];?>
- @comment [data-v-comment-content] = <?php echo $comment['content'];?>
+ @comment [data-v-comment-content] = <?php echo($comment['content']);?>
@comment img[data-v-comment-*]|src = $comment['@@__data-v-comment-(*)__@@']
@comment img[data-v-comment-*]|width = <?php echo $comment['size'] ?? '60';?>
diff --git a/app/template/components/menu.tpl b/app/template/components/menu.tpl
index 5292961..df5f96d 100755
--- a/app/template/components/menu.tpl
+++ b/app/template/components/menu.tpl
@@ -42,13 +42,13 @@ if (isset($this->_component['menu']) && isset($this->_component['menu'][$_menu_i
//catch all data attributes
@category [data-v-menu-item-*]|innerText = $category['@@__data-v-menu-item-(*)__@@']
- @category [data-v-menu-item-content] = <?php echo $category['content'] ?? '';?>
+ @category [data-v-menu-item-content] = <?php echo($category['content'] ?? '');?>
@category [data-v-menu-item-url]|href = <?php if (isset($category['url'])) echo Vvveb\System\Sites::url($category['url']);?>
@category [data-v-menu-item-img]|src = $category['images'][0]
@category|append = <?php
- if ($category['children'] > 0 && $generate_menu) {
+ if ($category['children'] > 0 && isset($generate_menu)) {
$parents++;
$generate_menu($category['menu_item_id'], $_categories);
}
diff --git a/app/template/components/product.tpl b/app/template/components/product.tpl
index 2413d30..37202ab 100755
--- a/app/template/components/product.tpl
+++ b/app/template/components/product.tpl
@@ -34,7 +34,7 @@ $_pagination_limit = isset($product['limit']) ? $product['limit'] : 5;
@product a[data-v-product-*]|href = $product['@@__data-v-product-(*)__@@']
-@product img[data-v-product-main-image]|src = <?php echo $product['image'];?>
+@product img[data-v-product-main-image]|src = <?php echo($product['image']);?>
@product [data-v-product-main-image-background-image]|style = <?php echo 'background-image: url(\'' . $product['image'] . '\');';?>
@product a[data-v-product-main-image]|href = <?php echo reset($product['images'])['image'];?>
@@ -51,6 +51,8 @@ if($_images) {
@images [data-bs-slide-to]|data-bs-slide-to = <?php echo $i;?>
@images img[data-v-product-image-src]|src = $_image['image']
+ @images [data-v-product-image-src] = $_image['image']
+ [data-v-product-image-src]@images = $_image['image']
@images [data-v-product-image-background-image]|style = <?php echo 'background-image: url(\'' . $_image['image'] . '\');';?>
@images a[data-v-product-image-src]|href = $_image['image']
@images img[data-v-product-image-src]|data-v-id = $_image['product_image_id']
diff --git a/app/template/components/product/attributes.tpl b/app/template/components/product/attributes.tpl
index e6d8f85..a743547 100755
--- a/app/template/components/product/attributes.tpl
+++ b/app/template/components/product/attributes.tpl
@@ -34,7 +34,7 @@ if($attributes && is_array($attributes['attribute'])) {
@attribute|id = <?php echo 'attribute-' . $attribute['attribute_id'];?>
- @attribute [data-v-attribute-content] = <?php echo $attribute['content'];?>
+ @attribute [data-v-attribute-content] = <?php echo($attribute['content']);?>
@attribute img[data-v-attribute-*]|src = $attribute['@@__data-v-attribute-(*)__@@']
diff --git a/app/template/components/product/manufacturers.tpl b/app/template/components/product/manufacturers.tpl
index c06af8a..740a788 100755
--- a/app/template/components/product/manufacturers.tpl
+++ b/app/template/components/product/manufacturers.tpl
@@ -25,7 +25,7 @@ if($manufacturers && is_array($manufacturers['manufacturer'])) {
@manufacturer|id = <?php echo 'manufacturer-' . $manufacturer['manufacturer_id'];?>
- @manufacturer [data-v-manufacturer-content] = <?php echo $manufacturer['content'];?>
+ @manufacturer [data-v-manufacturer-content] = <?php echo($manufacturer['content']);?>
@manufacturer img[data-v-manufacturer-*]|src = $manufacturer['@@__data-v-manufacturer-(*)__@@']
diff --git a/app/template/components/product/options.tpl b/app/template/components/product/options.tpl
index 8da30f4..2f16e92 100755
--- a/app/template/components/product/options.tpl
+++ b/app/template/components/product/options.tpl
@@ -48,7 +48,7 @@ if($options && is_array($options)) {
@option|id = <?php echo 'option-' . ($option['product_option_id'] ?? 0);?>
- @option [data-v-option-content] = <?php echo $option['content'] ?? '';?>
+ @option [data-v-option-content] = <?php echo($option['content'] ?? '');?>
@option img[data-v-option-*]|src = $option['@@__data-v-option-(*)__@@']
diff --git a/app/template/components/product/vendors.tpl b/app/template/components/product/vendors.tpl
index 2ed1899..1502a27 100644
--- a/app/template/components/product/vendors.tpl
+++ b/app/template/components/product/vendors.tpl
@@ -25,7 +25,7 @@ if($vendors && is_array($vendors['vendor'])) {
@vendor|id = <?php echo 'vendor-' . $vendor['vendor_id'];?>
- @vendor [data-v-vendor-content] = <?php echo $vendor['content'];?>
+ @vendor [data-v-vendor-content] = <?php echo($vendor['content']);?>
@vendor img[data-v-vendor-*]|src = $vendor['@@__data-v-vendor-(*)__@@']
diff --git a/app/template/components/products.tpl b/app/template/components/products.tpl
index 897537a..0cce1da 100755
--- a/app/template/components/products.tpl
+++ b/app/template/components/products.tpl
@@ -116,7 +116,7 @@ if ($_products) {
//catch all data attributes
@product [data-v-product-*]|innerText = $_product['@@__data-v-product-(*)__@@']
//echo description directly to avoid htmlentities escape
- @product [data-v-product-content] = <?php echo $_product['content'];?>
+ @product [data-v-product-content] = <?php echo($_product['content']);?>
@product|after = <?php
}
diff --git a/app/template/components/questions.tpl b/app/template/components/questions.tpl
index b0587dd..4f1bdf8 100644
--- a/app/template/components/questions.tpl
+++ b/app/template/components/questions.tpl
@@ -28,7 +28,7 @@ if($questions && is_array($questions)) {
@question|id = <?php echo 'question-' . $question['product_question_id'];?>
- @question [data-v-question-content] = <?php echo $question['content'];?>
+ @question [data-v-question-content] = <?php echo($question['content']);?>
@question img[data-v-question-*]|src = $question['@@__data-v-question-(*)__@@']
@question img[data-v-question-avatar]|width = <?php echo $question['size'] ?? '60';?>
diff --git a/app/template/components/user/wishlist.tpl b/app/template/components/user/wishlist.tpl
index cd22322..0ee6800 100644
--- a/app/template/components/user/wishlist.tpl
+++ b/app/template/components/user/wishlist.tpl
@@ -27,7 +27,7 @@
?>
@wishlist [data-v-wishlist-category] = <?php $_category = current($wishlist);echo $_category['category'];?>
-@wishlist [data-v-wishlist-count] = <?php echo $wishlist['count'] ?? ''?>
+@wishlist [data-v-wishlist-count] = <?php echo($wishlist['count'] ?? '')?>
@wishlist [data-v-wishlist-manufacturer] = <?php $_manufacturer = current($wishlist);echo $_manufacturer['manufacturer'];?>
@@ -118,7 +118,7 @@ if ($_wishlist) {
//catch all data attributes
@product [data-v-product-*]|innerText = $_product['@@__data-v-product-(*)__@@']
//echo description directly to avoid htmlentities escape
- @product [data-v-product-content] = <?php echo $_product['content'];?>
+ @product [data-v-product-content] = <?php echo($_product['content']);?>
@product|after = <?php
}
diff --git a/app/template/email/common.tpl b/app/template/email/common.tpl
index 9f1fe53..c9d1e3c 100755
--- a/app/template/email/common.tpl
+++ b/app/template/email/common.tpl
@@ -1,3 +1,2 @@
import(components.tpl)
-import(ifmacros.tpl)
-
+import(ifmacros.tpl)
\ No newline at end of file
diff --git a/app/template/notifications.tpl b/app/template/notifications.tpl
index 7289e09..f0d5e6f 100755
--- a/app/template/notifications.tpl
+++ b/app/template/notifications.tpl
@@ -12,7 +12,7 @@ if (isset($this->errors) && is_array($this->errors)) {
foreach ($list as $message) {
?>
- @error [data-v-notification-text] = <?php echo $message;?>
+ @error [data-v-notification-text] = <?php echo($message);?>
@error|after = <?php
}
@@ -34,7 +34,7 @@ if (isset($this->success) && is_array($this->success)) {
foreach ($list as $message) {
?>
- @success [data-v-notification-text] = <?php echo $message;?>
+ @success [data-v-notification-text] = <?php echo($message);?>
@success|after = <?php
}
@@ -47,7 +47,7 @@ if (isset($this->success) && is_array($this->success)) {
@info|before = <?php
if (isset($this->info) && is_array($this->info)) foreach($this->info as $message) {?>
- @info [data-v-notification-text] = <?php echo $message;?>
+ @info [data-v-notification-text] = <?php echo($message);?>
@info|after = <?php
}
@@ -66,7 +66,7 @@ if (isset($this->message) && is_array($this->message)) {
foreach ($list as $message) {
?>
- @message [data-v-notification-text] = <?php echo $message;?>
+ @message [data-v-notification-text] = <?php echo($message);?>
@message|after = <?php
}
diff --git a/app/template/user/address/edit.tpl b/app/template/user/address/edit.tpl
index c781ea8..74800cb 100755
--- a/app/template/user/address/edit.tpl
+++ b/app/template/user/address/edit.tpl
@@ -1,6 +1,6 @@
import(common.tpl)
-[data-v-user_address-*] = <?php echo $this->user_address['@@__data-v-user_address-(*)__@@'] ?? '';?>
+[data-v-user_address-*] = <?php echo($this->user_address['@@__data-v-user_address-(*)__@@'] ?? '');?>
[data-v-countries]|data-v-region-id = $this->user_address['region_id']
diff --git a/app/template/user/profile.tpl b/app/template/user/profile.tpl
index 370f646..a915271 100755
--- a/app/template/user/profile.tpl
+++ b/app/template/user/profile.tpl
@@ -1,3 +1,3 @@
import(common.tpl)
-[data-v-user-*] = <?php echo $this->user['@@__data-v-user-(*)__@@'] ?? '';?>
+[data-v-user-*] = <?php echo($this->user['@@__data-v-user-(*)__@@'] ?? '');?>