You are here

function lightbox2_insert_content in Lightbox2 7

Same name and namespace in other branches
  1. 8 lightbox2.insert.inc \lightbox2_insert_content()
  2. 6 lightbox2.insert.inc \lightbox2_insert_content()
  3. 7.2 lightbox2.insert.inc \lightbox2_insert_content()

Implementation of hook_insert_content().

File

./lightbox2.insert.inc, line 29
Lightbox2 support for Insert module.

Code

function lightbox2_insert_content($item, $style, $widget) {
  if (preg_match('/^lightbox2--((?:-(?!-)|[^-])+)--((?:-(?!-)|[^-])+)$/', $style['name'], $matches)) {
    $image_preset_name = $matches[1];
    $link_preset_name = $matches[2];
    return theme('lightbox2_insert_image', $item, $widget, 'view', $image_preset_name, $link_preset_name);
  }
  else {
    return '';
  }
}