You are here

function auto_height_enable in jQuery Auto Height 7.2

Same name and namespace in other branches
  1. 7 auto_height.install \auto_height_enable()

Enable the module

File

./auto_height.install, line 43
Install, update and uninstall functions for the 'jQuery Auto Height' module.

Code

function auto_height_enable() {
  $path = libraries_get_path('autoheight') . '/jquery.autoheight.js';
  $installed = file_exists($path);
  if (!$installed) {
    $message = t('Require the jQuery AutoHeight plugin to use this module. Download it from !autoheight-url and place it to the sites/all/libraries/autoheight directory i.e. sites/all/libraries/autoheight/!autoheight-filename.', array(
      '!autoheight-url' => l(t('here'), AUTOHEIGHT_PLUGIN_URL),
      '!autoheight-filename' => AUTOHEIGHT_PLUGIN_FILENAME,
    ));
    drupal_set_message(filter_xss_admin($message), $type = 'warning');
  }
  else {
    $message = t('You have the jQuery AutoHeight plugin installed. Configure the module !autoheight-configuration', array(
      '!autoheight-configuration' => l(t('here'), 'admin/config/media/auto_height'),
    ));
    drupal_set_message(filter_xss_admin($message));
  }
}