Merge pull request #19174 from eileenmcnaughton/conttype
[civicrm-core.git] / distmaker / utils / joomlaxml.php
index cbea7bc3703a898ef00b6d9493f4470fa22321a1..087555ec64ffdadc6b423b9911bbce89648659ec 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-define('CIVICRM_MYSQL_STRICT', 0);
+
 if (isset($GLOBALS['_SERVER']['DM_SOURCEDIR'])) {
   $sourceCheckoutDir = $GLOBALS['_SERVER']['DM_SOURCEDIR'];
 }
@@ -80,6 +80,7 @@ function generateJoomlaConfig($version) {
 
   require_once 'CRM/Core/Permission.php';
   require_once 'CRM/Utils/String.php';
+  require_once 'CRM/Core/I18n.php';
   $permissions = CRM_Core_Permission::getCorePermissions(TRUE);
 
   $crmFolderDir = $sourceCheckoutDir . DIRECTORY_SEPARATOR . 'CRM';
@@ -90,8 +91,10 @@ function generateJoomlaConfig($version) {
     $perm = $comp->getPermissions(FALSE, TRUE);
     if ($perm) {
       $info = $comp->getInfo();
-      foreach ($perm as $p) {
-        $permissions[$p] = $info['translatedName'] . ': ' . $p;
+      foreach ($perm as $p => $attr) {
+        $title = $info['translatedName'] . ': ' . array_shift($attr);
+        array_unshift($attr, $title);
+        $permissions[$p] = $attr;
       }
     }
   }
@@ -100,7 +103,7 @@ function generateJoomlaConfig($version) {
   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))] = array(
       'title' => array_shift($attr),