// Get the core permissions array
$permissionsArray = self::getPermissionArray();
+ $permissionsDesc = self::getPermissionArray(TRUE);
// Get the wordpress roles, default capabilities and assign to the form
// TODO: Create a new wordpress role (Anonymous user) and define capabilities in Wordpress Access Control
$this->setDefaults($defaults);
+ $descArray = array();
+ foreach ($permissionsDesc as $perm => $attr) {
+ if (count($attr) > 1) {
+ $descArray[$perm] = $attr[1];
+ }
+ }
+ $this->assign('permDesc', $descArray);
$this->assign('rolePerms', $rolePerms);
$this->assign('roles', $roles);
* This function should be shared from a similar one in
* distmaker/utils/joomlaxml.php
*
+ * @param bool $descriptions
+ * Whether to return permission descriptions
+ *
* @return array
* civicrm permissions
*/
- public static function getPermissionArray() {
+ public static function getPermissionArray($descriptions = FALSE) {
global $civicrm_root;
- $permissions = CRM_Core_Permission::basicPermissions();
+ $permissions = CRM_Core_Permission::basicPermissions(FALSE, $descriptions);
$perms_array = array();
foreach ($permissions as $perm => $title) {
{else}
<tr style="background-color: #FFFFFF;">
{/if}
- <td style="height:30px;">
+ <td style="height:3em;">
{if $i eq 1}
{$form.$role_name.$name.label}
+ {if $permDesc.$name}
+ <br/><span class="description">{$permDesc.$name}</span>
+ {/if}
{/if}
</td>
<td align="center">{$form.$role_name.$name.html}<br /></td>