function theme_image_style_list

Returns HTML for the page containing the list of image styles.

Parameters

$variables: An associative array containing:

  • styles: An array of all the image styles returned by image_get_styles().

See also

image_get_styles()

Related topics

1 theme call to theme_image_style_list()
image_style_list in drupal/core/modules/image/image.admin.inc
Menu callback; Listing of all current image styles.

File

drupal/core/modules/image/image.admin.inc, line 511
Administration pages for image settings.

Code

function theme_image_style_list($variables) {
  $styles = $variables['styles'];
  $header = array(
    t('Style name'),
    t('Operations'),
  );
  $rows = array();
  foreach ($styles as $style) {
    $row = array();
    $row[] = l($style
      ->label(), 'admin/config/media/image-styles/manage/' . $style
      ->id());
    $links = array();
    $links['edit'] = array(
      'title' => t('edit'),
      'href' => 'admin/config/media/image-styles/manage/' . $style
        ->id(),
      'class' => array(
        'image-style-link',
      ),
    );
    $links['delete'] = array(
      'title' => t('delete'),
      'href' => 'admin/config/media/image-styles/manage/' . $style
        ->id() . '/delete',
      'class' => array(
        'image-style-link',
      ),
    );
    $row[] = array(
      'data' => array(
        '#type' => 'operations',
        '#links' => $links,
      ),
    );
    $rows[] = $row;
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'colspan' => 4,
        'data' => t('There are currently no styles. <a href="!url">Add a new one</a>.', array(
          '!url' => url('admin/config/media/image-styles/add'),
        )),
      ),
    );
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}