Skip to content

Commit

Permalink
Reinstate missing rows
Browse files Browse the repository at this point in the history
  • Loading branch information
christianwach committed Nov 8, 2017
1 parent f6e041d commit c627b39
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions CRM/ACL/Form/WordPress/Permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,28 @@ public function buildQuickForm() {
}
}

// build table rows by merging role perms
$rows = array();
foreach ($rolePerms as $role => $perms) {
foreach ($perms as $name => $title) {
$rows[$name] = $title;
}
}

// Build array keyed by permission
$table = array();
foreach ($descArray as $perm => $desc) {
foreach ($rows AS $perm => $label) {

// Init row with permission description
// Init row with permission label
$table[$perm] = array(
'desc' => $desc,
'label' => $label,
'roles' => array(),
);

// Add permission label and role names
// Add permission description and role names
foreach ($roles as $key => $label) {
if (isset($rolePerms[$key][$perm])) {
$table[$perm]['label'] = $rolePerms[$key][$perm];
if (isset($descArray[$perm])) {
$table[$perm]['desc'] = $descArray[$perm];
}
$table[$perm]['roles'][] = $key;
}
Expand Down

0 comments on commit c627b39

Please sign in to comment.