ver. 0.285: Tpl → Shared\Tpl namespace, CurlServer removal, thumb.php fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 00:13:59 +01:00
parent fc7d18123d
commit 28b30c1e56
144 changed files with 385 additions and 285 deletions

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Tpl::view('articles/article-edit-custom-script', [
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('articles/article-edit-custom-script', [
'article' => $this->article,
'user' => $this->user,
'languages' => $this->form->languages ?? []

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?php if (!empty($this->viewModel->customScriptView)): ?>
<?= \Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?php endif; ?>

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?php if (!empty($this->viewModel->customScriptView)): ?>
<?= \Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?php endif; ?>

View File

@@ -9,7 +9,7 @@
<input type="checkbox" class="g-checkbox" name="pages[]" id="article_page_<?= $page['id'];?>" value="<?= $page['id'];?>" <? if ( is_array( $this -> article_pages ) and in_array( $page['id'], $this -> article_pages ) ):?>checked="checked"<? endif;?> />
<label for="article_page_<?= $page['id'];?>" class="mb0"><?= $page['title'];?></label>
</div>
<?= \Tpl::view( 'articles/subpages-list', [
<?= \Shared\Tpl\Tpl::view( 'articles/subpages-list', [
'pages' => $page['subpages'],
'article_pages' => $this->article_pages,
'parent_id' => $page['id'],

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?php if (!empty($this->viewModel->customScriptView)): ?>
<?= \Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?php endif; ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?php if (!empty($this->viewModel->customScriptView)): ?>
<?= \Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?php endif; ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -276,7 +276,7 @@ ob_start();
</button>
Menu: <b><?= $menu['name'];?></b>
</div>
<?= \Tpl::view( 'layouts/subpages-list', [
<?= \Shared\Tpl\Tpl::view( 'layouts/subpages-list', [
'pages' => $menu['pages'],
'layout_pages' => $this -> layout['pages'],
'step' => 1
@@ -302,7 +302,7 @@ ob_start();
<input type="checkbox" class="g-checkbox" name="categories[]" value="<?= $category['id'];?>" <? if ( is_array( $this -> layout['categories'] ) and in_array( $category['id'], $this -> layout['categories'] ) ):?>checked="checked"<? endif;?> />
<b><?= $category['languages'][$this -> dlang]['title'];?></b>
</div>
<?= \Tpl::view( 'layouts/subcategories-list', [
<?= \Shared\Tpl\Tpl::view( 'layouts/subcategories-list', [
'categories' => $category['subcategories'],
'product_categories' => $this -> layout['categories'],
'dlang' => $this -> dlang

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -10,7 +10,7 @@
<input type="checkbox" class="g-checkbox" name="categories[]" value="<?= $category['id'];?>" <? if ( is_array( $this -> product_categories ) and in_array( $category['id'], $this -> product_categories ) ):?>checked="checked"<? endif;?> />
<b><?= $category['languages'][$this -> dlang]['title'];?></b>
</div>
<?= \Tpl::view( 'layouts/subcategories-list', [
<?= \Shared\Tpl\Tpl::view( 'layouts/subcategories-list', [
'categories' => $category['subcategories'],
'product_categories' => $this -> product_categories,
'dlang' => $this -> dlang

View File

@@ -10,7 +10,7 @@
</div>
<?
if ( is_array( $page['subpages'] ) )
echo \Tpl::view( 'layouts/subpages-list', [
echo \Shared\Tpl\Tpl::view( 'layouts/subpages-list', [
'pages' => $page['subpages'],
'layout_pages' => $this -> layout_pages,
'step' => $this -> step + 1

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -20,7 +20,7 @@ foreach ($menus as $menu):
<?php if ($menuStatus !== 1): ?><i class="fa fa-ban fa-lg text-danger" title="Menu nieaktywne"></i><?php endif; ?>
Menu: <b><?= htmlspecialchars($menuName, ENT_QUOTES, 'UTF-8'); ?></b>
</div>
<?= \Tpl::view('pages/subpages-browse-list', [
<?= \Shared\Tpl\Tpl::view('pages/subpages-browse-list', [
'pages' => $menu['pages'] ?? [],
'step' => 1,
]); ?>

View File

@@ -32,7 +32,7 @@ foreach ($menus as $menu):
</a>
</div>
</div>
<?= \Tpl::view('pages/subpages-list', [
<?= \Shared\Tpl\Tpl::view('pages/subpages-list', [
'pages' => $menu['pages'] ?? [],
'step' => 1,
]); ?>

View File

@@ -51,7 +51,7 @@ if (empty($pages)) {
<?php endforeach; ?>
</div>
<?= \Tpl::view('pages/subpages-browse-list', [
<?= \Shared\Tpl\Tpl::view('pages/subpages-browse-list', [
'pages' => $page['subpages'] ?? [],
'step' => $step + 1,
]); ?>

View File

@@ -67,7 +67,7 @@ if (empty($pages)) {
</div>
<?php endif; ?>
</div>
<?= \Tpl::view('pages/subpages-list', [
<?= \Shared\Tpl\Tpl::view('pages/subpages-list', [
'pages' => $page['subpages'] ?? [],
'step' => $step + 1,
]); ?>

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?php if (!empty($this->viewModel->customScriptView)): ?>
<?= \Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view($this->viewModel->customScriptView, ['list' => $this->viewModel]); ?>
<?php endif; ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -38,7 +38,7 @@ if (!empty($values)) {
foreach ($values as $value) {
++$rowCounter;
$rowKey = 'existing-' . (int)($value['id'] ?? 0);
$initialRowsHtml .= \Tpl::view('shop-attribute/_partials/value-row', [
$initialRowsHtml .= \Shared\Tpl\Tpl::view('shop-attribute/_partials/value-row', [
'rowKey' => $rowKey,
'value' => $value,
'languages' => $activeLanguages,
@@ -47,7 +47,7 @@ if (!empty($values)) {
}
} else {
$rowCounter = 1;
$initialRowsHtml .= \Tpl::view('shop-attribute/_partials/value-row', [
$initialRowsHtml .= \Shared\Tpl\Tpl::view('shop-attribute/_partials/value-row', [
'rowKey' => 'new-1',
'value' => ['id' => 0, 'is_default' => 1, 'impact_on_the_price' => null, 'languages' => []],
'languages' => $activeLanguages,
@@ -55,7 +55,7 @@ if (!empty($values)) {
]);
}
$newRowTemplate = \Tpl::view('shop-attribute/_partials/value-row', [
$newRowTemplate = \Shared\Tpl\Tpl::view('shop-attribute/_partials/value-row', [
'rowKey' => '__ROW_KEY__',
'value' => ['id' => 0, 'is_default' => 0, 'impact_on_the_price' => null, 'languages' => []],
'languages' => $activeLanguages,

View File

@@ -28,7 +28,7 @@ ob_start();
</a>
</div>
</div>
<?= \Tpl::view( 'shop-category/subcategories-list', [
<?= \Shared\Tpl\Tpl::view( 'shop-category/subcategories-list', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category['id'] ),
'level' => $this -> level + 1,
'dlang' => $this -> dlang
@@ -49,4 +49,4 @@ $gridContent = $out;
$gridPersist = false;
include __DIR__ . '/../components/grid-edit-replacement.php';
?>
<?= \Tpl::view( 'shop-category/categories-list-custom-script' ); ?>
<?= \Shared\Tpl\Tpl::view( 'shop-category/categories-list-custom-script' ); ?>

View File

@@ -18,7 +18,7 @@ ob_start();
</a>
</div>
</div>
<?= \Tpl::view( 'shop-category/subcategory-browse-list', [
<?= \Shared\Tpl\Tpl::view( 'shop-category/subcategory-browse-list', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category['id'] ),
'level' => $this -> level + 1,
'dlang' => $this -> dlang
@@ -55,4 +55,4 @@ include __DIR__ . '/../components/grid-edit-replacement.php';
float: none;
}
</style>
<?= \Tpl::view( 'shop-category/category-browse-custom-script' ); ?>
<?= \Shared\Tpl\Tpl::view( 'shop-category/category-browse-custom-script' ); ?>

View File

@@ -190,5 +190,5 @@ $gridPersist = true;
include __DIR__ . '/../components/grid-edit-replacement.php';
?>
<?= \Tpl::view( 'shop-category/category-edit-custom-script' ); ?>
<?= \Shared\Tpl\Tpl::view( 'shop-category/category-edit-custom-script' ); ?>

View File

@@ -27,4 +27,4 @@ $gridContent = $out;
$gridPersist = false;
include __DIR__ . '/../components/grid-edit-replacement.php';
?>
<?= \Tpl::view( 'shop-category/category-products-custom-script', [ 'category_id' => $this -> category_id ] ); ?>
<?= \Shared\Tpl\Tpl::view( 'shop-category/category-products-custom-script', [ 'category_id' => $this -> category_id ] ); ?>

View File

@@ -25,7 +25,7 @@
<? endif;?>
</div>
</div>
<?= \Tpl::view( 'shop-category/subcategories-list', [
<?= \Shared\Tpl\Tpl::view( 'shop-category/subcategories-list', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category['id'] ),
'level' => $this -> level + 1,
'dlang' => $this -> dlang

View File

@@ -14,7 +14,7 @@
</a>
</div>
</div>
<?= \Tpl::view( 'shop-category/subcategory-browse-list', [
<?= \Shared\Tpl\Tpl::view( 'shop-category/subcategory-browse-list', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category['id'] ),
'level' => $this -> level + 1,
'dlang' => $this -> dlang

View File

@@ -6,4 +6,4 @@
<br />
<?= \Tpl::view('components/table-list', ['list' => $this->ordersTable]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->ordersTable]); ?>

View File

@@ -1,2 +1,2 @@
<div class="site-title">Lista klientów</div>
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -8,7 +8,7 @@ $selectedIds = is_array($this->selectedIds ?? null) ? $this->selectedIds : [];
<label class="col-lg-4 control-label"><?= htmlspecialchars($label, ENT_QUOTES, 'UTF-8'); ?>:</label>
<div class="col-lg-8">
<div class="coupon-categories-box">
<?= \Tpl::view('shop-coupon/coupon-categories-tree', [
<?= \Shared\Tpl\Tpl::view('shop-coupon/coupon-categories-tree', [
'categories' => $categories,
'selectedIds' => $selectedIds,
'inputName' => $inputName,

View File

@@ -55,7 +55,7 @@ foreach ($selectedRaw as $value) {
</div>
<?php if ($hasChildren): ?>
<?= \Tpl::view('shop-coupon/coupon-categories-tree', [
<?= \Shared\Tpl\Tpl::view('shop-coupon/coupon-categories-tree', [
'categories' => $children,
'selectedIds' => array_keys($selected),
'inputName' => $inputName,

View File

@@ -1,3 +1,3 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Tpl::view('shop-coupon/coupon-edit-custom-script'); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('shop-coupon/coupon-edit-custom-script'); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -217,7 +217,7 @@ $orderId = (int)($this -> order['id'] ?? 0);
<?= $this -> order['trustmate_send'] ? 'Odznacz zamówienie jako wysłane do trustmate.io' : 'Zaznacz zamówienie jako wysłane do trustmate.io';?>
</a>
</div>
<?= \Tpl::view('shop-order/order-details-custom-script', [
<?= \Shared\Tpl\Tpl::view('shop-order/order-details-custom-script', [
'order_id' => $orderId,
'trustmate_send' => (int)($this -> order['trustmate_send'] ?? 0),
]);?>

View File

@@ -222,4 +222,4 @@ $orderId = (int)($this -> order['id'] ?? 0);
</div>
<link class="footer" rel="stylesheet" type="text/css" href="https://geowidget.easypack24.net/css/easypack.css">
<script class="footer" type="text/javascript" src="https://geowidget.easypack24.net/js/sdk-for-javascript.js"></script>
<?= \Tpl::view('shop-order/order-edit-custom-script');?>
<?= \Shared\Tpl\Tpl::view('shop-order/order-edit-custom-script');?>

View File

@@ -1,2 +1,2 @@
<div class="site-title">Lista zamówień</div>
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Tpl::view('shop-product-sets/product-set-edit-custom-script'); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('shop-product-sets/product-set-edit-custom-script'); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -96,7 +96,7 @@
<input type="checkbox" class="g-checkbox" name="mass_categories[]" value="<?= $category['id']; ?>" />
<b><?= $category['languages'][$this->dlang]['title']; ?></b>
</div>
<?= \Tpl::view( 'shop-product/subcategories-list', [
<?= \Shared\Tpl\Tpl::view( 'shop-product/subcategories-list', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category['id'] ),
'level' => ($this->level ?? 0) + 1,
'dlang' => $this->dlang,
@@ -111,4 +111,4 @@
</div>
</div>
<?= \Tpl::view( 'shop-product/mass-edit-custom-script' ); ?>
<?= \Shared\Tpl\Tpl::view( 'shop-product/mass-edit-custom-script' ); ?>

View File

@@ -1,5 +1,5 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Tpl::view('shop-product/product-edit-custom-script', [
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('shop-product/product-edit-custom-script', [
'product' => $this->product,
'user' => $this->user,
'languages' => $this->form->languages ?? []

View File

@@ -1,7 +1,7 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?php if (!empty($this->viewModel->customScriptView)): ?>
<?= \Tpl::view($this->viewModel->customScriptView, [
<?= \Shared\Tpl\Tpl::view($this->viewModel->customScriptView, [
'list' => $this->viewModel,
'apilo_enabled' => $this->apilo_enabled,
'shoppro_enabled' => $this->shoppro_enabled,

View File

@@ -11,7 +11,7 @@
<b><?= $category[ 'languages' ][ $this -> dlang ][ 'title' ];?></b>
</div>
<?=
\Tpl::view( 'shop-product/subcategories-list', [
\Shared\Tpl\Tpl::view( 'shop-product/subcategories-list', [
'categories' => ( new \Domain\Category\CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $category[ 'id' ] ),
'product_categories' => $this -> product_categories,
'dlang' => $this -> dlang,

View File

@@ -8,7 +8,7 @@ $selectedIds = is_array($this->selectedIds ?? null) ? $this->selectedIds : [];
<label class="col-lg-4 control-label"><?= htmlspecialchars($label, ENT_QUOTES, 'UTF-8'); ?>:</label>
<div class="col-lg-8">
<div class="promotion-categories-box">
<?= \Tpl::view('shop-promotion/promotion-categories-tree', [
<?= \Shared\Tpl\Tpl::view('shop-promotion/promotion-categories-tree', [
'categories' => $categories,
'selectedIds' => $selectedIds,
'inputName' => $inputName,

View File

@@ -55,7 +55,7 @@ foreach ($selectedRaw as $value) {
</div>
<?php if ($hasChildren): ?>
<?= \Tpl::view('shop-promotion/promotion-categories-tree', [
<?= \Shared\Tpl\Tpl::view('shop-promotion/promotion-categories-tree', [
'categories' => $children,
'selectedIds' => array_keys($selected),
'inputName' => $inputName,

View File

@@ -1,3 +1,3 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Tpl::view('shop-promotion/promotion-edit-custom-script'); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('shop-promotion/promotion-edit-custom-script'); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1,8 +1,8 @@
<?php
echo \Tpl::view('components/form-edit', [
echo \Shared\Tpl\Tpl::view('components/form-edit', [
'form' => $this->form,
]);
echo \Tpl::view('shop-transport/transport-edit-custom-script', [
echo \Shared\Tpl\Tpl::view('shop-transport/transport-edit-custom-script', [
'form' => $this->form,
]);

View File

@@ -1 +1 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/form-edit', ['form' => $this->form]); ?>
<?= \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $this->form]); ?>

View File

@@ -1,2 +1,2 @@
<?= \Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>
<?= \Shared\Tpl\Tpl::view('components/table-list', ['list' => $this->viewModel]); ?>

View File

@@ -5,21 +5,21 @@ class Html
{
public static function form_text( array $params = array() )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/form-text' );
}
public static function input_switch( array $params = array() )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/input-switch' );
}
public static function select( array $params = array() )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/select' );
}
@@ -32,7 +32,7 @@ class Html
$params = array_merge( $defaults, $params );
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/textarea' );
}
@@ -45,7 +45,7 @@ class Html
$params = array_merge( $defaults, $params );
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/input-icon' );
}
@@ -58,7 +58,7 @@ class Html
$params = array_merge( $defaults, $params );
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/input' );
}
@@ -71,7 +71,7 @@ class Html
$params = array_merge( $defaults, $params );
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/button' );
}
@@ -86,7 +86,7 @@ class Html
$params = array_merge( $defaults, $params );
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> params = $params;
return $tpl -> render( 'html/panel' );
}

View File

@@ -0,0 +1,63 @@
<?php
namespace Shared\Tpl;
class Tpl
{
protected $vars = array();
public static function view($file, $values = '')
{
$tpl = new self;
if (is_array($values)) foreach ($values as $key => $val)
$tpl->$key = $val;
return $tpl->render($file);
}
public function secureHTML($val)
{
$out = stripslashes($val);
$out = str_replace("'", "&#039;", $out);
$out = str_replace('"', "&#34;", $out);
$out = str_replace("<", "&lt;", $out);
$out = str_replace(">", "&gt;", $out);
return $out;
}
public function render($file)
{
$paths = [
'templates_user/' . $file . '.php',
'templates/' . $file . '.php',
'../templates_user/' . $file . '.php',
'../templates/' . $file . '.php',
$file . '.php',
];
foreach ($paths as $path) {
if (file_exists($path)) {
return $this->renderFile($path);
}
}
return '<div class="alert alert-danger" role="alert">Nie znaleziono pliku widoku: <b>' . $file . '.php</b>';
}
private function renderFile($path)
{
ob_start();
include $path;
$out = ob_get_contents();
ob_end_clean();
return $out;
}
public function __set($name, $value)
{
$this->vars[$name] = $value;
}
public function __get($name)
{
return $this->vars[$name];
}
}

View File

@@ -171,7 +171,7 @@ class App
return $controller->login_form();
}
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->content = self::route();
return $tpl->render( 'site/main-layout' );
}

View File

@@ -105,7 +105,7 @@ class ArticlesArchiveController
'Brak danych w tabeli.'
);
return \Tpl::view('articles/articles-archive-list', [
return \Shared\Tpl\Tpl::view('articles/articles-archive-list', [
'viewModel' => $viewModel,
]);
}

View File

@@ -146,7 +146,7 @@ class ArticlesController
'Dodaj artykul'
);
return \Tpl::view('articles/articles-list', [
return \Shared\Tpl\Tpl::view('articles/articles-list', [
'viewModel' => $viewModel,
]);
}
@@ -289,7 +289,7 @@ class ArticlesController
$viewModel = $this->buildFormViewModel($article, $languages, $menus, $layouts);
return \Tpl::view('articles/article-edit', [
return \Shared\Tpl\Tpl::view('articles/article-edit', [
'form' => $viewModel,
'article' => $article,
'user' => $user,
@@ -444,7 +444,7 @@ class ArticlesController
. '<i class="fa fa-caret-right"></i>'
. '</button>Menu: <b>' . $menuName . '</b>';
$html .= '</div>';
$html .= \Tpl::view('articles/subpages-list', [
$html .= \Shared\Tpl\Tpl::view('articles/subpages-list', [
'pages' => $menuPages,
'article_pages' => $article['pages'] ?? [],
'parent_id' => $menuId,

View File

@@ -154,7 +154,7 @@ class BannerController
'banners/banners-list-custom-script'
);
return \Tpl::view('banners/banners-list', [
return \Shared\Tpl\Tpl::view('banners/banners-list', [
'viewModel' => $viewModel,
]);
}
@@ -176,7 +176,7 @@ class BannerController
$viewModel = $this->buildFormViewModel($banner, $languages, $validationErrors);
return \Tpl::view('components/form-edit', ['form' => $viewModel]);
return \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $viewModel]);
}
/**

View File

@@ -17,7 +17,7 @@ class DashboardController
public function main_view(): string
{
return \Tpl::view( 'dashboard/main-view', [
return \Shared\Tpl\Tpl::view( 'dashboard/main-view', [
'last_orders' => $this->repository->lastOrders(),
'order_statuses' => $this->statusesRepository->allStatuses(),
'sales' => $this->repository->last24MonthsSales(),

View File

@@ -111,7 +111,7 @@ class DictionariesController
'Dodaj jednostke miary'
);
return \Tpl::view('dictionaries/units-list', [
return \Shared\Tpl\Tpl::view('dictionaries/units-list', [
'viewModel' => $viewModel,
]);
}
@@ -129,7 +129,7 @@ class DictionariesController
$viewModel = $this->buildFormViewModel($unit, $languages, $validationErrors);
return \Tpl::view('dictionaries/unit-edit', ['form' => $viewModel]);
return \Shared\Tpl\Tpl::view('dictionaries/unit-edit', ['form' => $viewModel]);
}
public function save(): void

View File

@@ -11,7 +11,7 @@ class FilemanagerController
$akey = $this->ensureFilemanagerAccessKey();
$filemanagerUrl = $this->buildFilemanagerUrl($akey);
return \Tpl::view('filemanager/filemanager', [
return \Shared\Tpl\Tpl::view('filemanager/filemanager', [
'filemanager_url' => $filemanagerUrl,
]);
}

View File

@@ -14,7 +14,7 @@ class IntegrationsController
public function apilo_settings(): string
{
return \Tpl::view( 'integrations/apilo-settings', [
return \Shared\Tpl\Tpl::view( 'integrations/apilo-settings', [
'settings' => $this->repository->getSettings( 'apilo' ),
'apilo_status' => $this->repository->apiloIntegrationStatus(),
] );
@@ -127,7 +127,7 @@ class IntegrationsController
public function shoppro_settings(): string
{
return \Tpl::view( 'integrations/shoppro-settings', [
return \Shared\Tpl\Tpl::view( 'integrations/shoppro-settings', [
'settings' => $this->repository->getSettings( 'shoppro' ),
] );
}

View File

@@ -131,7 +131,7 @@ class LanguagesController
'Dodaj jezyk'
);
return \Tpl::view('languages/languages-list', [
return \Shared\Tpl\Tpl::view('languages/languages-list', [
'viewModel' => $viewModel,
]);
}
@@ -150,7 +150,7 @@ class LanguagesController
unset($_SESSION['form_errors'][$this->getLanguageFormId()]);
}
return \Tpl::view('languages/language-edit', [
return \Shared\Tpl\Tpl::view('languages/language-edit', [
'form' => $this->buildLanguageFormViewModel($language, $this->repository->maxOrder(), $validationErrors),
]);
}
@@ -324,7 +324,7 @@ class LanguagesController
'Dodaj tlumaczenie'
);
return \Tpl::view('languages/translations-list', [
return \Shared\Tpl\Tpl::view('languages/translations-list', [
'viewModel' => $viewModel,
]);
}
@@ -339,7 +339,7 @@ class LanguagesController
unset($_SESSION['form_errors'][$this->getTranslationFormId()]);
}
return \Tpl::view('languages/translation-edit', [
return \Shared\Tpl\Tpl::view('languages/translation-edit', [
'form' => $this->buildTranslationFormViewModel($translation, $languages, $validationErrors),
]);
}

View File

@@ -128,14 +128,14 @@ class LayoutsController
'Dodaj szablon'
);
return \Tpl::view('layouts/layouts-list', [
return \Shared\Tpl\Tpl::view('layouts/layouts-list', [
'viewModel' => $viewModel,
]);
}
public function edit(): string
{
return \Tpl::view('layouts/layout-edit', [
return \Shared\Tpl\Tpl::view('layouts/layout-edit', [
'layout' => $this->repository->find((int)\Shared\Helpers\Helpers::get('id')),
'menus' => $this->repository->menusWithPages(),
'categories' => $this->repository->categoriesTree(),

View File

@@ -126,7 +126,7 @@ class NewsletterController
'Brak danych w tabeli.'
);
return \Tpl::view('newsletter/emails-list', [
return \Shared\Tpl\Tpl::view('newsletter/emails-list', [
'viewModel' => $viewModel,
]);
}
@@ -173,7 +173,7 @@ class NewsletterController
unset($_SESSION['form_errors'][$this->settingsFormId()]);
}
return \Tpl::view('newsletter/settings', [
return \Shared\Tpl\Tpl::view('newsletter/settings', [
'form' => $this->buildSettingsFormViewModel($settings, $validationErrors),
]);
}
@@ -223,7 +223,7 @@ class NewsletterController
public function email_templates_admin(): string
{
$viewModel = $this->templatesListViewModel();
return \Tpl::view('newsletter/email-templates-admin', [
return \Shared\Tpl\Tpl::view('newsletter/email-templates-admin', [
'viewModel' => $viewModel,
]);
}
@@ -243,7 +243,7 @@ class NewsletterController
unset($_SESSION['form_errors'][$formId]);
}
return \Tpl::view('newsletter/email-template-edit', [
return \Shared\Tpl\Tpl::view('newsletter/email-template-edit', [
'form' => $this->buildTemplateFormViewModel($template, $validationErrors),
]);
}

View File

@@ -27,7 +27,7 @@ class PagesController
public function list(): string
{
return \Tpl::view('pages/pages-list', [
return \Shared\Tpl\Tpl::view('pages/pages-list', [
'menus' => $this->repository->menusWithPages(),
'cookie_pages' => $this->cookieState('cookie_pages'),
'cookie_menus' => $this->cookieState('cookie_menus'),
@@ -43,7 +43,7 @@ class PagesController
$menus[$index]['pages'] = $this->withPreviewUrls($menu['pages'] ?? [], $defaultLanguage);
}
return \Tpl::view('pages/pages-browse-list', [
return \Shared\Tpl\Tpl::view('pages/pages-browse-list', [
'menus' => $menus,
'modal' => \Shared\Helpers\Helpers::get('modal'),
'cookie_pages' => $this->cookieState('cookie_pages'),
@@ -60,7 +60,7 @@ class PagesController
{
$menu = $this->repository->menuDetails((int)\Shared\Helpers\Helpers::get('id'));
return \Tpl::view('pages/menu-edit', [
return \Shared\Tpl\Tpl::view('pages/menu-edit', [
'form' => $this->buildMenuFormViewModel($menu),
]);
}
@@ -174,7 +174,7 @@ class PagesController
$layouts = $this->layoutsRepository->listAll();
$languages = $this->languagesRepository->languagesList();
return \Tpl::view('pages/page-edit', [
return \Shared\Tpl\Tpl::view('pages/page-edit', [
'form' => $this->buildPageFormViewModel(
$page,
$parentId,
@@ -537,7 +537,7 @@ class PagesController
public function pageArticles(): string
{
$pageId = (int)\Shared\Helpers\Helpers::get('id');
return \Tpl::view('pages/page-articles', [
return \Shared\Tpl\Tpl::view('pages/page-articles', [
'page_id' => $pageId,
'articles' => $this->repository->pageArticles($pageId),
]);

View File

@@ -147,7 +147,7 @@ class ProductArchiveController
'product-archive/products-list-custom-script'
);
return \Tpl::view('product-archive/products-list', [
return \Shared\Tpl\Tpl::view('product-archive/products-list', [
'viewModel' => $viewModel,
]);
}

View File

@@ -125,7 +125,7 @@ class ScontainersController
'Dodaj kontener'
);
return \Tpl::view('scontainers/containers-list', [
return \Shared\Tpl\Tpl::view('scontainers/containers-list', [
'viewModel' => $viewModel,
]);
}
@@ -144,7 +144,7 @@ class ScontainersController
unset($_SESSION['form_errors'][$this->formId()]);
}
return \Tpl::view('scontainers/container-edit', [
return \Shared\Tpl\Tpl::view('scontainers/container-edit', [
'form' => $this->buildFormViewModel($container, $languages, $validationErrors),
]);
}

View File

@@ -279,7 +279,7 @@ class SettingsController
$viewModel = $this->buildFormViewModel($settings, $languages, $validationErrors);
return \Tpl::view('components/form-edit', ['form' => $viewModel]);
return \Shared\Tpl\Tpl::view('components/form-edit', ['form' => $viewModel]);
}
private function buildFormViewModel(array $settings, array $languages, ?array $errors = null): FormEditViewModel

View File

@@ -143,7 +143,7 @@ class ShopAttributeController
'Dodaj ceche'
);
return \Tpl::view('shop-attribute/attributes-list', [
return \Shared\Tpl\Tpl::view('shop-attribute/attributes-list', [
'viewModel' => $viewModel,
]);
}
@@ -153,7 +153,7 @@ class ShopAttributeController
$attribute = $this->repository->findAttribute((int)\Shared\Helpers\Helpers::get('id'));
$languages = $this->languagesRepository->languagesList();
return \Tpl::view('shop-attribute/attribute-edit', [
return \Shared\Tpl\Tpl::view('shop-attribute/attribute-edit', [
'form' => $this->buildFormViewModel($attribute, $languages),
]);
}
@@ -236,7 +236,7 @@ class ShopAttributeController
$languages = $this->languagesRepository->languagesList();
return \Tpl::view('shop-attribute/values-edit', [
return \Shared\Tpl\Tpl::view('shop-attribute/values-edit', [
'attribute' => $attribute,
'values' => $this->repository->findValues($attributeId),
'languages' => $languages,
@@ -318,7 +318,7 @@ class ShopAttributeController
$rowKey = 'new-' . time();
}
$html = \Tpl::view('shop-attribute/_partials/value-row', [
$html = \Shared\Tpl\Tpl::view('shop-attribute/_partials/value-row', [
'rowKey' => $rowKey,
'value' => ['id' => 0, 'is_default' => 0, 'impact_on_the_price' => null, 'languages' => []],
'languages' => $this->languagesRepository->languagesList(),

View File

@@ -17,7 +17,7 @@ class ShopCategoryController
public function view_list(): string
{
return \Tpl::view('shop-category/categories-list', [
return \Shared\Tpl\Tpl::view('shop-category/categories-list', [
'categories' => $this->repository->subcategories(null),
'level' => 0,
'dlang' => $this->languagesRepository->defaultLanguage(),
@@ -31,7 +31,7 @@ class ShopCategoryController
public function category_edit(): string
{
return \Tpl::view('shop-category/category-edit', [
return \Shared\Tpl\Tpl::view('shop-category/category-edit', [
'category' => $this->repository->categoryDetails(\Shared\Helpers\Helpers::get('id')),
'pid' => \Shared\Helpers\Helpers::get('pid'),
'languages' => $this->languagesRepository->languagesList(),
@@ -87,7 +87,7 @@ class ShopCategoryController
public function category_products(): string
{
return \Tpl::view('shop-category/category-products', [
return \Shared\Tpl\Tpl::view('shop-category/category-products', [
'category_id' => \Shared\Helpers\Helpers::get('id'),
'products' => $this->repository->categoryProducts((int)\Shared\Helpers\Helpers::get('id')),
]);
@@ -100,7 +100,7 @@ class ShopCategoryController
public function category_url_browser(): void
{
echo \Tpl::view('shop-category/category-browse-list', [
echo \Shared\Tpl\Tpl::view('shop-category/category-browse-list', [
'categories' => $this->repository->subcategories(null),
'level' => 0,
'dlang' => $this->languagesRepository->defaultLanguage(),

View File

@@ -143,7 +143,7 @@ class ShopClientsController
'Brak danych w tabeli.'
);
return \Tpl::view('shop-clients/view-list', [
return \Shared\Tpl\Tpl::view('shop-clients/view-list', [
'viewModel' => $viewModel,
]);
}
@@ -205,7 +205,7 @@ class ShopClientsController
'Brak zamowien klienta.'
);
return \Tpl::view('shop-clients/clients-details', [
return \Shared\Tpl\Tpl::view('shop-clients/clients-details', [
'name' => $name,
'surname' => $surname,
'email' => $email,

View File

@@ -160,7 +160,7 @@ class ShopCouponController
'Dodaj kupon'
);
return \Tpl::view('shop-coupon/coupons-list', [
return \Shared\Tpl\Tpl::view('shop-coupon/coupons-list', [
'viewModel' => $viewModel,
]);
}
@@ -175,7 +175,7 @@ class ShopCouponController
$coupon = $this->repository->find((int)\Shared\Helpers\Helpers::get('id'));
$categories = $this->repository->categoriesTree(null);
return \Tpl::view('shop-coupon/coupon-edit-new', [
return \Shared\Tpl\Tpl::view('shop-coupon/coupon-edit-new', [
'form' => $this->buildFormViewModel($coupon, $categories),
]);
}
@@ -315,7 +315,7 @@ class ShopCouponController
'label' => 'Dotyczy rowniez produktow przecenionych',
'tab' => 'settings',
]),
FormField::custom('coupon_categories', \Tpl::view('shop-coupon/coupon-categories-selector', [
FormField::custom('coupon_categories', \Shared\Tpl\Tpl::view('shop-coupon/coupon-categories-selector', [
'label' => 'Ogranicz promocje do wybranych kategorii',
'inputName' => 'categories[]',
'categories' => $categories,

View File

@@ -150,7 +150,7 @@ class ShopOrderController
'Brak danych w tabeli.'
);
return \Tpl::view('shop-order/orders-list', [
return \Shared\Tpl\Tpl::view('shop-order/orders-list', [
'viewModel' => $viewModel,
]);
}
@@ -170,7 +170,7 @@ class ShopOrderController
$coupon = new \shop\Coupon((int)$order['coupon_id']);
}
return \Tpl::view('shop-order/order-details', [
return \Shared\Tpl\Tpl::view('shop-order/order-details', [
'order' => $order,
'coupon' => $coupon,
'order_statuses' => $this->service->statuses(),
@@ -188,7 +188,7 @@ class ShopOrderController
{
$orderId = (int)\Shared\Helpers\Helpers::get('order_id');
return \Tpl::view('shop-order/order-edit', [
return \Shared\Tpl\Tpl::view('shop-order/order-edit', [
'order' => $this->service->details($orderId),
'order_statuses' => $this->service->statuses(),
'transport' => \shop\Transport::transport_list(),

View File

@@ -124,7 +124,7 @@ class ShopPaymentMethodController
'Brak danych w tabeli.'
);
return \Tpl::view('shop-payment-method/payment-methods-list', [
return \Shared\Tpl\Tpl::view('shop-payment-method/payment-methods-list', [
'viewModel' => $viewModel,
]);
}
@@ -138,7 +138,7 @@ class ShopPaymentMethodController
exit;
}
return \Tpl::view('shop-payment-method/payment-method-edit', [
return \Shared\Tpl\Tpl::view('shop-payment-method/payment-method-edit', [
'form' => $this->buildFormViewModel($paymentMethod, $this->getApiloPaymentTypes()),
]);
}

View File

@@ -134,7 +134,7 @@ class ShopProducerController
'Dodaj producenta'
);
return \Tpl::view('shop-producer/producers-list', [
return \Shared\Tpl\Tpl::view('shop-producer/producers-list', [
'viewModel' => $viewModel,
]);
}
@@ -153,7 +153,7 @@ class ShopProducerController
unset($_SESSION['form_errors'][$this->formId()]);
}
return \Tpl::view('shop-producer/producer-edit', [
return \Shared\Tpl\Tpl::view('shop-producer/producer-edit', [
'form' => $this->buildFormViewModel($producer, $languages, $validationErrors),
]);
}

View File

@@ -190,7 +190,7 @@ class ShopProductController
'shop-product/products-list-custom-script'
);
return \Tpl::view( 'shop-product/products-list', [
return \Shared\Tpl\Tpl::view( 'shop-product/products-list', [
'viewModel' => $viewModel,
'apilo_enabled' => $apiloEnabled,
'shoppro_enabled' => $shopproEnabled,
@@ -230,7 +230,7 @@ class ShopProductController
$product, $languages, $categories, $layouts, $products, $sets, $producers, $units, $dlang
);
return \Tpl::view( 'shop-product/product-edit', [
return \Shared\Tpl\Tpl::view( 'shop-product/product-edit', [
'form' => $viewModel,
'product' => $product,
'user' => $user,
@@ -600,7 +600,7 @@ class ShopProductController
$html .= '<input type="checkbox" class="g-checkbox" name="categories[]" value="' . $catId . '"' . ( $checked ? ' checked="checked"' : '' ) . ' />';
$html .= '<b>' . $catTitle . '</b>';
$html .= '</div>';
$html .= \Tpl::view( 'shop-product/subcategories-list', [
$html .= \Shared\Tpl\Tpl::view( 'shop-product/subcategories-list', [
'categories' => ( new CategoryRepository( $GLOBALS['mdb'] ) )->subcategories( $catId ),
'product_categories' => $product['categories'] ?? [],
'dlang' => $dlang,
@@ -949,7 +949,7 @@ class ShopProductController
{
$db = $GLOBALS['mdb'];
return \Tpl::view( 'shop-product/product-combination', [
return \Shared\Tpl\Tpl::view( 'shop-product/product-combination', [
'product' => $this->repository->findForAdmin( (int) \Shared\Helpers\Helpers::get( 'product_id' ) ),
'attributes' => ( new \Domain\Attribute\AttributeRepository( $db ) )->getAttributesListForCombinations(),
'default_language' => $this->languagesRepository->defaultLanguage(),
@@ -1146,7 +1146,7 @@ class ShopProductController
{
$categoryRepository = new CategoryRepository( $GLOBALS['mdb'] );
return \Tpl::view( 'shop-product/mass-edit', [
return \Shared\Tpl\Tpl::view( 'shop-product/mass-edit', [
'products' => $this->repository->allProductsForMassEdit(),
'categories' => $categoryRepository->subcategories( null ),
'dlang' => $this->languagesRepository->defaultLanguage(),

View File

@@ -120,7 +120,7 @@ class ShopProductSetsController
'Dodaj komplet produktow'
);
return \Tpl::view('shop-product-sets/product-sets-list', [
return \Shared\Tpl\Tpl::view('shop-product-sets/product-sets-list', [
'viewModel' => $viewModel,
]);
}
@@ -135,7 +135,7 @@ class ShopProductSetsController
$set = $this->repository->find((int)\Shared\Helpers\Helpers::get('id'));
$products = $this->repository->allProductsMap();
return \Tpl::view('shop-product-sets/product-set-edit', [
return \Shared\Tpl\Tpl::view('shop-product-sets/product-set-edit', [
'form' => $this->buildFormViewModel($set, $products),
]);
}

View File

@@ -129,7 +129,7 @@ class ShopPromotionController
'Dodaj promocje'
);
return \Tpl::view('shop-promotion/promotions-list', [
return \Shared\Tpl\Tpl::view('shop-promotion/promotions-list', [
'viewModel' => $viewModel,
]);
}
@@ -139,7 +139,7 @@ class ShopPromotionController
$promotion = $this->repository->find((int)\Shared\Helpers\Helpers::get('id'));
$categories = $this->repository->categoriesTree(null);
return \Tpl::view('shop-promotion/promotion-edit', [
return \Shared\Tpl\Tpl::view('shop-promotion/promotion-edit', [
'form' => $this->buildFormViewModel($promotion, $categories),
]);
}
@@ -280,7 +280,7 @@ class ShopPromotionController
'label' => 'Data do',
'tab' => 'settings',
]),
FormField::custom('categories_group_1', \Tpl::view('shop-promotion/promotion-categories-selector', [
FormField::custom('categories_group_1', \Shared\Tpl\Tpl::view('shop-promotion/promotion-categories-selector', [
'label' => 'Kategorie grupa I',
'inputName' => 'categories[]',
'categories' => $categories,
@@ -288,7 +288,7 @@ class ShopPromotionController
]), [
'tab' => 'categories',
]),
FormField::custom('categories_group_2', \Tpl::view('shop-promotion/promotion-categories-selector', [
FormField::custom('categories_group_2', \Shared\Tpl\Tpl::view('shop-promotion/promotion-categories-selector', [
'label' => 'Kategorie grupa II',
'inputName' => 'condition_categories[]',
'categories' => $categories,

View File

@@ -115,7 +115,7 @@ class ShopStatusesController
'Brak danych w tabeli.'
);
return \Tpl::view('shop-statuses/view-list', [
return \Shared\Tpl\Tpl::view('shop-statuses/view-list', [
'viewModel' => $viewModel,
]);
}
@@ -131,7 +131,7 @@ class ShopStatusesController
$apiloStatusList = $this->getApiloStatusList();
return \Tpl::view('shop-statuses/status-edit', [
return \Shared\Tpl\Tpl::view('shop-statuses/status-edit', [
'form' => $this->buildFormViewModel($status, $apiloStatusList),
]);
}

View File

@@ -138,7 +138,7 @@ class ShopTransportController
'Brak danych w tabeli.'
);
return \Tpl::view('shop-transport/transports-list', [
return \Shared\Tpl\Tpl::view('shop-transport/transports-list', [
'viewModel' => $viewModel,
]);
}
@@ -155,7 +155,7 @@ class ShopTransportController
$paymentMethods = $this->paymentMethodRepository->allForAdmin();
$apiloCarrierAccounts = $this->getApiloCarrierAccounts();
return \Tpl::view('shop-transport/transport-edit', [
return \Shared\Tpl\Tpl::view('shop-transport/transport-edit', [
'form' => $this->buildFormViewModel($transport, $paymentMethods, $apiloCarrierAccounts),
]);
}

View File

@@ -14,7 +14,7 @@ class UpdateController
public function main_view(): string
{
return \Tpl::view( 'update/main-view', [
return \Shared\Tpl\Tpl::view( 'update/main-view', [
'ver' => \Shared\Helpers\Helpers::get_version(),
'new_ver' => \Shared\Helpers\Helpers::get_new_version(),
] );

View File

@@ -122,7 +122,7 @@ class UsersController
unset($_SESSION['form_errors'][$this->getFormId()]);
}
return \Tpl::view('users/user-edit', [
return \Shared\Tpl\Tpl::view('users/user-edit', [
'form' => $this->buildFormViewModel($user, $validationErrors),
]);
}
@@ -228,7 +228,7 @@ class UsersController
'Dodaj uzytkownika'
);
return \Tpl::view('users/users-list', [
return \Shared\Tpl\Tpl::view('users/users-list', [
'viewModel' => $viewModel,
]);
}
@@ -240,13 +240,13 @@ class UsersController
public function login_form(): string
{
return \Tpl::view('site/unlogged-layout');
return \Shared\Tpl\Tpl::view('site/unlogged-layout');
}
public function twofa(): string
{
return \Tpl::view('site/unlogged', [
'content' => \Tpl::view('users/user-2fa'),
return \Shared\Tpl\Tpl::view('site/unlogged', [
'content' => \Shared\Tpl\Tpl::view('users/user-2fa'),
]);
}

View File

@@ -8,7 +8,7 @@ class Articles
*/
public static function fullArticle( $article )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->article = $article;
return $tpl->render( 'articles/article' );
}
@@ -22,14 +22,14 @@ class Articles
if ( is_array( $articles ) ) foreach ( $articles as $article )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->article = $article;
$out .= $tpl->render( 'articles/article-miniature' );
}
if ( $ls > 1 )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->ls = $ls;
$tpl->bs = $bs ? $bs : 1;
$tpl->page = $page;
@@ -44,14 +44,14 @@ class Articles
*/
public static function entryArticlesList( $articles, $ls, $bs, $page )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->page_id = $page['id'];
$tpl->articles = $articles;
$out = $tpl->render( 'articles/articles-entries' );
if ( $ls > 1 )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->ls = $ls;
$tpl->bs = $bs ? $bs : 1;
$tpl->page = $page;
@@ -70,14 +70,14 @@ class Articles
if ( is_array( $articles ) ) foreach ( $articles as $article )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->article = $article;
$out .= $tpl->render( 'articles/article-full' );
}
if ( $ls > 1 )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->ls = $ls;
$tpl->bs = $bs ? $bs : 1;
$tpl->page = $page;
@@ -92,7 +92,7 @@ class Articles
*/
public static function news( $page_id, $articles )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->page_id = $page_id;
$tpl->articles = $articles;
return $tpl->render( 'articles/news' );
@@ -103,7 +103,7 @@ class Articles
*/
public static function newsList( $articles )
{
return \Tpl::view( 'articles/news-list', [
return \Shared\Tpl\Tpl::view( 'articles/news-list', [
'articles' => $articles
] );
}

View File

@@ -5,7 +5,7 @@ class Banners
{
public static function banners($banners)
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->banners = $banners;
return $tpl->render('banner/banners');
}
@@ -13,7 +13,7 @@ class Banners
public static function mainBanner($banner)
{
if (!\Shared\Helpers\Helpers::get_session('banner_close') && is_array($banner)) {
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl->banner = $banner;
return $tpl->render('banner/main-banner');
}

View File

@@ -5,7 +5,7 @@ class Languages
{
public static function render( $languages )
{
$tpl = new \Tpl;
$tpl = new \Shared\Tpl\Tpl;
$tpl -> languages = $languages;
return $tpl -> render( 'site/languages' );
}

Some files were not shown because too many files have changed in this diff Show More