You are here

function uc_store_get_icon in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_store/uc_store.module \uc_store_get_icon()
  2. 7.3 uc_store/uc_store.module \uc_store_get_icon()

Return the IMG tag for a store icon.

Parameters

$path: The Drupal path of the menu item. Atlernately may specify a filename by passing this string as file:filename.png.

$small: Pass TRUE to get a link to the small version of the icon. If specifying a filename, you should let this be FALSE.

Return value

HTML output for the image.

9 calls to uc_store_get_icon()
theme_uc_admin_dashboard in uc_store/uc_store.module
theme_uc_settings_overview in uc_store/uc_store.module
Theme an array of settings information into a pretty little table.
theme_uc_store_block_links in uc_store/uc_store.module
uc_order_create in uc_order/uc_order.module
Create a new order and redirect to its edit screen.
uc_order_view in uc_order/uc_order.module
Display the order view screen, constructed via hook_order_pane().

... See full list

File

uc_store/uc_store.module, line 1806
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_get_icon($path, $small = FALSE, $class = 'uc-store-icon', $alt = NULL) {
  $file = FALSE;
  switch ($path) {
    case 'admin/store':
      $file = 'store_monitor';
      break;
    case 'admin/store/orders':
      $file = 'menu_orders';
      break;
    case 'admin/store/customers':
      $file = 'menu_customers';
      break;
    case 'admin/store/products':
      $file = 'menu_products';
      break;
    case 'admin/store/reports':
      $file = 'menu_reports';
      break;
    case 'admin/store/settings':
      $file = 'menu_store_settings';
      break;
    case 'admin/store/help':
      $file = 'menu_help';
      break;
  }
  if (substr($path, 0, 5) == 'file:') {
    $file = substr($path, 5);
  }
  if (!$file) {

    // See if it's hooked in anywhere else...
    return '';
  }
  if ($small) {
    $file .= '_small';
  }
  $alt = ' alt="' . (string) $alt . '"';
  $output = '<img src="' . base_path() . drupal_get_path('module', 'uc_store') . '/images/' . $file . '.gif" class="' . $class . '"' . $alt . ' />';
  return $output;
}