You are here

function custom_formatters_insert_styles in Custom Formatters 6

Same name and namespace in other branches
  1. 7.2 includes/insert.inc \custom_formatters_insert_styles()

Implements hook_insert_styles().

File

includes/insert.inc, line 10
Provides Custom Formatters integration with the Insert module.

Code

function custom_formatters_insert_styles() {
  $settings = variable_get('custom_formatters_settings', array(
    'label_prefix' => TRUE,
    'label_prefix_value' => t('Custom'),
  ));
  $formatters = custom_formatters_formatters();
  $insert_styles = array();
  foreach ($formatters as $formatter) {
    if ($formatter->status && !$formatter->multiple && in_array('filefield', unserialize($formatter->field_types))) {
      $label = $settings['label_prefix'] ? "{$settings['label_prefix_value']}: {$formatter->name}" : $formatter->name;
      $insert_styles['custom_formatters_' . $formatter->name] = array(
        'label' => $label,
      );
    }
  }
  return $insert_styles;
}