Skip navigation
Help

theme_uc_cart_block_title

6 uc_cart.module theme_uc_cart_block_title($title, $icon_class = 'cart-empty', $collapsible = TRUE)
7 uc_cart.theme.inc theme_uc_cart_block_title($variables)

Themes the shopping cart block title.

Parameters

$variables: An associative array containing:

  • title: The text to use for the title of the block.
  • icon_class: Class to use for the cart icon image or FALSE if the icon is disabled.
  • collapsible: TRUE or FALSE indicating whether or not the cart block is collapsible.
  • collapsed: TRUE or FALSE indicating whether or not the cart block is collapsed.

Return value

string The HTML output.

Related topics

1 theme call to theme_uc_cart_block_title()

File

ubercart/uc_cart/uc_cart.theme.inc, line 26
Theme functions for the uc_cart module.

Code

function theme_uc_cart_block_title($variables) {
  $title = $variables['title'];
  $icon_class = $variables['icon_class'];
  $collapsible = $variables['collapsible'];
  $collapsed = $variables['collapsed'];

  $output = '';

  // Add in the cart image if specified.
  if ($icon_class) {
    $output .= theme('uc_cart_block_title_icon', array('icon_class' => $icon_class));
  }

  // Add the main title span and text, with or without the arrow based on the
  // cart block collapsibility settings.
  if ($collapsible) {
    $output .= '<span class="cart-block-title-bar" title="' . t('Show/hide shopping cart contents.') . '">' . $title;
    if ($collapsed) {
      $output .= '<span class="cart-block-arrow arrow-down"></span>';
    }
    else {
      $output .= '<span class="cart-block-arrow"></span>';
    }
    $output .= '</span>';
  }
  else {
    $output .= '<span class="cart-block-title-bar">' . $title . '</span>';
  }

  return $output;
}