slider_pro.install in Slider Pro 7
Same filename and directory in other branches
Installation file for Silder Pro module.
File
slider_pro.installView source
<?php
/**
* @file
* Installation file for Silder Pro module.
*/
/**
* Implements hook_requirements().
*/
function slider_pro_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'runtime') {
$requirements['slider_pro']['title'] = 'Slider Pro';
$requirements['slider_pro']['value'] = $t('Installed');
if (module_exists('libraries') && file_exists(libraries_get_path('slider-pro') . '/dist/js/jquery.sliderPro.min.js')) {
$requirements['slider_pro']['severity'] = REQUIREMENT_OK;
}
else {
// Required slider pro library wasn't found; abort installation.
$requirements['slider_pro']['value'] = $t('Not found');
// Provide a download link to the Slider Pro jQuery plugin.
$requirements['slider_pro']['description'] = $t('The <a href="!sliderpro">Slider Pro</a> jQuery plugin is missing. See !readme for instructions on how to download and extract it.', array(
'!sliderpro' => 'http://bqworks.com/slider-pro/',
'!readme' => l($t('README.txt'), drupal_get_path('module', 'slider_pro') . "/README.txt"),
));
$requirements['slider_pro']['severity'] = REQUIREMENT_ERROR;
}
}
return $requirements;
}
Functions
Name | Description |
---|---|
slider_pro_requirements | Implements hook_requirements(). |