private function getPossibleTemplates()
{
$templates = [];
$finder = new Finder();
$finder->name('*.html.twig');
$finder->in(FRONTEND_MODULES_PATH . '/ContentBlocks/Layout/Widgets');
// if there is a custom theme we should include the templates there also
if ($this->currentTheme != 'core') {
$path = FRONTEND_PATH . '/Themes/' . $this->currentTheme . '/Modules/ContentBlocks/Layout/Widgets';
if (is_dir($path)) {
$finder->in($path);
}
}
foreach ($finder->files() as $file) {
$templates[] = $file->getBasename();
}
$templates = array_unique($templates);
return array_combine($templates, $templates);
}