);
// find any supplemental information
if(CRM_Utils_Array::value('action',$params)){
- $specFunction = 'civicrm_api3_setting_' . $params['action'] . '_spec';
+ $specFunction = '_civicrm_api3_setting_' . strtolower($params['action']) . '_spec';
if (function_exists($specFunction)) {
$specFunction($result);
}
/*
* Alter metadata for getfields functions
*/
-function civicrm_api3_setting_getfields_spec(&$params) {
+function _civicrm_api3_setting_getfields_spec(&$params) {
$params['filters'] = array('title' => 'Fields you wish to filter by e.g. array("group_name" => "CiviCRM Preferences")');
$params['component_id'] = array('title' => 'id of relevant component');
$params['profile'] = array('title' => 'profile is passed through to hooks & added to cachestring');
*
* @param array $params parameters as passed to the API
*/
-function civicrm_api3_setting_getdefaults_spec(&$params) {
+function _civicrm_api3_setting_getdefaults_spec(&$params) {
$params['domain_id'] = array(
'api.default' => 'current_domain',
'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain
/*
* Alter metadata for getfields functions
*/
-function civicrm_api3_setting_revert_spec(&$params) {
+function _civicrm_api3_setting_revert_spec(&$params) {
$params['name'] = array('title' => 'Setting Name belongs to');
$params['component_id'] = array('title' => 'id of relevant component');
$params['domain_id'] = array(
/*
* Alter metadata for getfields functions
*/
-function civicrm_api3_setting_fill_spec(&$params) {
+function _civicrm_api3_setting_fill_spec(&$params) {
$params['name'] = array('title' => 'Setting Name belongs to');
$params['component_id'] = array('title' => 'id of relevant component');
$params['domain_id'] = array(
*
* @param array $params parameters as passed to the API
*/
-function civicrm_api3_setting_create_spec(&$params) {
+function _civicrm_api3_setting_create_spec(&$params) {
$params['domain_id'] = array(
'api.default' => 'current_domain',
'description' => 'if you do not pass in a domain id this will default to the current domain
*
* @param array $params parameters as passed to the API
*/
-function civicrm_api3_setting_get_spec(&$params) {
+function _civicrm_api3_setting_get_spec(&$params) {
$params['domain_id'] = array(
'api.default' => 'current_domain',
'description' => 'if you do not pass in a domain id this will default to the current domain'
*
* @param array $params parameters as passed to the API
*/
-function civicrm_api3_setting_getvalue_spec(&$params) {
+function _civicrm_api3_setting_getvalue_spec(&$params) {
$params['group'] = array(
'title' => 'Settings Group',
/*
* Converts domain input into an array. If an array is passed in this is used, if 'all' is passed
* in this is converted to 'all arrays'
+ *
+ * Really domain_id should always be set but doing an empty check because at the moment
+ * using crm-editable will pass an id & default won't be applied
+ * we did talk about id being a pseudonym for domain_id in this api so applying it here
*/
function _civicrm_api3_setting_getDomainArray(&$params){
+ if(empty($params['domain_id']) && isset($params['id'])){
+ $params['domain_id'] = $params['id'];
+ }
+
if($params['domain_id'] == 'current_domain'){
$params['domain_id'] = CRM_Core_Config::domainID();
}