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

Enable the module

File

./fitvids.install, line 49

Code

function fitvids_enable() {
    $path = libraries_get_path('fitvids') . '/jquery.fitvids.js';
    $installed = file_exists($path);
    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 !fitvids-library directory, and rename it to !fitvids-filename.', array(
            '!fitvids-site' => l(t('here'), FITVIDS_PLUGIN_URL),
            '!fitvids-library' => libraries_get_path('fitvids'),
            '!fitvids-filename' => FITVIDS_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));
    }
}