$perm = $comp->getPermissions(FALSE, $descriptions);
if ($perm) {
$info = $comp->getInfo();
- if ($descriptions) {
- foreach ($perm as $p => $attr) {
- $title = $info['translatedName'] . ': ' . array_shift($attr);
- array_unshift($attr, $title);
+ foreach ($perm as $p => $attr) {
+
+ if (!is_array($attr)) {
+ $attr = array($attr);
+ }
+
+ $attr[0] = $info['translatedName'] . ': ' . $attr[0];
+
+ if ($descriptions) {
$permissions[$p] = $attr;
}
- }
- else {
- foreach ($perm as $p) {
- $permissions[$p] = $info['translatedName'] . ': ' . $p;
+ else {
+ $permissions[$p] = $attr[0];
}
}
}