function uc_store_get_icon in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_store/uc_store.module \uc_store_get_icon()
- 7.3 uc_store/uc_store.module \uc_store_get_icon()
Returns 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.
7 calls to uc_store_get_icon()
- theme_uc_admin_dashboard in uc_store/
uc_store.module - Themes the dashboard on the admin/store page.
- uc_order_create in uc_order/
uc_order.admin.inc - Creates a new order and redirect to its edit screen.
- uc_order_view in uc_order/
uc_order.admin.inc - Displays the order view screen, constructed via hook_order_pane().
- uc_select_address in uc_store/
uc_store.module - Creates an address select box based on a user's previous orders.
- uc_shipping_select_address in shipping/
uc_shipping/ uc_shipping.module - Choose an address to fill out a form.
File
- uc_store/
uc_store.module, line 882 - 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;
}