488: }
489:
490: public function getPriceWithVat(Entities\Currency $currency, $quantity = 1, $priceType = PriceType::PRICE_TYPE_FINAL): float
496: {
497: $priceWithoutVat = $this->getPrice($currency, $quantity, $priceType);
498: $vatRate = $this->getVat($currency);
499: return $currency->format($priceWithoutVat * (1 + $vatRate / 100));
500: }
501:
502:
public function getFreeShippingInfo(
364: Entities\Currency $currency,
365: Entities\IShipping $shipping,
366: $products = null
367: ) {
368: if ($products === null) {
369: $products = array_column($this->productModel->getProducts($this->cartReader->getItems()), 'product');
370: $productsPrice = $this->getProductsTotalPriceWithVatWithCoupon($currency);
371: } else {
372: $productsPrice = array_sum(array_map(function ($product) use ($currency) {
373: return $product->getPriceWithVat($currency);
374: }, $products));
375: }
376: foreach ($products as $product) {
377:
inner-code
public function getFreeShippingInfo(
364: Entities\Currency $currency,
365: Entities\IShipping $shipping,
366: $products = null
367: ) {
368: if ($products === null) {
369: $products = array_column($this->productModel->getProducts($this->cartReader->getItems()), 'product');
370: $productsPrice = $this->getProductsTotalPriceWithVatWithCoupon($currency);
371: } else {
372: $productsPrice = array_sum(array_map(function ($product) use ($currency) {
373: return $product->getPriceWithVat($currency);
374: }, $products));
375: }
376: foreach ($products as $product) {
639: $currency = $this->eshopDomainService->getDomain()->currency;
640: $freeDeliveryFlags = $this->appSettings->getParameter(['app','product','freeShippingFlags']);
641: foreach ($this->shippingModel->getAll($currency, [$this->product->id], []) as $shipping) {
642: if (!array_key_exists($shipping->shippingCarrier->externalId, $freeDeliveryFlags)) {
644: continue;
645: }
646: if (!$shipping->isAvailable($this)){
647: continue;
648: }
649: if ($this->priceModel->getFreeShippingInfo($currency, $shipping, [$this]) === true) {
650: $flagTemplate = $this->flagFacade->getById($freeDeliveryFlags[$shipping->shippingCarrier->externalId]);
651: $flag = clone $flagTemplate;
653: array_unshift($flags, $flag);
| $currency |
|
| $shipping |
|
| $products |
|
20: }
21:
22: if ($this->global->cache->createCache('41bzbx1Fe3EyeA==', ["product/{$product->id}/flags", 'expire' => '20 minutes', 'tags' => ["product/{$product->id}", "product/{$product->id}/flags", 'flags']])) try {
24: ob_start(fn() => '');
25: try {
26: echo '<div class="tags text-left h5">';
27: ob_start();
28: try {
29: echo "\n";
30: foreach ($product->getFlags() as $flag) /* line 2 */ {
31: echo ' <span';
32: echo ($ʟ_tmp = array_filter(['icon', 'shadow-sm-dark', $flag->code, $flag->color ? \App\Lib\Helpers::getContrastColor($flag->color) ? 'text-white' : 'text-dark' : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" ;
33: $ʟ_tmp = ['style' => $flag->color ? 'background-color:' . $flag->color : null];
34: echo Latte\Essential\Nodes\NAttrNode::attrs($ʟ_tmp, false) ;
1: {cache "product/{$product->id}/flags", expire: "20 minutes", tags: ["product/{$product->id}", "product/{$product->id}/flags", "flags"]}
2: <div class="tags text-left h5" n:ifcontent n:inner-foreach="$product->getFlags() as $flag">
3: <span n:class="icon, shadow-sm-dark, $flag->code, $flag->color ? (\App\Lib\Helpers::getContrastColor($flag->color)?text-white:text-dark)" n:attr="style => $flag->color ? 'background-color:'.$flag->color"><i>{$flag->getInnerContent()}</i></span>
4: </div>
5: {/cache}
98: }
99:
100: } elseif ($this->parentName) { $this->params = $params;
102: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
103:
104: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
106:
107: } else {
108: $this->main($params);
109: }
110: }
111:
112:
70:
71:
72: public function render(string $name, object|array $params = [], ?string $block = null): void
77: {
78: $template = $this->createTemplate($name, $this->processParams($params));
79: $template->global->coreCaptured = false;
80: $template->render($block);
81: }
82:
83:
84:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name |
'/var/www/html/zdjur/2020.profizoo.cz/app/FrontModule/templates/profizoo-2020//components//ProductFlags.latte'
|
| $params |
|
55: if (file_exists($templateFileName = APP_DIR . '/FrontModule/templates/' . $template . '/' . $this->getComponentTemplateDirectory() . '/' . $filename)) {
56: $templateFileset = true;
57: break;
58: }
59: }
60: if (!$templateFileset) {
61: $templateFileName = $this->getCallerClassDirectory() . '/' . $filename;
62: }
63:
64: $this->template->setFile($templateFileName);
65: $this->template->render();
66: $this->onRendered($this);
67: }
68:
69: private $useView;
71: {
72: $this->useView = $view;
73: return $this;
74: }
75:
76: public function __call($name, $args)
77: {
78: $matches = null;
79: if (preg_match('/render(.*)/', $name, $matches)) {
80: 81: return $this->doRender($matches[1] ? '.' . $matches[1] : null, $args);
82: }
83: return parent::__call($name, $args);
84: }
85: }
| $suffix |
null
|
| $args |
array (0)
|
24: ';
25: if ($this->global->cache->createCache('gMyK2QMU8LAg+w==', ["product-list-detail-{$product->id}", 'tags' => ["product/{$product->id}/images", "product/{$product->id}"], 'if' => !($fromSearch ?? false)])) try {
27: echo ' <a href="';
28: echo LR\Filters::escapeHtmlAttr($this->global->uiPresenter->link(':Front:Product:', [$product])) ;
29: echo '" class="card-img-top">
30: <div class="position-absolute z-index-2">
31: ';
32: $ʟ_tmp = $this->global->uiControl->getComponent('productFlags');
33: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
34: $ʟ_tmp->render() /* line 6 */;
35:
36: echo ' </div>
37: ';
38: if ($product->getMainImage()) {
1: <div class="col-12 col-sm-6 col-md-4 p-0 m-0 item">
2: <div class="card p-2 h-100">
3: {cache "product-list-detail-{$product->id}", tags: ["product/{$product->id}/images", "product/{$product->id}"], if: (!($fromSearch ?? false))}
4: <a href="{plink :Front:Product: $product}" class="card-img-top">
5: <div class="position-absolute z-index-2">
6: {control productFlags}
7: </div>
8: <img n:if="$product->getMainImage()" class="img-fluid d-block mx-auto" data-src="{img $product->getMainImage()->getUrlPath(), filter:[resizeSquare, 300]}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==" width="300" height="300" alt="{$product->name|stripTags}"/>
9: <img n:if="!$product->getMainImage()" class="img-fluid d-block mx-auto" data-src="{$basePath}/assets/profizoo-2020/images/img_not_found_{$eshopDomain->lang->lang}.png" alt="{$product->name|stripTags}"/>
10: </a>
11: <div class="card-body pb-0">
12: <h3 class="card-title text-primary h5"><a href="{plink :Front:Product: $product}">{$product->name}</a></h3>
13: <p class="lines-4">{$product->perex}</p>
14: </div>
15: <div class="card-footer py-0 text-center">
| $name |
'render'
|
| $args |
array (0)
|
98: }
99:
100: } elseif ($this->parentName) { $this->params = $params;
102: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
103:
104: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
106:
107: } else {
108: $this->main($params);
109: }
110: }
111:
112:
70:
71:
72: public function render(string $name, object|array $params = [], ?string $block = null): void
77: {
78: $template = $this->createTemplate($name, $this->processParams($params));
79: $template->global->coreCaptured = false;
80: $template->render($block);
81: }
82:
83:
84:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name |
'/var/www/html/zdjur/2020.profizoo.cz/app/FrontModule/templates/profizoo-2020//components//ProductListItem.latte'
|
| $params |
|
55: if (file_exists($templateFileName = APP_DIR . '/FrontModule/templates/' . $template . '/' . $this->getComponentTemplateDirectory() . '/' . $filename)) {
56: $templateFileset = true;
57: break;
58: }
59: }
60: if (!$templateFileset) {
61: $templateFileName = $this->getCallerClassDirectory() . '/' . $filename;
62: }
63:
64: $this->template->setFile($templateFileName);
65: $this->template->render();
66: $this->onRendered($this);
67: }
68:
69: private $useView;
71: {
72: $this->useView = $view;
73: return $this;
74: }
75:
76: public function __call($name, $args)
77: {
78: $matches = null;
79: if (preg_match('/render(.*)/', $name, $matches)) {
80: 81: return $this->doRender($matches[1] ? '.' . $matches[1] : null, $args);
82: }
83: return parent::__call($name, $args);
84: }
85: }
| $suffix |
null
|
| $args |
array (0)
|
70: extract($this->params);
71: extract($ʟ_args);
72: unset($ʟ_args);
73:
74: $this->global->snippetDriver->enter('productListContainer', 'static') ;
75: try {
76: echo "\n";
77: foreach ($iterator = $ʟ_it = new Latte\Essential\CachingIterator($products, $ʟ_it ?? null) as $product) {
78: if (!is_object($ʟ_tmp = "item-{$product->id}")) $ʟ_tmp = $this->global->uiControl->getComponent($ʟ_tmp);
79: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
80: $ʟ_tmp->render() /* line 5 */;
81:
82: if ($iterator->counter == 6) {
83: ob_start(fn() => '');
84: try {
1: {* Product list component template *}
2: <div n:if="$hasProducts = (isset($products) && is_iterable($products) && count($products))" class="products-list mb-5">
3: <div class="card-deck">
4: <div class="row w-100 mx-auto" n:inner-foreach="$products as $product" n:snippet="productListContainer" >
5: {control item-{$product->id}}
6: {if $iterator->counter == 6}
7: <block n:ifcontent class="col-12 bg-white">{control banner}</block>
8: {/if}
9: </div>
10: </div>
11: </div>
12: <div n:if="!$hasProducts" class="before-shadow">
13: {import FullTextResult.not-found.latte}
14: {define hint1}
15: <li><strong>{_profizoo.search.result.notFound.filterHint1, [link=>$this->global->uiPresenter->link('this', ['do'=>'productCategory-productCategoryOrderBy-resetAll'])]|noescape}</strong></li>
| $name |
'render'
|
| $args |
array (0)
|
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
143: );
205: return $child;
206: }
207:
208:
209: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
213: {
214: if ($targetType === null || $targetType === $contentType) {
215: $producer();
216:
217: } elseif ($targetType instanceof \Closure) {
218: echo $targetType($this->capture($producer), $contentType);
219:
128: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
| $producer |
|
| $targetType |
null
|
| $contentType |
'html'
|
| $name |
'block productListContainer'
|
23: if ($this->global->snippetDriver?->renderSnippets($this->blocks[self::LayerSnippet], $this->params)) {
24: return;
25: }
26:
27: if ($hasProducts = isset($products) && is_iterable($products) && count($products)) {
28: echo '<div class="products-list mb-5">
29: <div class="card-deck">
30: <div class="row w-100 mx-auto"';
31: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('productListContainer')), '"';
32: echo ' >';
33: $this->renderBlock('productListContainer', [], null, 'snippet') /* line 4 */;
34: echo '</div>
35: </div>
36: </div>
37: ';
1: {* Product list component template *}
2: <div n:if="$hasProducts = (isset($products) && is_iterable($products) && count($products))" class="products-list mb-5">
3: <div class="card-deck">
4: <div class="row w-100 mx-auto" n:inner-foreach="$products as $product" n:snippet="productListContainer" >
5: {control item-{$product->id}}
6: {if $iterator->counter == 6}
7: <block n:ifcontent class="col-12 bg-white">{control banner}</block>
8: {/if}
9: </div>
10: </div>
11: </div>
12: <div n:if="!$hasProducts" class="before-shadow">
13: {import FullTextResult.not-found.latte}
14: {define hint1}
15: <li><strong>{_profizoo.search.result.notFound.filterHint1, [link=>$this->global->uiPresenter->link('this', ['do'=>'productCategory-productCategoryOrderBy-resetAll'])]|noescape}</strong></li>
| $name |
'productListContainer'
|
| $params |
array (0)
|
| $mod |
null
|
| $layer |
'snippet'
|
98: }
99:
100: } elseif ($this->parentName) { $this->params = $params;
102: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
103:
104: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
106:
107: } else {
108: $this->main($params);
109: }
110: }
111:
112:
70:
71:
72: public function render(string $name, object|array $params = [], ?string $block = null): void
77: {
78: $template = $this->createTemplate($name, $this->processParams($params));
79: $template->global->coreCaptured = false;
80: $template->render($block);
81: }
82:
83:
84:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name |
'/var/www/html/zdjur/2020.profizoo.cz/app/FrontModule/templates/profizoo-2020//components//ProductList.latte'
|
| $params |
|
55: if (file_exists($templateFileName = APP_DIR . '/FrontModule/templates/' . $template . '/' . $this->getComponentTemplateDirectory() . '/' . $filename)) {
56: $templateFileset = true;
57: break;
58: }
59: }
60: if (!$templateFileset) {
61: $templateFileName = $this->getCallerClassDirectory() . '/' . $filename;
62: }
63:
64: $this->template->setFile($templateFileName);
65: $this->template->render();
66: $this->onRendered($this);
67: }
68:
69: private $useView;
71: {
72: $this->useView = $view;
73: return $this;
74: }
75:
76: public function __call($name, $args)
77: {
78: $matches = null;
79: if (preg_match('/render(.*)/', $name, $matches)) {
80: 81: return $this->doRender($matches[1] ? '.' . $matches[1] : null, $args);
82: }
83: return parent::__call($name, $args);
84: }
85: }
| $suffix |
null
|
| $args |
array (0)
|
114: {
115: extract($this->params);
116: extract($ʟ_args);
117: unset($ʟ_args);
118:
119: $this->global->snippetDriver->enter('productList', 'static') ;
120: try {
121: echo "\n";
122: $ʟ_tmp = $this->global->uiControl->getComponent('productList');
123: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
124: $ʟ_tmp->render() /* line 18 */;
125:
126: echo ' <div id="ajax-spinner" class="ajax-spinner"></div>
127: ';
128:
8: {$category->getHeaderDescription()}
9: </div>
10: {else}
11: <h1>{$category->getSeoName() ?? $category->getName()}{_profizoo.common.page,[page => $page]}</h1>
12: {/if}
13: </div>
14:
15: {control productCategoryOrderBy}
16:
17: <div n:snippet="productList" class="position-relative">
18: {control productList}
19: <div id="ajax-spinner" class="ajax-spinner"></div>
20: </div>
21: {*
22: <div class="shown_item_info">zobrazuji <strong>{$fromIndex}</strong> až <strong>{$toIndex}</strong> z <strong>{$productsCount}</strong></div>
| $name |
'render'
|
| $args |
array (0)
|
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
143: );
205: return $child;
206: }
207:
208:
209: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
213: {
214: if ($targetType === null || $targetType === $contentType) {
215: $producer();
216:
217: } elseif ($targetType instanceof \Closure) {
218: echo $targetType($this->capture($producer), $contentType);
219:
128: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
| $producer |
|
| $targetType |
null
|
| $contentType |
'html'
|
| $name |
'block productList'
|
40:
41: ';
42: $ʟ_tmp = $this->global->uiControl->getComponent('productCategoryOrderBy');
43: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
44: $ʟ_tmp->render() ;
45:
46: echo '
47: <div';
48: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('productList')), '"';
49: echo ' class="position-relative">';
50: $this->renderBlock('productList', [], null, 'snippet') /* line 17 */;
51: echo '</div>
52: ';
53: }
54:
7: <div class="cat_text" n:ifcontent>
8: {$category->getHeaderDescription()}
9: </div>
10: {else}
11: <h1>{$category->getSeoName() ?? $category->getName()}{_profizoo.common.page,[page => $page]}</h1>
12: {/if}
13: </div>
14:
15: {control productCategoryOrderBy}
16:
17: <div n:snippet="productList" class="position-relative">
18: {control productList}
19: <div id="ajax-spinner" class="ajax-spinner"></div>
20: </div>
21: {*
| $name |
'productList'
|
| $params |
array (0)
|
| $mod |
null
|
| $layer |
'snippet'
|
98: }
99:
100: } elseif ($this->parentName) { $this->params = $params;
102: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
103:
104: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
106:
107: } else {
108: $this->main($params);
109: }
110: }
111:
112:
70:
71:
72: public function render(string $name, object|array $params = [], ?string $block = null): void
77: {
78: $template = $this->createTemplate($name, $this->processParams($params));
79: $template->global->coreCaptured = false;
80: $template->render($block);
81: }
82:
83:
84:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name |
'/var/www/html/zdjur/2020.profizoo.cz/app/FrontModule/templates/profizoo-2020//components//ProductCategory.latte'
|
| $params |
|
55: if (file_exists($templateFileName = APP_DIR . '/FrontModule/templates/' . $template . '/' . $this->getComponentTemplateDirectory() . '/' . $filename)) {
56: $templateFileset = true;
57: break;
58: }
59: }
60: if (!$templateFileset) {
61: $templateFileName = $this->getCallerClassDirectory() . '/' . $filename;
62: }
63:
64: $this->template->setFile($templateFileName);
65: $this->template->render();
66: $this->onRendered($this);
67: }
68:
69: private $useView;
71: {
72: $this->useView = $view;
73: return $this;
74: }
75:
76: public function __call($name, $args)
77: {
78: $matches = null;
79: if (preg_match('/render(.*)/', $name, $matches)) {
80: 81: return $this->doRender($matches[1] ? '.' . $matches[1] : null, $args);
82: }
83: return parent::__call($name, $args);
84: }
85: }
| $suffix |
null
|
| $args |
array (0)
|
171: {
172: extract($this->params);
173: extract($ʟ_args);
174: unset($ʟ_args);
175:
176: $this->global->snippetDriver->enter('productCategory', 'static') ;
177: try {
178: echo "\n";
179: $ʟ_tmp = $this->global->uiControl->getComponent('productCategory');
180: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
181: $ʟ_tmp->render() /* line 17 */;
182:
183: echo ' ';
184:
185: } finally {
7:
8: <div class="col-12 col-lg-9 of-x-h mt-n3">
9: <div n:snippet="categoryHeader">
10: {if $page == 1}
11: <div class="my-3" n:ifcontent n:cache='"banners-product-category-{$productCategory->id}", expire => "midnight" , tags => ["banners"]'>
12: {control productCategoryBanners}
13: </div>
14: {/if}
15: </div>
16: <div n:snippet="productCategory">
17: {control productCategory}
18: </div>
19: </div>
20:
21: <div n:snippet="categoryFooter">
| $name |
'render'
|
| $args |
array (0)
|
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
143: );
205: return $child;
206: }
207:
208:
209: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
213: {
214: if ($targetType === null || $targetType === $contentType) {
215: $producer();
216:
217: } elseif ($targetType instanceof \Closure) {
218: echo $targetType($this->capture($producer), $contentType);
219:
128: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
| $producer |
|
| $targetType |
null
|
| $contentType |
'html'
|
| $name |
'block productCategory'
|
66:
67: <div class="col-12 col-lg-9 of-x-h mt-n3">
68: <div';
69: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('categoryHeader')), '"';
70: echo '>';
71: $this->renderBlock('categoryHeader', [], null, 'snippet') ;
72: echo '</div>
73: <div';
74: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('productCategory')), '"';
75: echo '>';
76: $this->renderBlock('productCategory', [], null, 'snippet') /* line 16 */;
77: echo '</div>
78: </div>
79:
80: <div';
6: </div>
7:
8: <div class="col-12 col-lg-9 of-x-h mt-n3">
9: <div n:snippet="categoryHeader">
10: {if $page == 1}
11: <div class="my-3" n:ifcontent n:cache='"banners-product-category-{$productCategory->id}", expire => "midnight" , tags => ["banners"]'>
12: {control productCategoryBanners}
13: </div>
14: {/if}
15: </div>
16: <div n:snippet="productCategory">
17: {control productCategory}
18: </div>
19: </div>
20:
| $name |
'productCategory'
|
| $params |
array (0)
|
| $mod |
null
|
| $layer |
'snippet'
|
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
143: );
231:
232:
233: public function capture(callable $function): string
238: {
239: try {
240: ob_start(fn() => '');
241: $function();
242: return ob_get_clean();
243: } catch (\Throwable $e) {
244: ob_end_clean();
245: throw $e;
208:
209: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
213: {
214: if ($targetType === null || $targetType === $contentType) {
215: $producer();
216:
217: } elseif ($targetType instanceof \Closure) {
218: echo $targetType($this->capture($producer), $contentType);
219:
220: } elseif ($filter = Escaper::getConvertor($contentType, $targetType)) {
221: echo $filter($this->capture($producer));
222:
128: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
| $producer |
|
| $targetType |
|
| $contentType |
'html'
|
| $name |
'block content'
|
318: public function blockContent(array $ʟ_args): void
320: {
321: extract($this->params);
322: extract($ʟ_args);
323: unset($ʟ_args);
324:
325: $this->global->snippetDriver->enter('content', 'static') ;
326: try {
327: echo "\n";
328: $this->renderBlock('content', get_defined_vars(), function ($s, $type) {
329: $ʟ_fi = new LR\FilterInfo($type);
330: return LR\Filters::convertTo($ʟ_fi, 'html', $this->filters->filterContent('strip', $ʟ_fi, $s));
331: }) ;
332: echo ' ';
1: <!DOCTYPE html>
2: <html lang="{$currentEshop->lang->lang}" prefix="og: http://ogp.me/ns#">
3: <head>
4: {if !empty($companySettings->googleTagManager)}
5: {include 'gtm.head.latte'}
6: {/if}
7: <meta charset="utf-8">
8: <meta http-equiv="X-UA-Compatible" content="IE=edge">
9: <meta name="viewport" content="width=device-width, initial-scale=1">
10: <meta n:if="!empty($metaDescription)" name="description" content="{$metaDescription|stripHtml}">
11: <meta n:if="!empty($metaKeywords)" name="keywords" content="{$metaKeywords|stripHtml}">
12: <meta property="og:title" content="{block pageTitle}{ifset title}{include title|stripHtml} | {/ifset}{ifset $pageTitle}{$pageTitle} | {/ifset}{$siteName}{/block}" />
13: {control openGraph}
14: <meta name="theme-color" content="#da532c">
15: <link rel="apple-touch-icon" sizes="180x180" href="{$basePath}/assets/profizoo-2020/images/favicon/apple-touch-icon.png">
| $name |
'content'
|
| $params |
|
| $mod |
|
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
143: );
205: return $child;
206: }
207:
208:
209: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
213: {
214: if ($targetType === null || $targetType === $contentType) {
215: $producer();
216:
217: } elseif ($targetType instanceof \Closure) {
218: echo $targetType($this->capture($producer), $contentType);
219:
128: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
129:
130: if (!$block) {
131: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
132: ? ", did you mean '$t'?"
133: : '.';
134: $name = $layer ? "$layer $name" : $name;
135: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
136: }
137:
138: $this->filter(
139: fn() => reset($block->functions)($params),
140: $mod,
141: $block->contentType,
142: "block $name",
| $producer |
|
| $targetType |
null
|
| $contentType |
'html'
|
| $name |
'block content'
|
155: }
156: $ʟ_tmp = $this->global->uiControl->getComponent('notificationBar');
157: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
158: $ʟ_tmp->render() ;
159:
160: $this->renderBlock('header', [], null, 'snippet') ;
161: $this->renderBlock('menu', [], null, 'snippet') ;
162: echo ' <div';
163: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('content')), '"';
164: echo '>';
165: $this->renderBlock('content', [], null, 'snippet') /* line 61 */;
166: echo '</div>
167: ';
168: $this->renderBlock('productsHistory', get_defined_vars()) ;
169: $this->renderBlock('footer', [], null, 'snippet') ;
51: {/if}
52: {control notificationBar}
53: {snippetArea header}
54: {block blockHeader}
55: {include '@header.latte' with blocks}
56: {/block}
57: {/snippetArea}
58: {snippetArea menu}
59: {include '@menu.latte' with blocks}
60: {/snippetArea}
61: <div n:snippet="content">
62: {block content|strip}{/block}
63: </div>
64: {block productsHistory}
65: {control productsHistory}
| $name |
'content'
|
| $params |
array (0)
|
| $mod |
null
|
| $layer |
'snippet'
|
98: }
99:
100: } elseif ($this->parentName) { $this->params = $params;
102: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
103:
104: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
106:
107: } else {
108: $this->main($params);
109: }
110: }
111:
112:
92: $this->parentName = ($this->global->coreParentFinder)($this);
93: }
94:
95: if ($this->referenceType === 'import') {
96: if ($this->parentName) {
97: throw new Latte\RuntimeException('Imported template cannot use {extends} or {layout}, use {import}');
98: }
99:
100: } elseif ($this->parentName) { $this->params = $params;
102: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
103:
104: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
106:
70:
71:
72: public function render(string $name, object|array $params = [], ?string $block = null): void
77: {
78: $template = $this->createTemplate($name, $this->processParams($params));
79: $template->global->coreCaptured = false;
80: $template->render($block);
81: }
82:
83:
84:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name |
'/var/www/html/zdjur/2020.profizoo.cz/app/FrontModule/templates/profizoo-2020/ProductCategory.default.latte'
|
| $params |
|
40: return $this->source;
41: }
42:
43:
44: public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse): void
48: {
49: if ($this->source instanceof Nette\Application\UI\Template) {
50: $this->source->render();
51:
52: } else {
53: echo $this->source;
54: }
161:
162: Arrays::invoke($this->onPresenter, $this, $this->presenter);
163: $response = $this->presenter->run(clone $request);
164:
165: if ($response instanceof Responses\ForwardResponse) {
166: $request = $response->getRequest();
167: goto process;
168: }
169:
170: Arrays::invoke($this->onResponse, $this, $response);
171: $response->send($this->httpRequest, $this->httpResponse);
172: }
173:
174:
175: public function processException(\Throwable $e): void
| $httpRequest |
|
| $httpResponse |
|
80: }
81:
82:
83: public function run(): void
87: {
88: try {
89: Arrays::invoke($this->onStartup, $this);
90: $this->processRequest($this->createInitialRequest());
91: Arrays::invoke($this->onShutdown, $this);
92:
93: } catch (\Throwable $e) {
94: Arrays::invoke($this->onError, $this, $e);
7: use Nette\Application\Application as UIApplication;
8:
9: $container = require __DIR__ . '/../app/bootstrap.php';
11:
12: $isApi = interface_exists('Contributte\Middlewares\Application\IApplication') && substr($container->getByType(\Nette\Http\Request::class)->url->getPathInfo(), 0, 4) === 'api/';
13:
14: if ($isApi && ($application = $container->getByType(ApiApplication::class, false))) {
15: $application->run();
16: } else {
17: $container->getByType(UIApplication::class)->run();
18: }