jquery_touchpunch.install in jQuery UI Touch Punch 7
Intallation hooks.
File
jquery_touchpunch.installView source
<?php
/**
* @file
* Intallation hooks.
*/
/**
* Implements hook_requirements().
*/
function jquery_touchpunch_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$t = get_t();
$library = libraries_detect('jquery.ui.touch-punch');
$error_type = isset($library['error']) ? drupal_ucfirst($library['error']) : '';
$error_message = isset($library['error message']) ? $library['error message'] : '';
if ($library['installed']) {
$description = $t('Installed variants') . ' : ';
foreach ($library['variants'] as $variant_name => $variant) {
if ($variant['installed']) {
$description .= $variant_name . ', ';
}
}
$requirements['jquery.ui.touch-punch'] = array(
'title' => $t('jQuery UI Touch Punch'),
'value' => $library['version'],
'severity' => REQUIREMENT_OK,
'description' => substr($description, 0, -2),
);
}
else {
$requirements['jquery.ui.touch-punch'] = array(
'title' => $t('jQuery UI Touch Punch'),
'value' => $t('@e', array(
'@e' => $error_type,
)),
'severity' => REQUIREMENT_ERROR,
'description' => jquery_touchpunch_error_message($error_message, $library),
);
}
}
return $requirements;
}
Functions
Name![]() |
Description |
---|---|
jquery_touchpunch_requirements | Implements hook_requirements(). |