You are here

function _money_parse_currencies in Money field 5

Parse currency codes from a comma-separated list.

Parameters

$currencies_string: A string containing a list of currency codes, separated by commas. If the string is empty, all currencies will be returned.

Return value

An array of currency code.

3 calls to _money_parse_currencies()
money_field in ./money.module
Implementation of hook_field().
money_field_settings in ./money.module
Implementation of hook_field_settings().
money_widget in ./money.module
Implementation of hook_widget().

File

./money.module, line 462
This module defines the "money" CCK field. It uses the Currency API, which is included in the Currency module, to get a list of valid currencies.

Code

function _money_parse_currencies($currencies_string) {
  return empty($currencies_string) ? array_keys(currency_api_get_list()) : explode(',', str_replace(' ', '', trim($currencies_string)));
}