public function on_list_themes($pars)
{
$theme_dir_path = $this->configuration['support-path'] . '/themes/';
if (!is_dir($theme_dir_path)) {
throw new Exception('There is no themes directory available.');
}
$themes = array();
if (false !== ($d = opendir($theme_dir_path))) {
while (false !== ($f = readdir($d))) {
if (0 == strncmp('.', $f, 1) || '.amTheme' != substr($f, -8)) {
continue;
}
$yaml = YAML::load($theme_dir_path . $f);
$yaml['id'] = substr($f, 0, -8);
$themes[] = $yaml;
}
closedir($d);
}
self::setResult($themes);
}