function _imagepicker_get_icon in Image Picker 6.2
Same name and namespace in other branches
- 7 imagepicker.functions.inc \_imagepicker_get_icon()
Function to get an icon Derived from invoice module
Parameters
$name: Name of icon without extension.
$url: URL to link the icon to.
$attributes: Any optional HTML attributes.
$extension: The file extension.
Return value
The icon string.
3 calls to _imagepicker_get_icon()
- imagepicker_admin_groups_list in ./
imagepicker.admin.inc - imagepicker_browse_admin_form in ./
imagepicker.functions.inc - list of images with bulk operations
- imagepicker_groups_list in ./
imagepicker.group.inc
File
- ./
imagepicker.functions.inc, line 2878 - Imagepicker functions
Code
function _imagepicker_get_icon($name, $url = NULL, $attributes = array(), $extension = 'png') {
if (empty($attributes['alt'])) {
$attributes['alt'] = $attributes['title'];
}
$img_addition = '';
foreach ($attributes as $key => $value) {
$img_addition .= ' ' . $key . '="' . $value . '"';
}
$icon = '<img src="' . base_path() . drupal_get_path('module', 'imagepicker') . '/images/' . $name . '.' . $extension . '"' . $img_addition . ' />';
if (!empty($url)) {
$icon = l($icon, $url, array(
'html' => TRUE,
));
}
return $icon;
}