#0 | Phalcon\Image\Adapter\Gd->__construct(/var/www/html/hettapijthuis.nl/public/upload/801790Ø55.webp)
/var/www/html/hettapijthuis.nl/src/app/Lib/Helper/Image.php (59) <?php
namespace CLSystems\PhalCMS\Lib\Helper;
use Phalcon\Image\Adapter\Gd;
use Phalcon\Image\Enum;
use function CLSystems\PhalCMS\Lib\debugVar;
class Image
{
protected $imageUri;
protected $imageFile;
protected $imageThumbUri;
public function __construct($imageFile)
{
if (strpos($imageFile, BASE_PATH . '/public/upload/') !== 0)
{
$imageFile = BASE_PATH . '/public/upload/' . $imageFile;
}
$this->imageFile = $imageFile;
$this->imageUri = str_replace(BASE_PATH . '/public', DOMAIN, $this->imageFile);
$this->imageThumbUri = dirname($this->imageUri) . '/thumbs';
}
public function getResize($width = null, $height = null)
{
if (null === $width && null === $height)
{
$width = 100;
}
preg_match('#^.*(\.[^.]*)$#', $this->imageFile, $matches);
$extension = $matches[1];
$thumbName = basename($this->imageFile, $extension) . '_' . ($width ?: 0) . 'x' . ($height ?: 0) . $extension;
$thumbPath = dirname($this->imageFile) . '/thumbs';
if (!is_file($thumbPath . '/' . $thumbName))
{
if (!is_dir($thumbPath))
{
mkdir($thumbPath, 0755, true);
}
if ($width && $height)
{
$master = Enum::AUTO;
}
elseif ($width)
{
$master = Enum::WIDTH;
}
else
{
$master = Enum::HEIGHT;
}
$handler = new Gd($this->imageFile);
$handler->resize($width, $height, $master);
$handler->save($thumbPath . '/' . $thumbName, 100);
}
return $this->imageThumbUri . '/' . $thumbName;
}
public function getUri()
{
return $this->imageUri;
}
public function exists()
{
return is_file($this->imageFile);
}
public static function loadImage($imageString, $returnFirst = true)
{
$imageString = trim($imageString);
$imageList = [];
if (strpos($imageString, '[') === 0
|| strpos($imageString, '{') === 0
)
{
$images = json_decode($imageString, true) ?: [];
}
else
{
$images = [$imageString];
}
if ($images)
{
foreach ($images as $image)
{
$handler = new Image($image);
if ($handler->exists())
{
$imageList[] = $handler;
}
}
if ($imageList)
{
return $returnFirst ? $imageList[0] : $imageList;
}
}
return false;
}
}
|
#1 | CLSystems\PhalCMS\Lib\Helper\Image->getResize(300, 120)
/var/www/html/hettapijthuis.nl/cache/volt/Widget_FlashNews_Tmpl_Content_BlogStack.volt.php (8) <div class="blog-stack">
<?php foreach ($posts as $post) { ?>
<div class="uk-card uk-background-muted uk-grid-collapse uk-margin" uk-grid>
<?php $image = CLSystems\PhalCMS\Lib\Helper\Image::loadImage($post->t('image')); ?>
<?php if (!empty($image)) { ?>
<div class="uk-card-media-left uk-cover-container uk-width-1-3">
<a class="uk-link-reset" href="<?= $post->link ?>" title="<?= $this->escaper->escapeHtmlAttr($post->t('title')) ?>">
<img data-src="<?= $image->getResize(300, 120) ?>" alt="<?= $this->escaper->escapeHtmlAttr(html_entity_decode($post->t('title'))) ?>" uk-cover uk-img/>
<canvas width="300" height="120"></canvas>
</a>
</div>
<?php } ?>
<div class="uk-width-2-3">
<div class="uk-padding-small">
<h4 class="uk-h5 uk-margin-remove uk-text-truncate">
<a class="uk-link-reset" href="<?= $post->link ?>"
title="<?= $this->escaper->escapeHtmlAttr($post->t('title')) ?>">
<?= $post->t('title') ?>
</a>
</h4>
<p class="uk-margin-remove uk-text-meta uk-text-break">
<?= $post->summary() ?>
</p>
<a href="<?= $post->link ?>"
class="uk-button uk-button-default uk-button-small uk-margin">
<?= CLSystems\PhalCMS\Lib\Helper\Text::_('read-more') ?>
</a>
</div>
</div>
</div>
<?php } ?>
</div>
|
#2 | unknown |
#3 | Phalcon\Mvc\View\Engine\Volt->render(/var/www/html/hettapijthuis.nl/src/app/Widget/FlashNews/Tmpl/Content/BlogStack.volt, Array([posts] => Object(Phalcon\Mvc\Model\Resultset\Simple)), false) |
#4 | Phalcon\Mvc\View->engineRender(Array([.volt] => Object(Phalcon\Mvc\View\Engine\Volt)), Content/BlogStack, false, false) |
#5 | Phalcon\Mvc\View->partial(Content/BlogStack, Array([posts] => Object(Phalcon\Mvc\Model\Resultset\Simple))) |
#6 | Phalcon\Mvc\View->getPartial(Content/BlogStack, Array([posts] => Object(Phalcon\Mvc\Model\Resultset\Simple)))
/var/www/html/hettapijthuis.nl/src/app/Widget/FlashNews/FlashNews.php (96) <?php
namespace CLSystems\PhalCMS\Widget\FlashNews;
use Phalcon\Paginator\Adapter\QueryBuilder as Paginator;
use CLSystems\PhalCMS\Lib\Factory;
use CLSystems\PhalCMS\Lib\Widget;
use CLSystems\PhalCMS\Lib\Mvc\Model\Post;
use CLSystems\PhalCMS\Lib\Mvc\Model\PostCategory;
class FlashNews extends Widget
{
public function getContent()
{
$cid = $this->widget->get('params.categoryIds', []);
$postsNum = $this->widget->get('params.postsNum', 5, 'uint');
if (count($cid)) {
$bindIds = [];
$nested = new PostCategory;
foreach ($cid as $id) {
if ($tree = $nested->getTree((int)$id)) {
foreach ($tree as $node) {
$bindIds[] = (int)$node->id;
}
}
}
if (empty($bindIds)) {
return null;
}
$queryBuilder = Post::query()
->createBuilder()
->from(['post' => Post::class])
->where('post.parentId IN ({cid:array})', ['cid' => array_unique($bindIds)])
->andWhere('post.state = :state:', ['state' => 'P'])
->andWhere('post.context = :context:', ['context' => 'post']);
switch ($this->widget->get('params.orderBy', 'latest')) {
case 'random':
$queryBuilder->orderBy('RAND()');
break;
case 'views':
$queryBuilder->orderBy('hits desc');
break;
case 'titleAsc':
$queryBuilder->orderBy('title asc');
break;
case 'titleDesc':
$queryBuilder->orderBy('title desc');
break;
default:
$queryBuilder->orderBy('createdAt desc');
break;
}
// Init renderer
$renderer = $this->getRenderer();
$partial = 'Content/' . $this->getPartialId();
if ('BlogList' === $this->widget->get('params.displayLayout', 'FlashNews')) {
$paginator = new Paginator(
[
'builder' => $queryBuilder,
'limit' => $postsNum,
'page' => Factory::getService('request')->get('page', ['absint'], 0),
]
);
$paginate = $paginator->paginate();
if ($paginate->getTotalItems()) {
return $renderer->getPartial(
$partial,
[
'posts' => $paginate->getItems(),
'pagination' => Factory::getService('view')->getPartial(
'Pagination/Pagination',
[
'paginator' => $paginator,
]
),
]
);
}
} else {
$posts = $queryBuilder->limit($postsNum, 0)->getQuery()->execute();
if ($posts->count()) {
return $renderer->getPartial($partial, ['posts' => $posts]);
}
}
}
return null;
}
}
|
#7 | CLSystems\PhalCMS\Widget\FlashNews\FlashNews->getContent()
/var/www/html/hettapijthuis.nl/src/app/Lib/Widget.php (84) <?php
namespace CLSystems\PhalCMS\Lib;
use CLSystems\PhalCMS\Lib\Mvc\View\ViewBase;
use CLSystems\Php\Registry;
use ReflectionClass;
class Widget
{
/** @var Registry */
protected $widget;
final public function __construct(Registry $widget)
{
$this->widget = $widget;
$this->onConstruct();
}
public function onConstruct()
{
}
public function getTitle()
{
return $this->widget->get('title');
}
public function getRenderData()
{
return [
'widget' => $this->widget,
];
}
public function getPartialId()
{
return $this->widget->get('params.displayLayout', $this->widget->get('manifest.name'));
}
public function getContent()
{
$content = $this->widget->get('params.content', null);
if (null !== $content && is_string($content))
{
return $content;
}
return $this->getRenderer()
->getPartial('Content/' . $this->getPartialId(), $this->getRenderData());
}
public function getRenderer()
{
static $renderers = [];
$class = get_class($this);
if (isset($renderers[$class]))
{
return $renderers[$class];
}
$renderers[$class] = ViewBase::getInstance();
$reflectionClass = new ReflectionClass($this);
$renderers[$class]->setViewsDir(
[
TPL_SITE_PATH . '/Tmpl/Widget',
TPL_SITE_PATH . '/Widget',
dirname($reflectionClass->getFileName()) . '/Tmpl/',
TPL_SYSTEM_PATH . '/Widget/',
]
);
$renderers[$class]->disable();
return $renderers[$class];
}
public function render($wrapper = null)
{
$title = $this->getTitle();
$content = $this->getContent();
if ($title || $content)
{
$widgetData = [
'widget' => $this->widget,
'title' => $title,
'content' => $content,
];
if (null === $wrapper)
{
$wrapper = 'Wrapper';
}
return $this->getRenderer()
->getPartial('Wrapper/' . $wrapper, $widgetData);
}
return null;
}
} |
#8 | CLSystems\PhalCMS\Lib\Widget->render(HeadingLine)
/var/www/html/hettapijthuis.nl/src/app/Lib/Helper/Widget.php (144) <?php
namespace CLSystems\PhalCMS\Lib\Helper;
use Phalcon\Loader;
use CLSystems\PhalCMS\Lib\Mvc\Model\Translation;
use CLSystems\PhalCMS\Lib\Widget as CmsWidget;
use CLSystems\PhalCMS\Lib\Mvc\Model\Config as ConfigModel;
use CLSystems\PhalCMS\Lib\Form\Form;
use CLSystems\PhalCMS\Lib\Form\Field;
use CLSystems\Php\Registry;
class Widget
{
/** @var array */
protected static $widgets = null;
protected static function appendWidget($widgetPath, $coreWidgets)
{
$widgetName = basename($widgetPath);
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $widgetName . '\\' . $widgetName;
$configFile = $widgetPath . '/Config.php';
if (class_exists($widgetClass)
&& is_file($configFile)
)
{
$widgetConfig = new Registry;
$widgetConfig->set('isCmsCore', in_array($widgetClass, $coreWidgets));
$widgetConfig->set('manifest', $widgetConfig->parse($configFile));
self::$widgets[$widgetClass] = $widgetConfig;
}
}
public static function getWidgets()
{
if (null === self::$widgets)
{
self::$widgets = [];
$coreWidgets = Config::get('core.widgets', []);
$template = Config::getTemplate()->name;
$widgetTmplPaths = [
APP_PATH . '/Tmpl/Site/' . $template . '/Tmpl/Widget',
APP_PATH . '/Tmpl/Site/' . $template . '/Widget',
];
foreach ($widgetTmplPaths as $widgetTmplPath)
{
if (is_dir($widgetTmplPath))
{
(new Loader)
->registerNamespaces(
[
'CLSystems\\PhalCMS\\Widget' => $widgetTmplPath,
]
)
->register();
foreach (FileSystem::scanDirs($widgetTmplPath) as $widgetPath)
{
self::appendWidget($widgetPath, $coreWidgets);
}
}
}
foreach (FileSystem::scanDirs(WIDGET_PATH) as $widgetPath)
{
self::appendWidget($widgetPath, $coreWidgets);
}
$plugins = Event::getPlugins();
if (!empty($plugins['Cms']))
{
/** @var Registry $pluginConfig */
foreach ($plugins['Cms'] as $pluginConfig)
{
$widgetPluginPath = PLUGIN_PATH . '/Cms/' . $pluginConfig->get('manifest.name') . '/Widget';
if (is_dir($widgetPluginPath))
{
foreach (FileSystem::scanDirs($widgetPluginPath) as $widgetPath)
{
self::appendWidget($widgetPath, $coreWidgets);
}
}
}
}
}
return self::$widgets;
}
public static function renderPosition($position, $wrapper = null)
{
$results = '';
$widgetItems = self::getWidgetItems();
if (isset($widgetItems[$position]))
{
foreach ($widgetItems[$position] as $widget)
{
$results .= self::render($widget, $wrapper);
}
}
return $results;
}
public static function createWidget($widgetName, $params = [], $render = true, $wrapper = null)
{
$widgets = self::getWidgets();
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $widgetName . '\\' . $widgetName;
if (!isset($widgets[$widgetClass]))
{
return false;
}
$widgetConfig = clone $widgets[$widgetClass];
$widgetConfig->set('params', $widgetConfig->parse($params));
$widgetConfig->set('id', null);
if ($render)
{
return self::render($widgetConfig, $wrapper);
}
return $widgetConfig;
}
public static function render(Registry $widgetConfig, $wrapper = null)
{
$widgets = self::getWidgets();
$name = $widgetConfig->get('manifest.name');
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $name . '\\' . $name;
if (isset($widgets[$widgetClass]))
{
$widget = new $widgetClass($widgetConfig);
if ($widget instanceof CmsWidget)
{
return $widget->render($wrapper);
}
}
return null;
}
public static function getWidgetItems()
{
static $widgetItems = null;
if (null === $widgetItems)
{
$widgetItems = [];
$widgets = self::getWidgets();
$entities = ConfigModel::find(
[
'conditions' => 'context LIKE :context:',
'bind' => [
'context' => 'cms.config.widget.item.%',
],
'order' => 'ordering ASC',
]
);
$translate = Language::isMultilingual() && Uri::isClient('site');
foreach ($entities as $widget)
{
/** @var ConfigModel $widget */
$widgetConfig = new Registry($widget->data);
$widgetConfig->set('id', $widget->id);
$name = $widgetConfig->get('manifest.name');
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $name . '\\' . $name;
if (isset($widgets[$widgetClass]))
{
if ($translate)
{
$translations = $widget->getTranslations();
if (isset($translations['data']))
{
$widgetConfig->merge($translations['data']);
}
}
// Merge manifest and some global data
$widgetConfig->merge($widgets[$widgetClass]);
$widgetItems[$widgetConfig->get('position')][] = $widgetConfig;
}
}
}
return $widgetItems;
}
public static function renderForm(Registry $widgetData)
{
$widgetId = $widgetData->get('id', 0, 'uint');
$idIndex = $widgetId ?: uniqid();
$configForm = '<div class="widget-params">';
$form = new Form('FormData',
[
[
'name' => 'id',
'type' => 'Hidden',
'value' => $widgetId,
'id' => 'FormData-id' . $idIndex,
'filters' => ['uint'],
],
[
'name' => 'name',
'type' => 'Hidden',
'required' => true,
'value' => $widgetData->get('manifest.name'),
'id' => 'FormData-name' . $idIndex,
'filters' => ['string', 'trim'],
],
[
'name' => 'title',
'type' => 'Text',
'label' => 'title',
'translate' => true,
'value' => $widgetData->get('title'),
'id' => 'FormData-title' . $idIndex,
'filters' => ['string', 'trim'],
],
[
'name' => 'position',
'type' => 'Hidden',
'required' => true,
'value' => $widgetData->get('position'),
'id' => 'FormData-position' . $idIndex,
'filters' => ['string', 'trim'],
],
]
);
$transParamsData = [];
if ($widgetId && Language::isMultilingual())
{
$transData = Translation::find(
[
'conditions' => 'translationId LIKE :translationId:',
'bind' => [
'translationId' => '%.config_data.id=' . $widgetId . '.data',
],
]
);
if ($transData->count())
{
$titleField = $form->getField('title');
foreach ($transData as $transDatum)
{
$registry = new Registry($transDatum->translatedValue);
$parts = explode('.', $transDatum->translationId);
$language = $parts[0];
$titleField->setTranslationData($registry->get('title'), $language);
foreach ($registry->get('params', []) as $name => $value)
{
$transParamsData[$name][$language] = $value;
}
}
}
}
$configForm .= $form->renderFields();
if ($widgetData->has('manifest.params'))
{
$form = new Form('FormData.params', $widgetData->get('manifest.params', []));
$form->bind($widgetData->get('params', []), $transParamsData);
foreach ($form->getFields() as $field)
{
/** @var Field $field */
$field->setId($field->getId() . $idIndex);
$configForm .= $field->render();
}
}
$configForm .= '</div>';
return $configForm;
}
}
|
#9 | CLSystems\PhalCMS\Lib\Helper\Widget::render(Object(CLSystems\Php\Registry), HeadingLine)
/var/www/html/hettapijthuis.nl/src/app/Lib/Helper/Widget.php (103) <?php
namespace CLSystems\PhalCMS\Lib\Helper;
use Phalcon\Loader;
use CLSystems\PhalCMS\Lib\Mvc\Model\Translation;
use CLSystems\PhalCMS\Lib\Widget as CmsWidget;
use CLSystems\PhalCMS\Lib\Mvc\Model\Config as ConfigModel;
use CLSystems\PhalCMS\Lib\Form\Form;
use CLSystems\PhalCMS\Lib\Form\Field;
use CLSystems\Php\Registry;
class Widget
{
/** @var array */
protected static $widgets = null;
protected static function appendWidget($widgetPath, $coreWidgets)
{
$widgetName = basename($widgetPath);
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $widgetName . '\\' . $widgetName;
$configFile = $widgetPath . '/Config.php';
if (class_exists($widgetClass)
&& is_file($configFile)
)
{
$widgetConfig = new Registry;
$widgetConfig->set('isCmsCore', in_array($widgetClass, $coreWidgets));
$widgetConfig->set('manifest', $widgetConfig->parse($configFile));
self::$widgets[$widgetClass] = $widgetConfig;
}
}
public static function getWidgets()
{
if (null === self::$widgets)
{
self::$widgets = [];
$coreWidgets = Config::get('core.widgets', []);
$template = Config::getTemplate()->name;
$widgetTmplPaths = [
APP_PATH . '/Tmpl/Site/' . $template . '/Tmpl/Widget',
APP_PATH . '/Tmpl/Site/' . $template . '/Widget',
];
foreach ($widgetTmplPaths as $widgetTmplPath)
{
if (is_dir($widgetTmplPath))
{
(new Loader)
->registerNamespaces(
[
'CLSystems\\PhalCMS\\Widget' => $widgetTmplPath,
]
)
->register();
foreach (FileSystem::scanDirs($widgetTmplPath) as $widgetPath)
{
self::appendWidget($widgetPath, $coreWidgets);
}
}
}
foreach (FileSystem::scanDirs(WIDGET_PATH) as $widgetPath)
{
self::appendWidget($widgetPath, $coreWidgets);
}
$plugins = Event::getPlugins();
if (!empty($plugins['Cms']))
{
/** @var Registry $pluginConfig */
foreach ($plugins['Cms'] as $pluginConfig)
{
$widgetPluginPath = PLUGIN_PATH . '/Cms/' . $pluginConfig->get('manifest.name') . '/Widget';
if (is_dir($widgetPluginPath))
{
foreach (FileSystem::scanDirs($widgetPluginPath) as $widgetPath)
{
self::appendWidget($widgetPath, $coreWidgets);
}
}
}
}
}
return self::$widgets;
}
public static function renderPosition($position, $wrapper = null)
{
$results = '';
$widgetItems = self::getWidgetItems();
if (isset($widgetItems[$position]))
{
foreach ($widgetItems[$position] as $widget)
{
$results .= self::render($widget, $wrapper);
}
}
return $results;
}
public static function createWidget($widgetName, $params = [], $render = true, $wrapper = null)
{
$widgets = self::getWidgets();
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $widgetName . '\\' . $widgetName;
if (!isset($widgets[$widgetClass]))
{
return false;
}
$widgetConfig = clone $widgets[$widgetClass];
$widgetConfig->set('params', $widgetConfig->parse($params));
$widgetConfig->set('id', null);
if ($render)
{
return self::render($widgetConfig, $wrapper);
}
return $widgetConfig;
}
public static function render(Registry $widgetConfig, $wrapper = null)
{
$widgets = self::getWidgets();
$name = $widgetConfig->get('manifest.name');
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $name . '\\' . $name;
if (isset($widgets[$widgetClass]))
{
$widget = new $widgetClass($widgetConfig);
if ($widget instanceof CmsWidget)
{
return $widget->render($wrapper);
}
}
return null;
}
public static function getWidgetItems()
{
static $widgetItems = null;
if (null === $widgetItems)
{
$widgetItems = [];
$widgets = self::getWidgets();
$entities = ConfigModel::find(
[
'conditions' => 'context LIKE :context:',
'bind' => [
'context' => 'cms.config.widget.item.%',
],
'order' => 'ordering ASC',
]
);
$translate = Language::isMultilingual() && Uri::isClient('site');
foreach ($entities as $widget)
{
/** @var ConfigModel $widget */
$widgetConfig = new Registry($widget->data);
$widgetConfig->set('id', $widget->id);
$name = $widgetConfig->get('manifest.name');
$widgetClass = 'CLSystems\\PhalCMS\\Widget\\' . $name . '\\' . $name;
if (isset($widgets[$widgetClass]))
{
if ($translate)
{
$translations = $widget->getTranslations();
if (isset($translations['data']))
{
$widgetConfig->merge($translations['data']);
}
}
// Merge manifest and some global data
$widgetConfig->merge($widgets[$widgetClass]);
$widgetItems[$widgetConfig->get('position')][] = $widgetConfig;
}
}
}
return $widgetItems;
}
public static function renderForm(Registry $widgetData)
{
$widgetId = $widgetData->get('id', 0, 'uint');
$idIndex = $widgetId ?: uniqid();
$configForm = '<div class="widget-params">';
$form = new Form('FormData',
[
[
'name' => 'id',
'type' => 'Hidden',
'value' => $widgetId,
'id' => 'FormData-id' . $idIndex,
'filters' => ['uint'],
],
[
'name' => 'name',
'type' => 'Hidden',
'required' => true,
'value' => $widgetData->get('manifest.name'),
'id' => 'FormData-name' . $idIndex,
'filters' => ['string', 'trim'],
],
[
'name' => 'title',
'type' => 'Text',
'label' => 'title',
'translate' => true,
'value' => $widgetData->get('title'),
'id' => 'FormData-title' . $idIndex,
'filters' => ['string', 'trim'],
],
[
'name' => 'position',
'type' => 'Hidden',
'required' => true,
'value' => $widgetData->get('position'),
'id' => 'FormData-position' . $idIndex,
'filters' => ['string', 'trim'],
],
]
);
$transParamsData = [];
if ($widgetId && Language::isMultilingual())
{
$transData = Translation::find(
[
'conditions' => 'translationId LIKE :translationId:',
'bind' => [
'translationId' => '%.config_data.id=' . $widgetId . '.data',
],
]
);
if ($transData->count())
{
$titleField = $form->getField('title');
foreach ($transData as $transDatum)
{
$registry = new Registry($transDatum->translatedValue);
$parts = explode('.', $transDatum->translationId);
$language = $parts[0];
$titleField->setTranslationData($registry->get('title'), $language);
foreach ($registry->get('params', []) as $name => $value)
{
$transParamsData[$name][$language] = $value;
}
}
}
}
$configForm .= $form->renderFields();
if ($widgetData->has('manifest.params'))
{
$form = new Form('FormData.params', $widgetData->get('manifest.params', []));
$form->bind($widgetData->get('params', []), $transParamsData);
foreach ($form->getFields() as $field)
{
/** @var Field $field */
$field->setId($field->getId() . $idIndex);
$configForm .= $field->render();
}
}
$configForm .= '</div>';
return $configForm;
}
}
|
#10 | CLSystems\PhalCMS\Lib\Helper\Widget::renderPosition(Aside, HeadingLine)
/var/www/html/hettapijthuis.nl/cache/volt/Tmpl_Site_PhalCMS_Block_Content.volt.php (34) <div class="uk-section uk-section-small uk-section-default">
<div class="uk-container">
<?php if (CLSystems\PhalCMS\Lib\Helper\Uri::isHome()) { ?>
<div class="uk-margin">
<?= CLSystems\PhalCMS\Lib\Helper\Widget::renderPosition('FlashNews', 'Raw') ?>
</div>
<div class="uk-margin">
<?= CLSystems\PhalCMS\Lib\Helper\Widget::renderPosition('Trending', 'HeadingLine') ?>
</div>
<div class="uk-margin">
<div uk-grid>
<div class="uk-width-2-3@m">
<div uk-margin>
<?= CLSystems\PhalCMS\Lib\Helper\Widget::renderPosition('LatestNews', 'HeadingLine') ?>
</div>
</div>
<div class="uk-width-1-3@m">
<div uk-margin>
<?= CLSystems\PhalCMS\Lib\Helper\Widget::renderPosition('Aside', 'HeadingLine') ?>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div uk-grid>
<div class="uk-width-2-3@m">
<main id="main-content">
<?= $this->getContent() ?>
</main>
</div>
<div class="uk-width-1-3@m">
<aside id="aside">
<?= CLSystems\PhalCMS\Lib\Helper\Widget::renderPosition('Aside', 'HeadingLine') ?>
</aside>
</div>
</div>
<?php } ?>
</div>
</div> |
#11 | unknown |
#12 | Phalcon\Mvc\View\Engine\Volt->render(/var/www/html/hettapijthuis.nl/src/app/Tmpl/Site/PhalCMS/Block/Content.volt, Array([siteName] => Het Tapijthuis, [cmsConfig] => Object(CLSystems\Php\Registry), [user] => Object(CLSystems\PhalCMS\Lib\Helper\User), [metadata] => Object(stdClass), [breadcrumbs] => Array([0] => Array([link] => /, [title] => Home), [1] => Array([link] => /producten, [title] => Producten), [2] => Array([link] => /producten/raambekleding, [title] => Raambekleding), [3] => Array([link] => (empty string), [title] => Vouwgordijnen)), [postCategory] => Object(CLSystems\PhalCMS\Lib\Mvc\Model\PostCategory)), false) |
#13 | Phalcon\Mvc\View->engineRender(Array([.volt] => Object(Phalcon\Mvc\View\Engine\Volt)), Block/Content, false, false) |
#14 | Phalcon\Mvc\View->partial(Block/Content, null) |
#15 | Phalcon\Mvc\View\Engine\AbstractEngine->partial(Block/Content)
/var/www/html/hettapijthuis.nl/cache/volt/Tmpl_Site_PhalCMS_Index.volt.php (84) <!DOCTYPE html>
<html lang="<?= CLSystems\PhalCMS\Lib\Helper\Text::_('locale.code') ?>"
dir="<?= CLSystems\PhalCMS\Lib\Helper\Text::_('locale.direction') ?>"
data-uri-home="<?= (CLSystems\PhalCMS\Lib\Helper\Uri::isHome() ? 'true' : 'false') ?>"
data-uri-root="<?= constant('DOMAIN') ?>"
data-uri-base="<?= CLSystems\PhalCMS\Lib\Helper\Uri::getBaseUriPrefix() ?>">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<?php if (isset($metadata)) { ?>
<?php if (!empty($metadata->metaKeys)) { ?>
<meta name="keywords" content="<?= $metadata->metaKeys ?>"/>
<?php } ?>
<?php if (!empty($metadata->metaDesc)) { ?>
<meta name="description" content="<?= $metadata->metaDesc ?>"/>
<?php } ?>
<?php if (!empty($metadata->contentRights)) { ?>
<meta name="rights" content="<?= $metadata->contentRights ?>"/>
<?php } ?>
<?php if (!empty($metadata->metaRobots)) { ?>
<meta name="robots" content="<?= $metadata->metaRobots ?>"/>
<?php } ?>
<?php if (!empty($metadata->metaTitle)) { ?>
<?php if ($metadata->metaTitle == $siteName) { ?>
<title><?= $metadata->metaTitle ?> - Fashion for Home</title>
<?php } else { ?>
<title><?= $metadata->metaTitle ?> - <?= $this->escaper->escapeHtml($siteName) ?></title>
<?php } ?>
<?php } ?>
<?php } ?>
<link rel="canonical" href="<?= CLSystems\PhalCMS\Lib\Helper\Uri::fromServer() ?>" />
<link rel="shortcut icon" type="image/x-icon" href="<?= constant('DOMAIN') . '/assets/images/logo.png' ?>"/>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/uikit@3.6.21/dist/css/uikit.min.css"/>
<link rel="stylesheet" type="text/css" href="<?= constant('DOMAIN') . '/assets/css/custom.css' ?>"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.6.21/dist/js/uikit.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.6.21/dist/js/uikit-icons.min.js"></script>
<?= implode(PHP_EOL, CLSystems\PhalCMS\Lib\Helper\Event::trigger('onSiteHead', ['System', 'Cms'])) ?>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Het Tapijthuis",
"url": "https://hettapijthuis.nl",
"potentialAction": {
"@type": "SearchAction",
"query-input": "required name=query",
"target": "https://hettapijthuis.nl/search?q={query}"
}
}
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-37596127-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-37596127-1');
</script>
</head>
<body>
<?= implode(PHP_EOL, CLSystems\PhalCMS\Lib\Helper\Event::trigger('onSiteBeforeContent', [], ['System', 'Cms'])) ?>
<?= $this->partial('Block/BeforeContent') ?>
<?= $this->partial('Block/Content') ?>
<?= $this->partial('Block/AfterContent') ?>
<?= implode(PHP_EOL, CLSystems\PhalCMS\Lib\Helper\Event::trigger('onSiteAfterContent', [], ['System', 'Cms'])) ?>
<?= implode(PHP_EOL, CLSystems\PhalCMS\Lib\Helper\Event::trigger('onSiteAfterRender', [], ['System', 'Cms'])) ?>
</body>
</html> |
#16 | unknown |
#17 | Phalcon\Mvc\View\Engine\Volt->render(/var/www/html/hettapijthuis.nl/src/app/Tmpl/Site/PhalCMS/Index.volt, Array([siteName] => Het Tapijthuis, [cmsConfig] => Object(CLSystems\Php\Registry), [user] => Object(CLSystems\PhalCMS\Lib\Helper\User), [metadata] => Object(stdClass), [breadcrumbs] => Array([0] => Array([link] => /, [title] => Home), [1] => Array([link] => /producten, [title] => Producten), [2] => Array([link] => /producten/raambekleding, [title] => Raambekleding), [3] => Array([link] => (empty string), [title] => Vouwgordijnen)), [postCategory] => Object(CLSystems\PhalCMS\Lib\Mvc\Model\PostCategory)), true) |
#18 | Phalcon\Mvc\View->engineRender(Array([.volt] => Object(Phalcon\Mvc\View\Engine\Volt)), Index, true) |
#19 | Phalcon\Mvc\View->processRender(display, show, Array()) |
#20 | Phalcon\Mvc\View->render(display, show) |
#21 | Phalcon\Mvc\Application->handle(/producten/raambekleding/vouwgordijnen)
/var/www/html/hettapijthuis.nl/src/app/Lib/CmsApplication.php (117) <?php
namespace CLSystems\PhalCMS\Lib;
use Phalcon\Loader;
use Phalcon\Http\Response;
use Phalcon\Events\Event;
use Phalcon\Mvc\Application;
use Phalcon\Mvc\Dispatcher;
use Phalcon\Mvc\View;
use CLSystems\PhalCMS\Lib\Helper\Asset;
use CLSystems\PhalCMS\Lib\Helper\Config;
use CLSystems\PhalCMS\Lib\Helper\Uri;
use CLSystems\PhalCMS\Lib\Helper\State;
use CLSystems\PhalCMS\Lib\Helper\User;
use CLSystems\PhalCMS\Lib\Helper\Event as EventHelper;
use CLSystems\PhalCMS\Lib\Mvc\View\ViewBase;
use CLSystems\Php\Registry;
use MatthiasMullie\Minify;
use Exception;
class CmsApplication extends Application
{
public function execute()
{
try {
$eventsManager = $this->di->getShared('eventsManager');
$eventsManager->attach('application:beforeSendResponse', $this);
$plugins = EventHelper::getPlugins();
$systemEvents = [
'application:beforeSendResponse',
'dispatch:beforeExecuteRoute',
'dispatch:beforeException',
'dispatch:beforeDispatch',
'dispatch:afterDispatch',
'dispatch:afterInitialize',
];
foreach ($plugins['System'] as $className => $config) {
$handler = EventHelper::getHandler($className, $config);
foreach ($systemEvents as $systemEvent) {
$eventsManager->attach($systemEvent, $handler);
}
}
// Update view dirs
define('TPL_SITE_PATH', APP_PATH . '/Tmpl/Site/' . Config::get('siteTemplate', 'PhalCMS'));
define('TPL_ADMINISTRATOR_PATH', APP_PATH . '/Tmpl/Administrator');
define('TPL_SYSTEM_PATH', APP_PATH . '/Tmpl/System');
if (Uri::isClient('site')) {
$viewDirs = [
TPL_SITE_PATH . '/Tmpl/',
TPL_SITE_PATH . '/',
];
} else {
$viewDirs = [
TPL_ADMINISTRATOR_PATH . '/',
];
}
foreach (['System', 'Cms'] as $plgGroup) {
if (isset($plugins[$plgGroup])) {
/**
* @var string $pluginClass
* @var Registry $pluginConfig
*/
foreach ($plugins[$plgGroup] as $pluginClass => $pluginConfig) {
$pluginName = $pluginConfig->get('manifest.name');
$pluginPath = PLUGIN_PATH . '/' . $plgGroup . '/' . $pluginName;
$psrPaths = [];
if (is_dir($pluginPath . '/Tmpl')) {
$viewDirs[] = $pluginPath . '/Tmpl/';
}
if (is_dir($pluginPath . '/Lib')) {
$psrPaths['CLSystems\\PhalCMS\\Lib'] = $pluginPath . '/Lib';
}
if (is_dir($pluginPath . '/Widget')) {
$psrPaths['CLSystems\\PhalCMS\\Widget'] = $pluginPath . '/Widget';
}
if ($psrPaths) {
(new Loader)
->registerNamespaces($psrPaths, true)
->register();
}
}
}
}
$viewDirs[] = TPL_SYSTEM_PATH . '/';
/** @var ViewBase $view */
$view = $this->di->getShared('view');
$requestUri = $_SERVER['REQUEST_URI'];
if (Config::get('siteOffline') === 'Y'
&& !User::getInstance()->access('super')
) {
$this->view->setMainView('Offline/Index');
if (strpos($requestUri, '/user/') !== 0) {
$requestUri = '';
}
} else {
$view->setMainView('Index');
}
$view->setViewsDir($viewDirs);
$this->setEventsManager($eventsManager);
$this->handle($requestUri)->send();
} catch (Exception $e) {
if (true === DEVELOPMENT_MODE) {
// Let Phalcon Debug catch this
throw $e;
}
try {
if (User::getInstance()->access('super')) {
State::setMark('exception', $e);
}
/**
* @var Dispatcher $dispatcher
* @var View $view
*/
$dispatcher = $this->getDI()->getShared('dispatcher');
$dispatcher->setControllerName(Uri::isClient('administrator') ? 'admin_error' : 'error');
$dispatcher->setActionName('show');
$dispatcher->setParams(
[
'code' => $e->getCode(),
'message' => $e->getMessage(),
]
);
$view = $this->getDI()->getShared('view');
$view->start();
$dispatcher->dispatch();
$view->render(
$dispatcher->getControllerName(),
$dispatcher->getActionName(),
$dispatcher->getParams()
);
$view->finish();
echo $view->getContent();
} catch (Exception $e2) {
debugVar($e2->getMessage());
}
}
}
protected function getCompressor($type)
{
if ('css' === $type) {
$compressor = new Minify\CSS;
$compressor->setImportExtensions(
[
'gif' => 'data:image/gif',
'png' => 'data:image/png',
'svg' => 'data:image/svg+xml',
]
);
} else {
$compressor = new Minify\JS;
}
return $compressor;
}
protected function compressAssets()
{
$basePath = PUBLIC_PATH . '/assets';
$assets = Factory::getService('assets');
foreach (Asset::getFiles() as $type => $files) {
$fileName = md5(implode(':', $files)) . '.' . $type;
$filePath = $basePath . '/compressed/' . $fileName;
$fileUri = DOMAIN . '/assets/compressed/' . $fileName . (DEVELOPMENT_MODE ? '?' . time() : '');
$hasAsset = is_file($filePath);
$ucType = ucfirst($type);
$addFunc = 'add' . $ucType;
if ($hasAsset && !DEVELOPMENT_MODE) {
call_user_func_array([$assets, $addFunc], [$fileUri, false]);
continue;
}
$compressor = self::getCompressor($type);
foreach ($files as $file) {
$compressor->add($file);
}
if (!is_dir($basePath . '/compressed/')) {
mkdir($basePath . '/compressed/', 0777, true);
}
if ($compressor->minify($filePath)) {
chmod($filePath, 0777);
call_user_func_array([$assets, $addFunc], [$fileUri, false]);
}
unset($compressor);
}
}
public function beforeSendResponse(Event $event, CmsApplication $app, Response $response)
{
$request = $this->di->getShared('request');
if ($request->isAjax()) {
return;
}
/** @var Asset $assets */
$this->compressAssets();
$assets = $this->di->getShared('assets');
// Compress CSS
ob_start();
$assets->outputCss();
$assets->outputInlineCss();
$content = str_replace('</head>', ob_get_clean() . '</head>', $response->getContent());
// Compress JS
ob_start();
$assets->outputJs();
$assets->outputInlineJs();
$code = Asset::getCode() . ob_get_clean();
// Extra code (in the footer)
$content = str_replace('</body>', $code . '</body>', $content);
$response->setContent($content);
}
}
|
#22 | CLSystems\PhalCMS\Lib\CmsApplication->execute()
/var/www/html/hettapijthuis.nl/public/index.php (14) <?php
declare(strict_types=1);
error_reporting(E_ALL);
ini_set('display_errors', 'true');
use CLSystems\PhalCMS\Lib\Factory;
define('BASE_PATH', dirname(__DIR__));
require_once BASE_PATH . '/src/app/Lib/Factory.php';
// Execute application
Factory::getApplication()->execute(); |