Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
f60289e9
Commit
f60289e9
authored
12 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
standardise naming of _spec functions & add support for 'id' as pseudonym of domain_id
parent
f704dce7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/v3/Setting.php
+16
-8
16 additions, 8 deletions
api/v3/Setting.php
with
16 additions
and
8 deletions
api/v3/Setting.php
+
16
−
8
View file @
f60289e9
...
...
@@ -62,7 +62,7 @@ function civicrm_api3_setting_getfields($params) {
);
// 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
);
}
...
...
@@ -72,7 +72,7 @@ function civicrm_api3_setting_getfields($params) {
/*
* 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'
);
...
...
@@ -109,7 +109,7 @@ function civicrm_api3_setting_getdefaults(&$params){
*
* @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
...
...
@@ -140,7 +140,7 @@ function civicrm_api3_setting_revert(&$params){
/*
* 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
(
...
...
@@ -173,7 +173,7 @@ function civicrm_api3_setting_fill(&$params){
/*
* 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
(
...
...
@@ -204,7 +204,7 @@ function civicrm_api3_setting_create($params) {
*
* @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
...
...
@@ -236,7 +236,7 @@ function civicrm_api3_setting_get($params) {
*
* @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'
...
...
@@ -277,7 +277,7 @@ function civicrm_api3_setting_getvalue($params) {
*
* @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'
,
...
...
@@ -303,8 +303,16 @@ function civicrm_api3_setting_getvalue_spec(&$params) {
/*
* 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
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment