public static function getTemplateList($path, $plugin, $theme)
{
if ($plugin) {
$templatesPathes = App::path('View', $plugin);
} else {
$templatesPathes = App::path('View');
if ($theme) {
array_unshift($templatesPathes, WWW_ROOT . 'theme' . DS . $theme . DS);
}
}
$_templates = array();
foreach ($templatesPathes as $templatesPath) {
$templatesPath .= $path . DS;
$folder = new Folder($templatesPath);
$files = $folder->read(true, true);
$foler = null;
if ($files[1]) {
if ($_templates) {
$_templates = array_merge($_templates, $files[1]);
} else {
$_templates = $files[1];
}
}
}
$templates = array();
foreach ($_templates as $template) {
$ext = Configure::read('BcApp.templateExt');
if ($template != 'installations' . $ext) {
$template = basename($template, $ext);
$templates[$template] = $template;
}
}
return $templates;
}