You are here

function theme_imagefield_crop_preset_list in Imagefield Crop 7.3

Implements theme_imagefield_crop_preset_list(). Used to show all presets as table.

Parameters

$variables:

Return value

string

1 theme call to theme_imagefield_crop_preset_list()
imagefield_crop_preset_list in ./imagefield_crop.module
Implements menu callback imagefield_crop_preset_list().

File

theme/theme.inc, line 61

Code

function theme_imagefield_crop_preset_list($variables) {
  $presets = $variables['presets'];
  $header = array(
    t('Preset name'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $rows = array();
  foreach ($presets as $pid => $name) {
    if ($name == 'Free crop') {
      continue;
    }
    $row = array();
    $row[] = l($name, 'admin/config/media/imagefield-crop-preset-list/' . $pid . '/edit');
    $row[] = l('edit', 'admin/config/media/imagefield-crop-preset-list/' . $pid . '/edit');
    $row[] = l('delete', 'admin/config/media/imagefield-crop-preset-list/' . $pid . '/delete');
    $rows[] = $row;
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'colspan' => 4,
        'data' => t('There are currently no presets . <a href="!url">Add a new one</a>.', array(
          '!url' => url('admin/config/media/imagefield-crop-preset-list/add'),
        )),
      ),
    );
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}