You are here

function fitvids_enable in FitVids 6

Same name and namespace in other branches
  1. 7 fitvids.install \fitvids_enable()

Enable the module

File

./fitvids.install, line 36
Install, update and uninstall functions for the Fitvids module.

Code

function fitvids_enable() {
  $installed = file_exists(drupal_get_path('module', 'fitvids') . '/' . PLUGIN_FILENAME);
  if (!$installed) {
    $message = t('You need to download the FitVids.js jQuery plugin to use this module. Download it from !fitvids-site, copy it to the module directory, and rename it to !fitvids-filename.', array(
      '!fitvids-site' => l(t('here'), PLUGIN_URL),
      '!fitvids-filename' => PLUGIN_FILENAME,
    ));
    drupal_set_message(filter_xss_admin($message), $type = 'warning');
  }
  else {
    $message = t('You already have the FitVids.js jQuery plugin installed. Configure the module !fitvids-configuration', array(
      '!fitvids-configuration' => l(t('here'), 'admin/config/media/fitvids'),
    ));
    drupal_set_message(filter_xss_admin($message));
  }
}