You are here

function lightbox2_insert_styles in Lightbox2 8

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

Implementation of hook_insert_styles().

File

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

Code

function lightbox2_insert_styles() {
  $cck_formatters = lightbox2_field_formatter_info();
  $insert_styles = array();

  // Reformat CCK formatter ids as Insert style ids.
  foreach ($cck_formatters as $formatter_id => $formatter_info) {

    // Currently only the "imagefield--lightbox2" formatters are implemented as styles.
    if (preg_match('/^imagefield__lightbox2__((?:_(?!_)|[^_])+)__((?:_(?!_)|[^_])+)$/', $formatter_id, $matches)) {
      $style_id = 'lightbox2--' . $matches[1] . '--' . $matches[2];
      $insert_styles[$style_id] = $formatter_info;
    }
  }
  return $insert_styles;
}