*
* @return array|string
*/
- public static function formatMultilingualHonorParams($params, $setDefault = FALSE) {
+ public static function formatModuleData($params, $setDefault = FALSE, $module) {
+ global $tsLocale;
$config = CRM_Core_Config::singleton();
-
- $sctJson = $sctJsonDecode = NULL;
+ $json = $jsonDecode = NULL;
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
//When we are fetching the honor params respecting both multi and mono lingual state
//and setting it to default param of Contribution Page's Main and Setting form
if ($setDefault) {
- $sctJsonDecode = json_decode($params);
- $sctJsonDecode = (array) $sctJsonDecode->soft_credit;
- if (!$domain->locales && !empty($sctJsonDecode['default'])) {
+ $jsonDecode = json_decode($params);
+ $jsonDecode = (array) $jsonDecode->$module;
+ if (!$domain->locales && !empty($jsonDecode['default'])) {
//monolingual state
- $sctJsonDecode += (array) $sctJsonDecode['default'];
+ $jsonDecode += (array) $jsonDecode['default'];
+ unset($jsonDecode['default']);
}
- elseif (!empty($jsonDecode[$config->lcMessages])) {
- elseif (!empty($sctJsonDecode[$tsLocale])) {
++ elseif (!empty($jsonDecode[$tsLocale])) {
//multilingual state
- foreach ($jsonDecode[$config->lcMessages] as $column => $value) {
- foreach ($sctJsonDecode[$tsLocale] as $column => $value) {
- $sctJsonDecode[$column] = $value;
++ foreach ($jsonDecode[$tsLocale] as $column => $value) {
+ $jsonDecode[$column] = $value;
}
- unset($jsonDecode[$config->lcMessages]);
- unset($sctJsonDecode[$tsLocale]);
++ unset($jsonDecode[$tsLocale]);
}
- return $sctJsonDecode;
+ return $jsonDecode;
}
//check and handle multilingual honoree params
// These scripts are only needed by back-office users
if (CRM_Core_Permission::check('access CiviCRM')) {
- $items[] = "packages/jquery/plugins/jquery.menu$min.js";
+ $items[] = "packages/jquery/plugins/jquery.menu.min.js";
- $items[] = "css/navigation.css";
+ $items[] = "css/civicrmNavigation.css";
- $items[] = "packages/jquery/plugins/jquery.jeditable$min.js";
- $items[] = "packages/jquery/plugins/jquery.notify$min.js";
+ $items[] = "packages/jquery/plugins/jquery.jeditable.min.js";
+ $items[] = "packages/jquery/plugins/jquery.notify.min.js";
$items[] = "js/jquery/jquery.crmeditable.js";
}