From 564d1e45c4dde4d7157f7d8cdd5e58fa4f48c5f0 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Mon, 30 Mar 2015 15:01:13 -0400 Subject: [PATCH] CRM-16201 permissions - add permission descriptions to Joomla distmaker --- distmaker/utils/joomlaxml.php | 14 ++++++++++---- xml/templates/access.tpl | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/distmaker/utils/joomlaxml.php b/distmaker/utils/joomlaxml.php index 69838daa40..cbea7bc370 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -80,14 +80,14 @@ function generateJoomlaConfig($version) { require_once 'CRM/Core/Permission.php'; require_once 'CRM/Utils/String.php'; - $permissions = CRM_Core_Permission::getCorePermissions(); + $permissions = CRM_Core_Permission::getCorePermissions(TRUE); $crmFolderDir = $sourceCheckoutDir . DIRECTORY_SEPARATOR . 'CRM'; require_once 'CRM/Core/Component.php'; $components = CRM_Core_Component::getComponentsFromFile($crmFolderDir); foreach ($components as $comp) { - $perm = $comp->getPermissions(); + $perm = $comp->getPermissions(FALSE, TRUE); if ($perm) { $info = $comp->getInfo(); foreach ($perm as $p) { @@ -97,9 +97,15 @@ function generateJoomlaConfig($version) { } $perms_array = array(); - foreach ($permissions as $perm => $title) { + foreach ($permissions as $perm => $attr) { + // give an empty string as default description + $attr[] = ''; + //order matters here, but we deal with that later - $perms_array[CRM_Utils_String::munge(strtolower($perm))] = $title; + $perms_array[CRM_Utils_String::munge(strtolower($perm))] = array( + 'title' => array_shift($attr), + 'description' => array_shift($attr), + ); } $smarty->assign('permissions', $perms_array); diff --git a/xml/templates/access.tpl b/xml/templates/access.tpl index 9f054f84a6..13a9593f17 100644 --- a/xml/templates/access.tpl +++ b/xml/templates/access.tpl @@ -3,8 +3,8 @@
-{foreach from=$permissions item=title key=name} - +{foreach from=$permissions item=perm key=name} + {/foreach}
-- 2.25.1