Add view classes for articles, banners, languages, menu, newsletter, containers, shop categories, clients, payment methods, products, and search
- Created `Articles` class for rendering article views including full articles, miniature lists, and news sections. - Added `Banners` class for handling banner displays. - Introduced `Languages` class for rendering language options. - Implemented `Menu` class for rendering page and menu structures. - Developed `Newsletter` class for newsletter rendering. - Created `Scontainers` class for rendering specific containers. - Added `ShopCategory` class for managing shop category views and pagination. - Implemented `ShopClient` class for client-related views including address management and login forms. - Created `ShopPaymentMethod` class for displaying payment methods in the basket. - Added `ShopProduct` class for generating product URLs. - Introduced `ShopSearch` class for rendering a simple search form. - Added `.htaccess` file in the plugins directory to enhance security by restricting access to sensitive files and directories.
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
<div id="category-subcategory-tiles">
|
||||
<ul class="category-subcategory-tiles">
|
||||
<?php foreach ( $this -> categories as $category ): ?>
|
||||
<?php
|
||||
global $lang_id;
|
||||
$categoryRepo = new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] );
|
||||
foreach ( $this -> categories as $category ):
|
||||
$title = $category['language']['title'] ?? ( $category['title'] ?? '' );
|
||||
$url = '#';
|
||||
if ( !empty( $category['id'] ) ) {
|
||||
$url = $categoryRepo->categoryUrl( (int)$category['id'], (string)$lang_id );
|
||||
} elseif ( !empty( $category['language']['seo_link'] ) ) {
|
||||
$url = '/' . ltrim( (string)$category['language']['seo_link'], '/' );
|
||||
} elseif ( !empty( $category['seo_link'] ) ) {
|
||||
$url = '/' . ltrim( (string)$category['seo_link'], '/' );
|
||||
}
|
||||
?>
|
||||
<li class="category-subcategory-tile">
|
||||
<a href="/<?= $category['seo_link']; ?>"><?= $category['title']; ?></a>
|
||||
<a href="<?= $url; ?>"><?= $title; ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<? global $lang_id;?>
|
||||
<div class="row">
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):?>
|
||||
<?= \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id ),
|
||||
<?= \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id ),
|
||||
'class' => 'col-12 col-sm-6 col-lg-3'
|
||||
] );?>
|
||||
<? endforeach; endif;?>
|
||||
|
||||
@@ -14,10 +14,10 @@ if ( is_array( $this -> categories ) ):
|
||||
endif;
|
||||
?>">
|
||||
<?
|
||||
$category['language']['seo_link'] ? $url = '/' . $category['language']['seo_link'] : $url = '/k-' . $category['id'] . '-' . \S::seo( $category['language']['title'] );
|
||||
$category['language']['seo_link'] ? $url = '/' . $category['language']['seo_link'] : $url = '/k-' . $category['id'] . '-' . \Shared\Helpers\Helpers::seo( $category['language']['title'] );
|
||||
|
||||
if ( \S::get_session( 'current-lang' ) != \front\factory\Languages::default_language() and $url != '#' )
|
||||
$url = '/' . \S::get_session( 'current-lang' ) . $url;
|
||||
if ( \Shared\Helpers\Helpers::get_session( 'current-lang' ) != ( new \Domain\Languages\LanguagesRepository( $GLOBALS['mdb'] ) )->defaultLanguage() and $url != '#' )
|
||||
$url = '/' . \Shared\Helpers\Helpers::get_session( 'current-lang' ) . $url;
|
||||
?>
|
||||
<a href="<?= $url;?>" title="<?= $category['language']['title'];?>" <? if ( is_array( $category['categories'] ) ) echo "class='menu-trigger'";?>>
|
||||
<?= $category['language']['title'];?>
|
||||
@@ -28,7 +28,7 @@ if ( is_array( $this -> categories ) ):
|
||||
<? if ( is_array( $category['categories'] ) and $category['id'] != $this -> current_category and $this -> level != 0 ):?>
|
||||
<i class="fa fa-chevron-down toggle" category="<?= $category['id'];?>"></i>
|
||||
<? endif;?>
|
||||
<? if ( is_array( $category['categories'] ) ) echo \front\view\ShopCategory::categories( $category['categories'], $this -> current_category, $this -> level + 1 );?>
|
||||
<? if ( is_array( $category['categories'] ) ) echo \front\Views\ShopCategory::categories( $category['categories'], $this -> current_category, $this -> level + 1 );?>
|
||||
</li>
|
||||
<? endif;?>
|
||||
<? endforeach;?>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div id="visible"><?= $this->category['language']['text']; ?></div>
|
||||
<div id="hidden"><?= $this->category['language']['text_hidden']; ?></div>
|
||||
<? if ($this->category['language']['text_hidden']) : ?>
|
||||
<a href="#" class="btn"><?= \S::lang('wiecej'); ?></a>
|
||||
<a href="#" class="btn"><?= \Shared\Helpers\Helpers::lang('wiecej'); ?></a>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
@@ -14,10 +14,10 @@
|
||||
e.preventDefault();
|
||||
if ($('#category-description #hidden').is(':visible')) {
|
||||
$('#category-description #hidden').slideToggle();
|
||||
$('#category-description .btn').html('<?= \S::lang('wiecej'); ?>');
|
||||
$('#category-description .btn').html('<?= \Shared\Helpers\Helpers::lang('wiecej'); ?>');
|
||||
} else {
|
||||
$('#category-description #hidden').slideToggle();
|
||||
$('#category-description .btn').html('<?= \S::lang('mniej'); ?>');
|
||||
$('#category-description .btn').html('<?= \Shared\Helpers\Helpers::lang('mniej'); ?>');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<? global $lang_id; ?>
|
||||
<? if ($this->query) : ?>
|
||||
<div class="box-title">
|
||||
<?= \S::lang('wyniki-wyszukiwania-dla-zapytania') . ': <strong>' . $this->query . '</strong>'; ?>
|
||||
<?= \Shared\Helpers\Helpers::lang('wyniki-wyszukiwania-dla-zapytania') . ': <strong>' . $this->query . '</strong>'; ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<?
|
||||
if ($this->category_additional_text) :
|
||||
echo \Tpl::view('shop-category/_partials/category-additional-text', [
|
||||
echo \Shared\Tpl\Tpl::view('shop-category/_partials/category-additional-text', [
|
||||
'category' => $this->category
|
||||
]);
|
||||
endif;
|
||||
?>
|
||||
<div class="category-content">
|
||||
<? if (is_array($this->products)) : foreach ($this->products as $product_id) :
|
||||
echo \Tpl::view('shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id )
|
||||
echo \Shared\Tpl\Tpl::view('shop-product/product-mini', [
|
||||
'product' => (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id )
|
||||
]);
|
||||
endforeach;
|
||||
endif; ?>
|
||||
</div>
|
||||
<?
|
||||
if ($this->category_description) :
|
||||
echo \Tpl::view('shop-category/category-description', [
|
||||
echo \Shared\Tpl\Tpl::view('shop-category/category-description', [
|
||||
'category' => $this->category
|
||||
]);
|
||||
endif;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( $this -> query ):?>
|
||||
<div class="box-title">
|
||||
<?= \S::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
|
||||
<?= \Shared\Helpers\Helpers::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<?
|
||||
if ( $this -> category_additional_text ):
|
||||
echo \Tpl::view( 'shop-category/_partials/category-additional-text', [
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-category/_partials/category-additional-text', [
|
||||
'category' => $this -> category
|
||||
] );
|
||||
endif;
|
||||
@@ -15,8 +15,8 @@ endif;
|
||||
<?php
|
||||
|
||||
if ( $this -> category['view_subcategories'] ):
|
||||
echo \Tpl::view( 'shop-category/_partials/category-subcategory-tiles', [
|
||||
'categories' => \shop\Category::get_subcategory_by_category( $this -> category['id'] ),
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-category/_partials/category-subcategory-tiles', [
|
||||
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->categoriesTree( $lang_id, (int)$this -> category['id'] ),
|
||||
] );
|
||||
|
||||
endif;
|
||||
@@ -24,16 +24,16 @@ endif;
|
||||
|
||||
<div class="category-content" t='2'>
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( $product_id, $lang_id )
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => (new \Domain\Product\ProductRepository($GLOBALS['mdb']))->findCached( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
<?= $this -> pager;?>
|
||||
<?
|
||||
if ( $this -> category_description ):
|
||||
echo \Tpl::view( 'shop-category/category-description', [
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-category/category-description', [
|
||||
'category' => $this -> category
|
||||
] );
|
||||
endif;
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<? global $lang_id;?>
|
||||
<? if ( $this -> query ):?>
|
||||
<div class="box-title">
|
||||
<?= \S::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
|
||||
<?= \Shared\Helpers\Helpers::lang( 'wyniki-wyszukiwania-dla-zapytania' ) . ': <strong>' . $this -> query . '</strong>';?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
<div class="category-content">
|
||||
<? $productRepo = new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ); ?>
|
||||
<? if ( is_array( $this -> products ) ): foreach ( $this -> products as $product_id ):
|
||||
$product = new \shop\Product( $product_id );
|
||||
echo \Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => new \shop\Product( $product_id, $lang_id )
|
||||
echo \Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => $productRepo->findCached( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach; endif;?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user