You are here

function commerce_userpoints_currencies_page in Commerce userpoints 7

Page callback for setting up userpoints currencies.

1 string reference to 'commerce_userpoints_currencies_page'
commerce_userpoints_menu in ./commerce_userpoints.module
Implements hook_menu().

File

./commerce_userpoints.admin.inc, line 10
Administration page callbacks for the commerce_userpoints module.

Code

function commerce_userpoints_currencies_page() {
  $currencies = commerce_userpoints_currencies();
  $categories = userpoints_get_categories();
  $header = array(
    t('Name'),
    t('Category'),
    t('Code'),
    t('Symbol'),
    t('Operations'),
  );
  $rows = array();
  foreach ($currencies as $currency) {
    $rows[] = array(
      $currency['name'],
      $categories[$currency['tid']],
      $currency['code'],
      $currency['symbol'],
      l(t('edit'), 'admin/commerce/config/currency/userpoints/edit/' . $currency['code'], array(
        'query' => drupal_get_destination(),
      )) . ' ' . l(t('delete'), 'admin/commerce/config/currency/userpoints/delete/' . $currency['code'], array(
        'query' => drupal_get_destination(),
      )),
    );
  }
  return array(
    '#theme' => 'table',
    '#rows' => $rows,
    '#header' => $header,
    '#empty' => t('No !point currencies have been set up.', userpoints_translation()),
  );
}