Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rosettabooks_imagecache_formatter_gridshadow_linked($element) {
- // Inside a view $element may contain NULL data. In that case, just return.
- if (empty($element['#item']['fid'])) {
- return '';
- }
- // Extract the preset name from the formatter name.
- $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter']
- , '_'));
- $style = 'linked';
- $item = $element['#item'];
- $item['data']['alt'] = isset($item['data']['alt']) ? $item['data']['alt'] : '';
- $item['data']['title'] = isset($item['data']['title']) ? $item['data']['title'] : NULL;
- if ( !empty( $element['#node']->title) ) {
- $item['data']['alt'] = check_plain($element['#node']->title);
- $item['data']['title'] = check_plain($element['#node']->title);
- }else{
- $item['data']['alt'] = check_plain($element['#node']->node_title);
- $item['data']['title'] = check_plain($element['#node']->node_title);
- }
- $imagetag = theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title']);
- $path = empty($item['nid']) ? '' : 'node/'. $item['nid'];
- $class = "imagecache imagecache-$presetname imagecache-$style imagecache-{$element['#formatter']}";
- return l($imagetag, $path, array('attributes' => array('class' => $class), 'html' => TRUE));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement