first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
function smarty_function_insert_articles($params, &$smarty)
{
$defaults = [
'count' => null,
'section' => null,
'section_id' => null,
'product_id' => null,
'related' => [],
'related_symmetric' => false,
'related_type' => false,
'tag' => null,
'assign' => null,
'order' => 'DESC',
'image' => 1,
'require_tag' => null,
'template' => 'block.articles.tpl',
];
$params = array_merge($defaults, $params);
$tmpParams = $params;
unset($tmpParams['assign']);
$smarty->loadPlugin('smarty_function_get_articles');
$data = smarty_function_get_articles($tmpParams, $smarty);
if (!empty($params['assign'])) {
$smarty->assign($params['assign'], $data);
} elseif (!empty($params['template'])) {
$_smarty_tpl_vars = $smarty->tpl_vars;
echo $smarty->_subTemplateRender($params['template'], $smarty->cache_id, $smarty->compile_id, 0, null, $data, 0, false);
$smarty->tpl_vars = $_smarty_tpl_vars;
} else {
return $data;
}
}