抱歉,英文太差,因为项目需要新增了两个显示模式,针对 imceimage.module 文件修改的代码如下:
function imceimage_field_formatter_info() {
$formatters = array(
'default' => array(
'label' => 'Default',
'field types' => array('imceimage'),
'multiple values' => CONTENT_HANDLE_CORE,
),
'with_caption' => array(
'label' => 'With caption',
'field types' => array('imceimage'),
'multiple values' => CONTENT_HANDLE_CORE,
),
'link' => array(
'label' => 'Link',
'field types' => array('imceimage'),
'multiple values' => CONTENT_HANDLE_CORE,
),
'thumb' => array(
'label' => 'Thumbnail',
'field types' => array('imceimage'),
'multiple values' => CONTENT_HANDLE_CORE,
),
'thumblink' => array(
'label' => 'ThumbLink',
'field types' => array('imceimage'),
'multiple values' => CONTENT_HANDLE_CORE,
),
'thumblink_caption' => array(
'label' => 'ThumbLink Caption',
'field types' => array('imceimage'),
'multiple values' => CONTENT_HANDLE_CORE,
),
);
/**
* Loocor@live.com, displays the thumb with a link.
**/
function theme_imceimage_formatter_thumblink($element) {
$item = $element['#item'];
$field = $element['#field_name'];
$delta = $element['#delta'];
$id = "imceimage-". $field ."-". $delta . '-thumb';
$thumb = _imceimage_get_thumb($item);
return '<a href="' . $item['imceimage_path'] .'" class="imceimage-link">' . theme_imceimage_image($thumb['imceimage_path'], $thumb['imceimage_width'],$thumb['imceimage_height'],$thumb['imceimage_alt'],$id) . '</a>';
}
/**
* Loocor@live.com, displays the thumb with a link and caption.
**/
function theme_imceimage_formatter_thumblink_caption($element) {
$item = $element['#item'];
$field = $element['#field_name'];
$delta = $element['#delta'];
$id = "imceimage-". $field ."-". $delta . '-thumb';
$thumb = _imceimage_get_thumb($item);
$caption = $item['imceimage_alt'];
return "<div class='image-with-caption'><div class='image'>" . '<a href="' . $item['imceimage_path'] .'" class="imceimage-link">' . theme_imceimage_image($thumb['imceimage_path'], $thumb['imceimage_width'],$thumb['imceimage_height'],$thumb['imceimage_alt'],$id) . '</a>' ."</div><div class='caption' style='font-style:italic'>". $caption ."</div></div>";
}
因为不熟悉patch,请朋友帮忙处理一下。
Comments
Comment #1
scuba_flyThis is spam?