Is it at all feasible to limit the currencies listed in the currency conversion dialog pop-up menu. It would be nice to have a ui to limit the fetch-able currencies for conversion as well as the money field itself.

Currently I find the menu far too long, plus most of the currencies are unlikely ever to be used on the site I'm developing.

Comments

markus_petrux’s picture

The problem I see here is that CCK Field formatters do not have an UI where you can customize things. So we have to find an alternative approach. For example, we could:

a) Introduce a drupal_alter() that allows you to change the currency list used for the conversion dialog.
b) Filter the currencies using the criteria defined in the settings for the money field itself.

The problem I see in b) is that you may wish to enable a set of currencies for the field, but allow users convert to another set of currencies, which is different.

So maybe we can add a) and you can create a custom module that implements hook_money_conversion_dialog_currency_list_alter() where you can filter as you wish. Such a function would look like this:

function mymodule_money_conversion_dialog_currency_list_alter(&$currency_list) {
  // Here you can unset all the currencies that you don't want enabled
  // in the currency conversion dialog.
}
markus_petrux’s picture

Status: Active » Needs review

The patch to implement a) would look like this:

   if ($op == 'currency-list') {
-    return drupal_json(array('currency-list' => currency_api_get_list()));
+    $currency_list = currency_api_get_list();
+    drupal_alter('money_conversion_dialog_currency_list', $currency_list);
+    return drupal_json(array('currency-list' => $currency_list));
   }
markus_petrux’s picture

Status: Needs review » Closed (won't fix)

Won't fix without further feedback because I don't know if proposed solution is enough, and I would prefer not adding stuff without a reason.