public static function getTemplates()
{
trigger_error('Backend\\Modules\\ContentBlocks\\Engine is deprecated.
Switch to doctrine instead.', E_USER_DEPRECATED);
$templates = array();
$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
$theme = BackendModel::get('fork.settings')->get('Core', 'theme', 'core');
if ($theme != 'core') {
$path = FRONTEND_PATH . '/Themes/' . $theme . '/Modules/ContentBlocks/Layout/Widgets';
if (is_dir($path)) {
$finder->in($path);
}
}
foreach ($finder->files() as $file) {
$templates[] = $file->getBasename();
}
return array_unique($templates);
}