You are here

function theme_image_resize_filter_form in Image Resize Filter 6

Same name and namespace in other branches
  1. 7 image_resize_filter.module \theme_image_resize_filter_form()

Theme callback to theme the Image Resize Filter form.

1 theme call to theme_image_resize_filter_form()
image_resize_filter_form in ./image_resize_filter.module
The form for configuring the Image Resize Filter.

File

./image_resize_filter.module, line 190
image_resize_filter.module

Code

function theme_image_resize_filter_form($form) {
  $format = $form['#format'];
  $link = 'image_resize_filter_link_' . $format;
  $class = 'image_resize_filter_link_class_' . $format;
  $rel = 'image_resize_filter_link_rel_' . $format;
  $class_element = ' ';
  $class_element .= '<span class="image-resize-filter-class">';
  $class_element .= check_plain($form[$class]['#title']) . ': ';
  $form[$class]['#title'] = NULL;
  $class_element .= drupal_render($form[$class]);
  $class_element .= '</span>';
  $rel_element = ' ';
  $rel_element .= '<span class="image-resize-filter-rel">';
  $rel_element .= check_plain($form[$rel]['#title']) . ': ';
  $form[$rel]['#title'] = NULL;
  $rel_element .= drupal_render($form[$rel]);
  $rel_element .= '</span>';
  $link_element = drupal_render($form[$link]);
  $output = '';
  $output .= '<div class="container-inline image-resize-filter-link-options">';
  $output .= $link_element;
  $output .= $class_element;
  $output .= $rel_element;
  $output .= '</div>';
  $placeholder = array(
    '#type' => 'element',
    '#title' => t('Link to the original'),
    '#children' => $output,
    '#description' => t('Linking to the original can be helpful to give users a full-size view of the image. Adding the class "thickbox" is helpful if you have installed the <a href="http://drupal.org/project/thickbox">thickbox module</a>. The rel attribute may be useful when used with the <a href="http://drupal.org/project/lightbox2">lightbox2</a> and <a href="http://drupal.org/project/shadowbox">shadowbox</a> modules.'),
  );

  // Add a little bit of JavaScript. Not cached since it's only used here.
  drupal_add_js(drupal_get_path('module', 'image_resize_filter') . '/image_resize_filter.js', 'module', 'header', FALSE, FALSE);
  return drupal_render($form) . theme('form_element', $placeholder, $output);
}