private function bundleActions()
{
foreach ($this->modules as $module) {
// loop through actions and add all classnames
foreach ($this->actions[$module['value']] as $key => $action) {
// ajax action?
if (class_exists('Backend\\Modules\\' . $module['value'] . '\\Ajax\\' . $action['value'])) {
// create reflection class
$reflection = new \ReflectionClass('Backend\\Modules\\' . $module['value'] . '\\Ajax\\' . $action['value']);
} else {
// no ajax action? create reflection class
$reflection = new \ReflectionClass('Backend\\Modules\\' . $module['value'] . '\\Actions\\' . $action['value']);
}
// get the tag offset
$offset = mb_strpos($reflection->getDocComment(), ACTION_GROUP_TAG) + mb_strlen(ACTION_GROUP_TAG);
// no tag present? move on!
if (!($offset - mb_strlen(ACTION_GROUP_TAG))) {
continue;
}
// get the group info
$groupInfo = trim(mb_substr($reflection->getDocComment(), $offset, mb_strpos($reflection->getDocComment(), '*', $offset) - $offset));
// get name and description
$bits = explode("\t", $groupInfo);
// delete empty values
foreach ($bits as $i => $bit) {
if (empty($bit)) {
unset($bits[$i]);
}
}
// add group to actions
$this->actions[$module['value']][$key]['group'] = $bits[0];
// add group to array
$this->actionGroups[$bits[0]] = end($bits);
}
}
}