function _imagepicker_get_icon in Image Picker 7
Same name and namespace in other branches
- 6.2 imagepicker.functions.inc \_imagepicker_get_icon()
Function to get an icon Derived from invoice module
Parameters
string $name: Name of icon without extension.
string $url: URL to link the icon to.
array $attributes: Any optional HTML attributes.
string $extension: The file extension.
Return value
The icon string.
3 calls to _imagepicker_get_icon()
File
- ./
imagepicker.functions.inc, line 2960 - @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
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;
}