You are here

function theme_presettabs in Image javascript crop 5

Same name and namespace in other branches
  1. 6 imagecrop.module \theme_presettabs()

Theme preset tabs

Parameters

$tabs array of available presets:

fid file id:

$presetid preset to highlight:

Return value

$output html of the tabs

1 theme call to theme_presettabs()
imagecrop_showcrop in ./imagecrop.module
Show the cropped image.

File

./imagecrop.module, line 611
Provides a javascript toolbox through an imagecache action.

Code

function theme_presettabs($presets, $fid, $presetid, $module = '') {
  $tab_output = '';
  foreach ($presets['tabs'] as $key => $value) {
    $class = $value['id'] == $presetid ? 'imagecrop_tab imagecrop_highlight' : 'imagecrop_tab ';
    $url = 'imagecrop/showcrop/' . $fid . '/' . $value['id'] . $module;
    $tab_output .= '<span class="' . $class . '">' . l($value['name'], $url) . '</span>';
  }
  $output = '<div id="imagecrop_presettabs">' . t('Imagecache presets &raquo;') . ' ' . $tab_output . '</div>';
  return $output;
}