Skip to content
Code-Schnipsel Gruppen Projekte
Commit 1a567cbf erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

fix: register smarty functions

Übergeordneter 7921f5df
No related branches found
No related tags found
2 Merge Requests!25Update 'next-3.x' with latest changes from 'main',!24fix: adjust paths to standard mail templates in quiqqer/core
Pipeline #12314 fehlgeschlagen mit Phase
in 3 Minuten und 9 Sekunden
werden angezeigt mit 37 Ergänzungen und 30 Löschungen
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="1.11.8" installed="1.11.8" location="./tools/phpstan" copy="false"/>
<phar name="phpstan" version="^1.11.5" installed="1.11.5" location="./tools/phpstan" copy="false"/>
<phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/>
<phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event on="onSmartyInit" fire="\QUI\TemplateCologne\EventHandler::onSmartyInit"/>
<event on="onProjectConfigSave" fire="\QUI\TemplateCologne\EventHandler::onProjectConfigSave"/>
<event on="onSiteSave" fire="\QUI\TemplateCologne\EventHandler::onSiteSave"/>
<event on="onQuiqqer::products::product::buttons::end"
......
......@@ -9,14 +9,6 @@
* @var QUI\Template $Template
**/
/**
* Register smarty functions
*/
if (method_exists($Engine, 'getSmarty')) {
$Engine->getSmarty()->registerClass('TemplateCologneUtils', 'QUI\TemplateCologne\Utils');
}
/**
* Emotion
*/
......
......@@ -9,7 +9,7 @@
{if !empty( $prefixContentBricks )}
{foreach from=$prefixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section
class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
......@@ -63,7 +63,7 @@
{if !empty( $suffixContentBricks )}
{foreach from=$suffixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......
......@@ -6,7 +6,7 @@
<div class="main-no-sidebar">
{if !empty( $prefixContentBricks )}
{foreach from=$prefixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......@@ -58,7 +58,7 @@
{if !empty( $suffixContentBricks )}
{foreach from=$suffixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......
......@@ -7,7 +7,7 @@
<div class="main-no-sidebar-thin">
{if !empty( $prefixContentBricks )}
{foreach from=$prefixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......@@ -58,7 +58,7 @@
{if !empty( $suffixContentBricks )}
{foreach from=$suffixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......
......@@ -10,7 +10,7 @@
{if !empty( $prefixContentBricks )}
{foreach from=$prefixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......@@ -62,7 +62,7 @@
{if !empty( $suffixContentBricks )}
{foreach from=$suffixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......
......@@ -6,7 +6,7 @@
<div class="main-start-page">
{if !empty( $prefixContentBricks )}
{foreach from=$prefixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......@@ -59,7 +59,7 @@
{if !empty( $suffixContentBricks )}
{foreach from=$suffixContentBricks item=Brick}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-row">
......
......@@ -9,7 +9,7 @@
>
{locale group="quiqqer/erp" var="article.list.articles.header.pos"}
</th>
{if $TemplateCologneUtils::getSetting('order.basket.showImages')}
{if QUI\TemplateCologne\Utils::getSetting('order.basket.showImages')}
<th class="quiqqer-order-basket-articles-header-image"
title="{locale group='quiqqer/erp' var='article.list.articles.header.image'}"
>
......@@ -50,7 +50,7 @@
>
{$pos}
</td>
{if $TemplateCologneUtils::getSetting('order.basket.showImages')}
{if QUI\TemplateCologne\Utils::getSetting('order.basket.showImages')}
<td class="quiqqer-order-basket-articles-article-image"
data-label="{locale group='quiqqer/erp' var='article.list.articles.header.image'}"
>
......
......@@ -42,7 +42,7 @@
{/if}
{if $Project->getConfig('templateCologne.settings.categoryShowStock')}
{assign var=ShippingTimeFrontendView value=$TemplateCologneUtils::getShippingTimeFrontendView($Product->getId())}
{assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
<div class="cologne-productList-product-details-content-shippingTime">
{$ShippingTimeFrontendView->create()}
......
......@@ -36,7 +36,7 @@
</div>
{if $Project->getConfig('templateCologne.settings.categoryShowStock')}
{assign var=ShippingTimeFrontendView value=$TemplateCologneUtils::getShippingTimeFrontendView($Product->getId())}
{assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
<div class="cologne-products-productGallery-products-product-price-shippingTime">
{$ShippingTimeFrontendView->create()}
......
......@@ -16,7 +16,7 @@
</div>
{if $Project->getConfig('templateCologne.settings.categoryShowStock')}
{assign var=ShippingTimeFrontendView value=$TemplateCologneUtils::getShippingTimeFrontendView($Product->getId())}
{assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
<div class="quiqqer-productList-product-list-text-shippingTime">
{$ShippingTimeFrontendView->create()}
......
......@@ -69,12 +69,12 @@
{/foreach}
{assign var=ShippingTimeFrontendView
value=$TemplateCologneUtils::getShippingTimeFrontendView($Product->getId())}
value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
{$ShippingTimeFrontendView->create()}
{/if}
{assign var=StockFrontendView value=$TemplateCologneUtils::getStockFrontendView($Product->getId())}
{assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())}
{if $StockFrontendView}
{$StockFrontendView->create()}
{/if}
......
......@@ -52,12 +52,12 @@
{/foreach}
{assign var=ShippingTimeFrontendView
value=$TemplateCologneUtils::getShippingTimeFrontendView($Product->getId())}
value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())}
{if $ShippingTimeFrontendView}
{$ShippingTimeFrontendView->create()}
{/if}
{assign var=StockFrontendView value=$TemplateCologneUtils::getStockFrontendView($Product->getId())}
{assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())}
{if $StockFrontendView}
{$StockFrontendView->create()}
{/if}
......
......@@ -7,6 +7,7 @@
namespace QUI\TemplateCologne;
use QUI;
use Smarty;
use QUI\ERP\Products\Product\ViewFrontend;
use QUI\Smarty\Collector;
......@@ -71,4 +72,17 @@ public static function onQuiqqerProductsProductButtonsEnd(
</div>'
);
}
/**
* Event: on smarty init
*
* @param Smarty $Smarty
* @return void
*/
public static function onSmartyInit(Smarty $Smarty): void
{
$Smarty->registerClass('QUI\TemplateCologne\Utils', '\QUI\TemplateCologne\Utils');
$Smarty->registerClass('QUI\Bricks\Manager', '\QUI\Bricks\Manager');
$Smarty->registerClass('QUI\ERP\Products\Utils\Products', '\QUI\ERP\Products\Utils\Products');
}
}
......@@ -25,7 +25,7 @@
{assign var=brickNoPadding value="brick-no-spacing"}
{/if}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-headerSuffix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}">
......@@ -54,7 +54,7 @@
{assign var=brickNoPadding value="brick-no-spacing"}
{/if}
{assign var=classes value=$TemplateCologneUtils::convertBrickCSSClass($Brick->getAttribute('classes'))}
{assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))}
<section class="template-brick-container template-brick-footerPrefix brick-id-{$Brick->getAttribute('id')} {$classes}">
<div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}">
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren