Commit 4712f7f0 authored by frjo's avatar frjo
Browse files

#768624: Add basic support for the Insert module.

parent 647f0ebd
......@@ -239,3 +239,32 @@ function colorbox_field_formatter_info() {
return $formatters;
}
/**
* Implementation of hook_insert_styles().
*/
function colorbox_insert_styles() {
$insert_styles = array();
$insert_styles = colorbox_field_formatter_info();
return $insert_styles;
}
/**
* Implementation of hook_insert_content().
*/
function colorbox_insert_content($item, $style, $widget) {
// If the title is empty use description or alt.
if (empty($item['data']['title'])) {
if (!empty($item['data']['description'])) {
$item['data']['title'] = $item['data']['description'];
}
elseif (!empty($item['data']['alt'])) {
$item['data']['title'] = $item['data']['alt'];
}
}
list($namespace, $modulename) = explode('__', $style['name'], 2);
return theme('colorbox_imagefield', $namespace, $item['filepath'], $item['data']['alt'], $item['data']['title'], 'insert-'. $item['fid'], 'insert');
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment