if(\Bitrix\Main\Loader::includeModule('wt.core')) {
app()->service()->assets()->setPlugins([
'kit:config',
'kit:flex-kit',
'kit:core',
'kit:bsCore',
'kit:collapse',
'kit:site',
'kit:toolkit',
'kit:theme',
])->render();
}
$APPLICATION->ShowHead();
$templatePath = app()->service()->templater()->getComponent('kit')->getTemplatePath();
$templateSvgPath = $templatePath . '/svg';
function scanTemplates($path, $basePath, $recursive = false){
$tree = glob($path . '/*.php');
?>
foreach ((array)$tree as $t) {
$templateName = ltrim(substr($t, strlen($basePath), strlen($t) - strlen($basePath) - 4), "/");
echo '
' . app()->service()->templater()->get('kit:card/block', [
'name' => $templateName,
'picture' => '
'.app()->service()->templater()->get('kit:'.$templateName).'
',
'header' => filesize($t),
]) . '
';
}
?>
if($recursive) {
$treeDir = glob($path . '/*', GLOB_ONLYDIR);
foreach ($treeDir as $dir) {
scanTemplates($dir, $basePath, true);
}
}
}
?>
scanTemplates($templateSvgPath, $templatePath, true);
?>