You are here

function insert_insert_styles in Insert 8.2

Same name and namespace in other branches
  1. 6 includes/insert.inc \insert_insert_styles()
  2. 7 includes/insert.inc \insert_insert_styles()

Implements hook_insert_styles().

File

./insert.module, line 754

Code

function insert_insert_styles($insertType) {
  if ($insertType !== INSERT_TYPE_FILE && $insertType !== INSERT_TYPE_IMAGE) {
    return [];
  }
  $stylesList = [];
  $stylesList['insert__auto'] = [
    'label' => t('AUTOMATIC'),
    'weight' => -40,
  ];
  if ($insertType !== INSERT_TYPE_FILE) {

    /* @var ImageStyle $style */
    foreach (ImageStyle::loadMultiple() as $style) {
      $stylesList[$style
        ->getName()] = $style;
    }
    $stylesList['image'] = [
      'label' => t('Original image'),
      'weight' => -15,
    ];
  }
  $stylesList['link'] = [
    'label' => t('Link to file'),
    'weight' => -20,
  ];
  $stylesList['icon_link'] = [
    'label' => t('Link to file (with icon)'),
    'weight' => -19,
  ];
  $stylesList['audio'] = [
    'label' => t('Embed audio'),
    'weight' => -10,
  ];
  $stylesList['video'] = [
    'label' => t('Embed video'),
    'weight' => -9,
  ];
  return $stylesList;
}