feat: VivesPOS landing on Winter CMS 1.2 — theme + plugin + Dockerfile
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
- Base: wintercms/winter branch 1.2 (full framework) - Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS - Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication - Partials: hero (offline-first), features, modes (offline/nube toggle), screenshots, pricing (3 planes), comparison, FAQ, CTA - Plugin VivesPOS.Site with ContactForm - Dockerfile: PHP 8.2 Apache, port 80, healthcheck - Added winter/wn-pages, blog, sitemap, seo plugins - Active theme set to vivespos
This commit is contained in:
59
modules/system/twig/MailPartialNode.php
Normal file
59
modules/system/twig/MailPartialNode.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php namespace System\Twig;
|
||||
|
||||
use Twig\Node\Node as TwigNode;
|
||||
use Twig\Compiler as TwigCompiler;
|
||||
|
||||
/**
|
||||
* Represents a partial node
|
||||
*
|
||||
* @package winter\wn-cms-module
|
||||
* @author Alexey Bobkov, Samuel Georges
|
||||
*/
|
||||
class MailPartialNode extends TwigNode
|
||||
{
|
||||
public function __construct(TwigNode $nodes, $paramNames, $body, $lineno, $tag = 'partial')
|
||||
{
|
||||
$nodes = ['nodes' => $nodes];
|
||||
|
||||
if ($body) {
|
||||
$nodes['body'] = $body;
|
||||
}
|
||||
|
||||
parent::__construct($nodes, ['names' => $paramNames], $lineno, $tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the node to PHP.
|
||||
*
|
||||
* @param TwigCompiler $compiler A TwigCompiler instance
|
||||
*/
|
||||
public function compile(TwigCompiler $compiler)
|
||||
{
|
||||
$compiler->addDebugInfo($this);
|
||||
|
||||
$compiler->write("\$context['__system_partial_params'] = [];\n");
|
||||
|
||||
if ($this->hasNode('body')) {
|
||||
$compiler
|
||||
->addDebugInfo($this)
|
||||
->write('ob_start();')
|
||||
->subcompile($this->getNode('body'))
|
||||
->write("\$context['__system_partial_params']['body'] = ob_get_clean();");
|
||||
}
|
||||
|
||||
for ($i = 1; $i < count($this->getNode('nodes')); $i++) {
|
||||
$compiler->write("\$context['__system_partial_params']['".$this->getAttribute('names')[$i-1]."'] = ");
|
||||
$compiler->subcompile($this->getNode('nodes')->getNode($i));
|
||||
$compiler->write(";\n");
|
||||
}
|
||||
|
||||
$compiler
|
||||
->write("echo \System\Classes\MailManager::instance()->renderPartial(")
|
||||
->subcompile($this->getNode('nodes')->getNode(0))
|
||||
->write(", \$context['__system_partial_params']")
|
||||
->write(");\n")
|
||||
;
|
||||
|
||||
$compiler->write("unset(\$context['__system_partial_params']);\n");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user