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:
@@ -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' );
|
||||
}
|
||||
|
||||
63
autoload/Shared/Tpl/Tpl.php
Normal file
63
autoload/Shared/Tpl/Tpl.php
Normal 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("'", "'", $out);
|
||||
$out = str_replace('"', """, $out);
|
||||
$out = str_replace("<", "<", $out);
|
||||
$out = str_replace(">", ">", $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];
|
||||
}
|
||||
}
|
||||
@@ -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' );
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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' ),
|
||||
] );
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
|
||||
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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()),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
] );
|
||||
|
||||
@@ -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'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
] );
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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' );
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class Newsletter
|
||||
{
|
||||
public static function render()
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
return $tpl -> render( 'newsletter/newsletter' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class ShopBasket
|
||||
\Shared\Helpers\Helpers::set_session( 'basket', $basket );
|
||||
|
||||
echo json_encode( [
|
||||
'basket' => \Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => $basket,
|
||||
'lang_id' => $lang_id,
|
||||
'coupon' => $coupon
|
||||
@@ -40,7 +40,7 @@ class ShopBasket
|
||||
'basket_mini_count' => \front\factory\ShopBasket::count_products_text( \front\factory\ShopBasket::count_products( $basket ) ),
|
||||
'basket_mini_value' => \front\factory\ShopBasket::summary_price( $basket, $coupon ),
|
||||
'products_count' => count( $basket ),
|
||||
'transport_methods' => \Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transport_methods' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transports_methods' => \front\factory\ShopTransport::transport_methods( $basket, $coupon ),
|
||||
'transport_id' => $basket_transport_method_id
|
||||
] )
|
||||
@@ -67,7 +67,7 @@ class ShopBasket
|
||||
\Shared\Helpers\Helpers::set_session( 'basket', $basket );
|
||||
|
||||
echo json_encode( [
|
||||
'basket' => \Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => $basket,
|
||||
'lang_id' => $lang_id,
|
||||
'coupon' => $coupon
|
||||
@@ -75,7 +75,7 @@ class ShopBasket
|
||||
'basket_mini_count' => \front\factory\ShopBasket::count_products_text( \front\factory\ShopBasket::count_products( $basket ) ),
|
||||
'basket_mini_value' => \front\factory\ShopBasket::summary_price( $basket, $coupon ),
|
||||
'products_count' => count( $basket ),
|
||||
'transport_methods' => \Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transport_methods' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transports_methods' => \front\factory\ShopTransport::transport_methods( $basket, $coupon ),
|
||||
'transport_id' => $basket_transport_method_id
|
||||
] )
|
||||
@@ -103,7 +103,7 @@ class ShopBasket
|
||||
\Shared\Helpers\Helpers::set_session( 'basket', $basket );
|
||||
|
||||
echo json_encode( [
|
||||
'basket' => \Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => $basket,
|
||||
'lang_id' => $lang_id,
|
||||
'coupon' => $coupon
|
||||
@@ -111,7 +111,7 @@ class ShopBasket
|
||||
'basket_mini_count' => \front\factory\ShopBasket::count_products_text( \front\factory\ShopBasket::count_products( $basket ) ),
|
||||
'basket_mini_value' => \front\factory\ShopBasket::summary_price( $basket, $coupon ),
|
||||
'products_count' => count( $basket ),
|
||||
'transport_methods' => \Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transport_methods' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transports_methods' => \front\factory\ShopTransport::transport_methods( $basket, $coupon ),
|
||||
'transport_id' => $basket_transport_method_id
|
||||
] )
|
||||
@@ -140,7 +140,7 @@ class ShopBasket
|
||||
$basket = \Shared\Helpers\Helpers::get_session( 'basket' );
|
||||
|
||||
echo json_encode( [
|
||||
'basket' => \Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => $basket,
|
||||
'lang_id' => $lang_id,
|
||||
'coupon' => $coupon
|
||||
@@ -148,7 +148,7 @@ class ShopBasket
|
||||
'basket_mini_count' => \front\factory\ShopBasket::count_products_text( \front\factory\ShopBasket::count_products( $basket ) ),
|
||||
'basket_mini_value' => \front\factory\ShopBasket::summary_price( $basket, $coupon ),
|
||||
'products_count' => count( $basket ),
|
||||
'transport_methods' => \Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transport_methods' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transports_methods' => \front\factory\ShopTransport::transport_methods( $basket, $coupon ),
|
||||
'transport_id' => $basket_transport_method_id
|
||||
] )
|
||||
@@ -339,7 +339,7 @@ class ShopBasket
|
||||
|
||||
$client = \Shared\Helpers\Helpers::get_session( 'client' );
|
||||
|
||||
return \Tpl::view( 'shop-basket/summary-view', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-basket/summary-view', [
|
||||
'lang_id' => $lang_id,
|
||||
'client' => \Shared\Helpers\Helpers::get_session( 'client' ),
|
||||
'basket' => \Shared\Helpers\Helpers::get_session( 'basket' ),
|
||||
@@ -437,16 +437,16 @@ class ShopBasket
|
||||
|
||||
$basket = \shop\Promotion::find_promotion( $basket );
|
||||
|
||||
return \Tpl::view( 'shop-basket/basket', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-basket/basket', [
|
||||
'basket' => $basket,
|
||||
'coupon' => $coupon,
|
||||
'transport_id' => \Shared\Helpers\Helpers::get_session( 'basket-transport-method-id' ),
|
||||
'transport_methods' => \Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transport_methods' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-transport-methods', [
|
||||
'transports_methods' => \front\factory\ShopTransport::transport_methods( $basket, $coupon ),
|
||||
'transport_id' => $basket_transport_method_id
|
||||
] ),
|
||||
'payment_method_id' => $payment_method_id,
|
||||
'basket_details' => \Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket_details' => \Shared\Tpl\Tpl::view( 'shop-basket/basket-details', [
|
||||
'basket' => $basket,
|
||||
'lang_id' => $lang_id,
|
||||
'coupon' => $coupon,
|
||||
|
||||
@@ -8,7 +8,7 @@ class ShopOrder
|
||||
|
||||
$order = \front\factory\ShopOrder::order_details( null, \Shared\Helpers\Helpers::get( 'order_hash' ) );
|
||||
|
||||
return \Tpl::view( 'shop-order/payment-confirmation', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-order/payment-confirmation', [
|
||||
'order' => $order,
|
||||
'settings' => $settings
|
||||
] );
|
||||
@@ -143,7 +143,7 @@ class ShopOrder
|
||||
);
|
||||
$coupon = (int)$order['coupon_id'] ? new \shop\Coupon( (int)$order['coupon_id'] ) : null;
|
||||
|
||||
return \Tpl::view( 'shop-order/order-details', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-order/order-details', [
|
||||
'order' => $order,
|
||||
'coupon' => $coupon,
|
||||
'client' => \Shared\Helpers\Helpers::get_session( 'client' ),
|
||||
|
||||
@@ -15,7 +15,7 @@ class ShopProducer
|
||||
|
||||
if ( $results['ls'] > 1 )
|
||||
{
|
||||
$pager = \Tpl::view( 'site/pager', [
|
||||
$pager = \Shared\Tpl\Tpl::view( 'site/pager', [
|
||||
'ls' => $results['ls'],
|
||||
'bs' => (int) \Shared\Helpers\Helpers::get( 'bs' ) ? (int) \Shared\Helpers\Helpers::get( 'bs' ) : 1,
|
||||
'page' => $page,
|
||||
@@ -23,7 +23,7 @@ class ShopProducer
|
||||
] );
|
||||
}
|
||||
|
||||
return \Tpl::view( 'shop-producer/products', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-producer/products', [
|
||||
'producer' => $producer,
|
||||
'products' => $results['products'],
|
||||
'pager' => $pager
|
||||
@@ -41,7 +41,7 @@ class ShopProducer
|
||||
if ( \Shared\Helpers\Helpers::is_array_fix( $rows ) ) foreach ( $rows as $row )
|
||||
$producers[] = new \shop\Producer( $row );
|
||||
|
||||
return \Tpl::view( 'shop-producer/list', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-producer/list', [
|
||||
'producers' => $producers
|
||||
] );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class ShopProduct
|
||||
$products_ids = \front\factory\ShopCategory::products_id( \Shared\Helpers\Helpers::get( 'category_id' ), \front\factory\ShopCategory::get_category_sort( (int)\Shared\Helpers\Helpers::get( 'category_id' ) ), $lang_id, 8, \Shared\Helpers\Helpers::get( 'offset' ) );
|
||||
|
||||
if ( is_array( $products_ids ) ): foreach ( $products_ids as $product_id ):
|
||||
$output .= \Tpl::view('shop-product/product-mini', [
|
||||
$output .= \Shared\Tpl\Tpl::view('shop-product/product-mini', [
|
||||
'product' => Product::getFromCache( $product_id, $lang_id )
|
||||
] );
|
||||
endforeach;
|
||||
|
||||
@@ -44,7 +44,7 @@ class Site
|
||||
if ( $product )
|
||||
{
|
||||
\shop\Product::add_visit( $product -> id );
|
||||
return \Tpl::view( 'shop-product/product', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-product/product', [
|
||||
'product' => $product,
|
||||
'settings' => $settings,
|
||||
'lang_id' => $lang_id,
|
||||
|
||||
@@ -216,7 +216,7 @@ class ShopOrder
|
||||
|
||||
$order = \front\factory\ShopOrder::order_details( $order_id );
|
||||
|
||||
$mail_order = \Tpl::view( 'shop-order/mail-summary', [
|
||||
$mail_order = \Shared\Tpl\Tpl::view( 'shop-order/mail-summary', [
|
||||
'settings' => $settings,
|
||||
'order' => $order,
|
||||
'coupon' => $coupon,
|
||||
|
||||
@@ -5,7 +5,7 @@ class Menu
|
||||
{
|
||||
public static function pages( $pages, $level = 0, $current_page = 0 )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> pages = $pages;
|
||||
$tpl -> level = $level;
|
||||
$tpl -> current_page = $current_page;
|
||||
@@ -14,7 +14,7 @@ class Menu
|
||||
|
||||
public static function menu( $menu, $current_page )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> menu = $menu;
|
||||
$tpl -> current_page = $current_page;
|
||||
return $tpl -> render( 'menu/menu' );
|
||||
|
||||
@@ -5,7 +5,7 @@ class Scontainers
|
||||
{
|
||||
public static function scontainer( $id )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> scontainer = \front\factory\Scontainers::scontainer_details( $id );
|
||||
return $tpl -> render( 'scontainers/scontainer' );
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class ShopCategory
|
||||
{
|
||||
static public function category_description( $category )
|
||||
{
|
||||
return \Tpl::view( 'shop-category/category-description', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-category/category-description', [
|
||||
'category' => $category
|
||||
] );
|
||||
}
|
||||
@@ -19,7 +19,7 @@ class ShopCategory
|
||||
|
||||
if ( $results['ls'] > 1 )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> ls = $results['ls'];
|
||||
$tpl -> bs = $bs ? $bs : 1;
|
||||
$tpl -> page = $page;
|
||||
@@ -27,7 +27,7 @@ class ShopCategory
|
||||
$pager = $tpl -> render( 'site/pager' );
|
||||
}
|
||||
|
||||
return \Tpl::view( 'shop-category/category', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-category/category', [
|
||||
'category' => $category,
|
||||
'products' => $results['products'],
|
||||
'pager' => $pager,
|
||||
@@ -37,7 +37,7 @@ class ShopCategory
|
||||
}
|
||||
|
||||
$products_count = \front\factory\ShopCategory::category_products_count( $category, $lang_id );
|
||||
return \Tpl::view( 'shop-category/category-infinitescroll', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-category/category-infinitescroll', [
|
||||
'category' => $category,
|
||||
'products_count' => $products_count,
|
||||
'category_description' => (int)$bs <= 1 ? true : false,
|
||||
@@ -47,7 +47,7 @@ class ShopCategory
|
||||
|
||||
public static function categories( $categories, $current_category = 0, $level = 0 )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> level = $level;
|
||||
$tpl -> current_category = $current_category;
|
||||
$tpl -> categories = $categories;
|
||||
|
||||
@@ -4,7 +4,7 @@ class ShopClient
|
||||
{
|
||||
public static function address_edit( $values )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
if ( is_array( $values ) ) foreach ( $values as $key => $val )
|
||||
$tpl -> $key = $val;
|
||||
return $tpl -> render( 'shop-client/address-edit' );
|
||||
@@ -12,7 +12,7 @@ class ShopClient
|
||||
|
||||
public static function client_addresses( $values )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
if ( is_array( $values ) ) foreach ( $values as $key => $val )
|
||||
$tpl -> $key = $val;
|
||||
return $tpl -> render( 'shop-client/client-addresses' );
|
||||
@@ -21,7 +21,7 @@ class ShopClient
|
||||
|
||||
public static function client_menu( $values )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
if ( is_array( $values ) ) foreach ( $values as $key => $val )
|
||||
$tpl -> $key = $val;
|
||||
return $tpl -> render( 'shop-client/client-menu' );
|
||||
@@ -29,7 +29,7 @@ class ShopClient
|
||||
|
||||
public static function client_orders( $values )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
if ( is_array( $values ) ) foreach ( $values as $key => $val )
|
||||
$tpl -> $key = $val;
|
||||
return $tpl -> render( 'shop-client/client-orders' );
|
||||
@@ -37,21 +37,21 @@ class ShopClient
|
||||
|
||||
public static function recover_password()
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
return $tpl -> render( 'shop-client/recover-password' );
|
||||
}
|
||||
|
||||
public static function mini_login()
|
||||
{
|
||||
global $client;
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> client = $client;
|
||||
return $tpl -> render( 'shop-client/mini-login' );
|
||||
}
|
||||
|
||||
public static function login_form( $values = '' )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
if ( is_array( $values ) ) foreach ( $values as $key => $val )
|
||||
$tpl -> $key = $val;
|
||||
return $tpl -> render( 'shop-client/login-form' );
|
||||
@@ -59,7 +59,7 @@ class ShopClient
|
||||
|
||||
public static function register_form()
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
return $tpl -> render( 'shop-client/register-form' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class ShopOrder
|
||||
{
|
||||
public static function order_details( $values )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
if ( is_array( $values ) ) foreach ( $values as $key => $val )
|
||||
$tpl -> $key = $val;
|
||||
return $tpl -> render( 'shop-order/order-details' );
|
||||
|
||||
@@ -4,7 +4,7 @@ class ShopPaymentMethod
|
||||
{
|
||||
public static function basket_payment_methods( $payment_methods, $payment_id )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> payment_methods = $payment_methods;
|
||||
$tpl -> payment_id = $payment_id;
|
||||
return $tpl -> render( 'shop-basket/basket-payments-methods' );
|
||||
|
||||
@@ -60,7 +60,7 @@ class Site
|
||||
$html = str_replace( '[BANER_STRONA_GLOWNA]', \front\Views\Banners::mainBanner( $bannerRepo->mainBanner( $lang_id ) ), $html );
|
||||
$html = str_replace( '[BANERY]', \front\Views\Banners::banners( $bannerRepo->banners( $lang_id ) ), $html );
|
||||
|
||||
$html = str_replace( '[KATEGORIE]', \Tpl::view( 'shop-category/categories', [
|
||||
$html = str_replace( '[KATEGORIE]', \Shared\Tpl\Tpl::view( 'shop-category/categories', [
|
||||
'level' => $level,
|
||||
'current_category' => \Shared\Helpers\Helpers::get( 'category' ),
|
||||
'categories' => \front\factory\ShopCategory::categories_details()
|
||||
@@ -76,7 +76,7 @@ class Site
|
||||
$products_promoted_tmp[1] ? $pattern = '[PROMOWANE_PRODUKTY:' . $products_promoted_tmp[1] . ']' : $pattern = '[PROMOWANE_PRODUKTY]';
|
||||
|
||||
$html = str_replace( $pattern,
|
||||
\Tpl::view( 'shop-product/promoted-products', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-product/promoted-products', [
|
||||
'products' => \front\factory\ShopProduct::promoted_products( $limit )
|
||||
] ),
|
||||
$html
|
||||
@@ -99,7 +99,7 @@ class Site
|
||||
}
|
||||
|
||||
$html = str_replace( '[KOSZYK]',
|
||||
\Tpl::view( 'shop-basket/basket-mini', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-basket/basket-mini', [
|
||||
'basket' => \Shared\Helpers\Helpers::get_session( 'basket' ),
|
||||
'lang_id' => $lang_id,
|
||||
'coupon' => \Shared\Helpers\Helpers::get_session( 'coupon' )
|
||||
@@ -129,7 +129,7 @@ class Site
|
||||
$menu_tmp = explode( ':', $menu_tmp );
|
||||
$html = str_replace(
|
||||
'[MENU_GLOWNE:' . $menu_tmp[1] . ']',
|
||||
\Tpl::view( 'menu/main-menu', [
|
||||
\Shared\Tpl\Tpl::view( 'menu/main-menu', [
|
||||
'menu' => \front\factory\Menu::menu_details( $menu_tmp[1] )
|
||||
] ),
|
||||
$html );
|
||||
@@ -237,7 +237,7 @@ class Site
|
||||
$single_product = explode( ':', $single_product );
|
||||
$html = str_replace(
|
||||
'[PRODUKT:' . $single_product[1] . ']',
|
||||
\Tpl::view( 'shop-product/product-mini', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-product/product-mini', [
|
||||
'product' => \shop\Product::getFromCache( (int)$single_product[1], $lang_id )
|
||||
] ),
|
||||
$html
|
||||
@@ -259,7 +259,7 @@ class Site
|
||||
|
||||
$html = str_replace(
|
||||
'[PRODUKTY_BOX:' . $products_box[1] . ']',
|
||||
\Tpl::view( 'shop-product/products-box', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-product/products-box', [
|
||||
'products' => $products
|
||||
] ),
|
||||
$html
|
||||
@@ -287,7 +287,7 @@ class Site
|
||||
}
|
||||
|
||||
$html = str_replace( $pattern,
|
||||
\Tpl::view( 'shop-product/products-top', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-product/products-top', [
|
||||
'products' => $top_products_arr,
|
||||
] ),
|
||||
$html
|
||||
@@ -316,7 +316,7 @@ class Site
|
||||
}
|
||||
|
||||
$html = str_replace( $pattern,
|
||||
\Tpl::view( 'shop-product/products-new', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-product/products-new', [
|
||||
'products' => $top_products_arr,
|
||||
] ),
|
||||
$html
|
||||
@@ -377,7 +377,7 @@ class Site
|
||||
|
||||
$html = str_replace(
|
||||
$pattern,
|
||||
\Tpl::view( 'shop-category/blog-category-products', [
|
||||
\Shared\Tpl\Tpl::view( 'shop-category/blog-category-products', [
|
||||
'products' => \front\factory\ShopCategory::blog_category_products( $category_list_tmp[1], $lang_id, $products_limit )
|
||||
] ),
|
||||
$html );
|
||||
@@ -421,14 +421,14 @@ class Site
|
||||
|
||||
public static function facebook( $facebook_link )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> facebook_link = $facebook_link;
|
||||
return $tpl -> render( 'site/facebook' );
|
||||
}
|
||||
|
||||
static public function title( $title, $show_title, $page_title )
|
||||
{
|
||||
return \Tpl::view( 'site/title', [
|
||||
return \Shared\Tpl\Tpl::view( 'site/title', [
|
||||
'title' => $title,
|
||||
'page_title' => $page_title,
|
||||
'show_title' => $show_title
|
||||
@@ -441,7 +441,7 @@ class Site
|
||||
{
|
||||
\Shared\Helpers\Helpers::delete_session( 'alert' );
|
||||
|
||||
return $tpl = \Tpl::view( 'site/alert', [
|
||||
return $tpl = \Shared\Tpl\Tpl::view( 'site/alert', [
|
||||
'alert' => $alert
|
||||
] );
|
||||
}
|
||||
@@ -450,7 +450,7 @@ class Site
|
||||
{
|
||||
\Shared\Helpers\Helpers::delete_session( 'error' );
|
||||
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> error = $error;
|
||||
return $tpl -> render( 'site/error' );
|
||||
}
|
||||
@@ -458,19 +458,19 @@ class Site
|
||||
|
||||
public static function copyright()
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
return $tpl -> render( 'site/copyright' );
|
||||
}
|
||||
|
||||
public static function contact()
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
return $tpl -> render( 'site/contact' );
|
||||
}
|
||||
|
||||
public static function cookie_information()
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
return $tpl -> render( 'site/cookie-information' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class Order implements \ArrayAccess
|
||||
$order = \front\factory\ShopOrder::order_details( $this -> id );
|
||||
$coupon = (int)$order['coupon_id'] ? new \shop\Coupon( (int)$order['coupon_id'] ) : null;
|
||||
|
||||
$mail_order = \Tpl::view( 'shop-order/mail-summary', [
|
||||
$mail_order = \Shared\Tpl\Tpl::view( 'shop-order/mail-summary', [
|
||||
'settings' => $settings,
|
||||
'order' => $order,
|
||||
'coupon' => $coupon,
|
||||
|
||||
@@ -348,7 +348,7 @@ class Product implements \ArrayAccess
|
||||
$products = array_diff( $products, [ $product_id ] );
|
||||
}
|
||||
|
||||
return \Tpl::view( 'shop-basket/alert-product-sets', [
|
||||
return \Shared\Tpl\Tpl::view( 'shop-basket/alert-product-sets', [
|
||||
'products' => $products
|
||||
] );
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class Search implements \ArrayAccess
|
||||
{
|
||||
static public function simple_form()
|
||||
{
|
||||
return \Tpl::view( 'shop-search/simple-form' );
|
||||
return \Shared\Tpl\Tpl::view( 'shop-search/simple-form' );
|
||||
}
|
||||
|
||||
static public function search_results()
|
||||
@@ -17,14 +17,14 @@ class Search implements \ArrayAccess
|
||||
|
||||
$results = \shop\Product::searchProductsByName( \Shared\Helpers\Helpers::get( 'query' ), $lang_id, (int)$bs );
|
||||
|
||||
$out = \Tpl::view( 'shop-search/products', [
|
||||
$out = \Shared\Tpl\Tpl::view( 'shop-search/products', [
|
||||
'query' => \Shared\Helpers\Helpers::get( 'query' ),
|
||||
'products' => $results['products']
|
||||
]);
|
||||
|
||||
if ( $results['ls'] > 1 )
|
||||
{
|
||||
$tpl = new \Tpl;
|
||||
$tpl = new \Shared\Tpl\Tpl;
|
||||
$tpl -> ls = $results['ls'];
|
||||
$tpl -> bs = $bs ? $bs : 1;
|
||||
$tpl -> link = 'wyszukiwarka/' . \Shared\Helpers\Helpers::get( 'query' );
|
||||
@@ -40,7 +40,7 @@ class Search implements \ArrayAccess
|
||||
|
||||
$results = \shop\Product::searchProductByNameAjax( \Shared\Helpers\Helpers::get( 'query' ), $lang_id );
|
||||
if ( \Shared\Helpers\Helpers::is_array_fix( $results ) ) foreach ( $results as $row )
|
||||
$products[] = \Tpl::view( 'shop-search/product-search', [
|
||||
$products[] = \Shared\Tpl\Tpl::view( 'shop-search/product-search', [
|
||||
'product' => Product::getFromCache( $row['product_id'], $lang_id )
|
||||
] );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user