You are here

function auto_height_form in jQuery Auto Height 7

Same name and namespace in other branches
  1. 7.2 auto_height.module \auto_height_form()

Configuraton form, called by drupal_get_form() in auto_height_menu().

1 string reference to 'auto_height_form'
auto_height_menu in ./auto_height.module
Implements hook_menu().

File

./auto_height.module, line 56
Provides dynamic adjustment of column heights, matching the biggest column in each Row.

Code

function auto_height_form($form, &$form_state) {

  // Is the library installed?
  $path = libraries_get_path('autoheight') . '/jquery.autoheight.js';

  // if required, use plugin packaged with the module.
  $installed = file_exists($path);
  if (!$installed) {
    $message = t('You need to download the jQuery AutoHeight plugin to use this module. Download it from !autoheight-site and copy it to !autoheight-library/!autoheight-filename.', array(
      '!autoheight-site' => l(t('here'), AUTOHEIGHT_PLUGIN_URL),
      '!autoheight-library' => libraries_get_path('autoheight'),
      '!autoheight-filename' => AUTOHEIGHT_PLUGIN_FILENAME,
    ));
    drupal_set_message(filter_xss_admin($message), $type = 'warning');
  }
  $form['auto_height_intro'] = array(
    '#markup' => '<p>jQuery Auto Height module dynamically adjust column heights, matching the biggest column in each Row.</p>',
  );
  $form['auto_height_selectors'] = array(
    '#type' => 'textarea',
    '#title' => t('jQuery Class Selectors'),
    '#default_value' => variable_get('autoheight_selectors', AUTOHEIGHT_DEFAULT_SELECTOR),
    '#rows' => 3,
    '#description' => t('Enter jQuery class selectors for your row column elements e.g., ".classname". Use a new line for each selector.'),
    '#required' => TRUE,
  );
  return system_settings_form($form);
}