function _disclaimer_render_image in Disclaimer 7
Build images as link for disclaimer actions.
Parameters
string $key: Button concerned, enter or exit.
Return value
string Html image rendered.
1 call to _disclaimer_render_image()
- _disclaimer_build_content in ./
disclaimer.module - Generate disclaimer content.
File
- ./
disclaimer.module, line 185 - Create and show disclaimer for your site.
Code
function _disclaimer_render_image($key = 'enter') {
$image = '';
if ($key == 'enter') {
$alt = t('ENTER');
}
else {
$alt = t('EXIT');
}
$variables['alt'] = $variables['title'] = variable_get('disclaimer_' . $key . '_img_alt', $alt);
// Get file image.
$file = file_load(variable_get('disclaimer_' . $key . '_img'));
if ($file) {
$variables['path'] = $file->uri;
if (variable_get('disclaimer_' . $key . '_img_style') != "") {
$variables['style_name'] = variable_get('disclaimer_' . $key . '_img_style');
// Avoid php notice.
// $variables['attributes'] = '';
$image = theme('image_style', $variables);
}
else {
$image = theme('image', $variables);
}
}
else {
$image = variable_get('disclaimer_' . $key . '_txt', $alt);
}
return $image;
}