X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FConstant.php;h=9b4d1c225a255b08d1336f390c8090e7bf180588;hb=23e35f75793a63e1c50249d322bcf1f2439415f8;hp=93fcfcb68f9a054f739aec73c1c41f301945956e;hpb=26fc48f2ee0e38ce6caabe411a403137478d642c;p=civicrm-core.git diff --git a/api/v3/Constant.php b/api/v3/Constant.php index 93fcfcb68f..9b4d1c225a 100644 --- a/api/v3/Constant.php +++ b/api/v3/Constant.php @@ -36,6 +36,14 @@ * @version $Id: Constant.php 30171 2010-10-14 09:11:27Z mover $ */ +/** + * @deprecated api notice + * @return string to indicate this entire api entity is deprecated + */ +function _civicrm_api3_constant_deprecation() { + return 'The constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.'; +} + /** * @deprecated as of CiviCRM 4.4. * It's recommended to use the api getoptions action instead @@ -117,68 +125,70 @@ function civicrm_api3_constant_get($params) { //@TODO XAV take out the param the COOKIE, Entity, Action and so there are only the "real param" in it //$values = call_user_func_array( array( $className, $name ), $params ); } - return civicrm_api3_create_success($values, $params); + return civicrm_api3_create_success($values, $params, 'constant'); } else{ $values = call_user_func(array('CRM_Utils_PseudoConstant', 'getConstant'), $name); if(!empty($values)){ - return civicrm_api3_create_success($values, $params); + return civicrm_api3_create_success($values, $params, 'constant'); } } return civicrm_api3_create_error('Unknown civicrm constant or method not callable'); } /** - * @param $params + * @param array $params */ function _civicrm_api3_constant_get_spec(&$params) { - + $options = array( + 'activityStatus', + 'activityType', + 'addressee', + 'allGroup', + 'country', + 'countryIsoCode', + 'county', + 'currencyCode', + 'currencySymbols', + 'customGroup', + 'emailGreeting', + 'fromEmailAddress', + 'gender', + 'group', + 'groupIterator', + 'honor', + 'IMProvider', + 'individualPrefix', + 'individualSuffix', + 'locationType', + 'locationVcardName', + 'mailProtocol', + 'mappingTypes', + 'paymentInstrument', + 'paymentProcessor', + 'paymentProcessorType', + 'pcm', + 'phoneType', + 'postalGreeting', + 'priority', + 'relationshipType', + 'stateProvince', + 'stateProvinceAbbreviation', + 'stateProvinceForCountry', + 'staticGroup', + 'tag', + 'tasks', + 'ufGroup', + 'visibility', + 'worldRegion', + 'wysiwygEditor', + ); $params = (array ('name' => array( 'title' => 'Constant Name', + 'name' => 'name', 'api.required' => 1, - 'options' => - 'activityStatus', - 'activityType', - 'addressee', - 'allGroup', - 'country', - 'countryIsoCode', - 'county', - 'currencyCode', - 'currencySymbols', - 'customGroup', - 'emailGreeting', - 'fromEmailAddress', - 'gender', - 'group', - 'groupIterator', - 'honor', - 'IMProvider', - 'individualPrefix', - 'individualSuffix', - 'locationType', - 'locationVcardName', - 'mailProtocol', - 'mappingTypes', - 'paymentInstrument', - 'paymentProcessor', - 'paymentProcessorType', - 'pcm', - 'phoneType', - 'postalGreeting', - 'priority', - 'relationshipType', - 'stateProvince', - 'stateProvinceAbbreviation', - 'stateProvinceForCountry', - 'staticGroup', - 'tag', - 'tasks', - 'ufGroup', - 'visibility', - 'worldRegion', - 'wysiwygEditor', + 'options' => array_combine($options, $options) )) ); }