function _workspace_get_icon in Workspace 7
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.
1 call to _workspace_get_icon()
- workspace_build_rows in ./
workspace.module - Build the query result into a table, respecting access.
File
- ./
workspace.module, line 835 - Presents a user-centric view of content.
Code
function _workspace_get_icon($name, $url = NULL, $attributes = array(), $extension = 'png') {
if (empty($attributes['alt'])) {
$attributes['alt'] = $attributes['title'];
}
$file_addition = '';
foreach ($attributes as $key => $value) {
$file_addition .= ' ' . $key . '="' . $value . '"';
}
$icon = '<img src="' . base_path() . drupal_get_path('module', 'workspace') . '/images/' . $name . '.' . $extension . '"' . $file_addition . ' />';
if (!empty($url)) {
$icon = l($icon, $url, array(
'html' => TRUE,
));
}
return $icon;
}