uc_quote.theme.inc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @file
  4. * Theme functions for the uc_quote module.
  5. */
  6. /**
  7. * Displays the formatted quote cart pane.
  8. *
  9. * @param $variables
  10. * An associative array containing:
  11. * - form: A render element representing the form.
  12. *
  13. * @ingroup themeable
  14. */
  15. function theme_uc_cart_pane_quotes($variables) {
  16. $form = $variables['form'];
  17. $output = '<p class="quote-title">' . t('Estimated shipping cost:') . '</p>';
  18. $output .= drupal_render_children($form);
  19. return $output;
  20. }
  21. /**
  22. * Displays the returned shipping rates.
  23. *
  24. * @param $variables
  25. * An associative array containing:
  26. * - form: A render element representing the form.
  27. *
  28. * @ingroup themeable
  29. */
  30. function theme_uc_quote_returned_rates($variables) {
  31. $form = $variables['form'];
  32. $output = '';
  33. $keys = element_children($form);
  34. // Render notes and error messages after each radio button.
  35. if (count($keys) > 1) {
  36. foreach ($keys as $key) {
  37. if ($key == 'quote_option') {
  38. continue;
  39. }
  40. if (isset($form['quote_option'][$key])) {
  41. $output .= drupal_render($form['quote_option'][$key]);
  42. }
  43. $output .= drupal_render($form[$key]);
  44. }
  45. }
  46. $output .= drupal_render_children($form);
  47. return $output;
  48. }