protected function setPossibleActions()
{
// build path to the module
$frontendModulePath = FRONTEND_MODULES_PATH . '/' . $this->getModule();
$filesystem = new Filesystem();
if ($filesystem->exists($frontendModulePath . '/Actions')) {
// get regular actions
$finder = new Finder();
$finder->name('*.php');
foreach ($finder->files()->in($frontendModulePath . '/Actions') as $file) {
/** @var $file \SplFileInfo */
$action = $file->getBasename('.php');
if (!in_array($action, $this->disabledActions)) {
$this->possibleActions[$file->getBasename()] = $action;
}
}
}
if ($filesystem->exists($frontendModulePath . '/Ajax')) {
// get ajax-actions
$finder = new Finder();
$finder->name('*.php');
foreach ($finder->files()->in($frontendModulePath . '/Ajax') as $file) {
/** @var $file \SplFileInfo */
$action = $file->getBasename('.php');
if (!in_array($action, $this->disabledAJAXActions)) {
$this->possibleAJAXActions[$file->getBasename()] = $action;
}
}
}
}