image_style_options

Versions
7
image_style_options($include_empty = TRUE)

Get an array of image styles suitable for using as select list options.

Parameters

$include_empty If TRUE a <none> option will be inserted in the options array.

Return value

Array of image styles both key and value are set to style name.

▾ 3 functions call image_style_options()

image_field_widget_settings_form in modules/image/image.field.inc
Implements hook_field_widget_settings_form().
image_style_delete_form in modules/image/image.admin.inc
Form builder; Form for deleting an image style.
user_admin_settings in modules/user/user.admin.inc
Form builder; Configure user settings for this site.

Code

modules/image/image.module, line 563

<?php
function image_style_options($include_empty = TRUE) {
  $styles = image_styles();
  $options = array();
  if ($include_empty && !empty($styles)) {
    $options[''] = t('<none>');
  }
  $options = array_merge($options, drupal_map_assoc(array_keys($styles)));
  if (empty($options)) {
    $options[''] = t('No defined styles');
  }
  return $options;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.