uc_ups.theme.inc 1010 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @file
  4. * Theme functions for the uc_ups module.
  5. */
  6. /**
  7. * Theme function to format the UPS service name and rate amount line-item
  8. * shown to the customer.
  9. *
  10. * @param $variables
  11. * Associative array containing information needed to theme a quote.
  12. * Contains two keys:
  13. * - service: The UPS service name.
  14. * - packages: Package information.
  15. *
  16. * @ingroup themeable
  17. */
  18. function theme_uc_ups_option_label($variables) {
  19. $service = $variables['service'];
  20. $packages = $variables['packages'];
  21. // Start with logo as required by the UPS terms of service.
  22. $output = theme('image', array(
  23. 'path' => drupal_get_path('module', 'uc_ups') . '/uc_ups_logo.gif',
  24. 'alt' => t('UPS logo'),
  25. 'attributes' => array('class' => 'ups-logo')
  26. ));
  27. // Add the UPS service name.
  28. $output .= t('@service Rate', array('@service' => $service));
  29. // Add package information
  30. $output .= ' (' . format_plural(count($packages), '1 package', '@count packages') . ')';
  31. return $output;
  32. }