Commit 8ba01e89 authored by frjo's avatar frjo
Browse files

Issue #1970622 by frjo: Improve requirements messages.

parent 84099de7
......@@ -14,13 +14,15 @@ function colorbox_requirements($phase) {
if ($phase == 'runtime') {
$t = get_t();
$library = libraries_detect('colorbox');
$error_type = isset($library['error']) ? drupal_ucfirst($library['error']) : '';
$error_message = isset($library['error message']) ? $library['error message'] : '';
if (empty($library['installed'])) {
$requirements['colorbox_plugin'] = array(
'title' => $t('Colorbox plugin'),
'value' => $t('At least @a', array('@a' => COLORBOX_MIN_PLUGIN_VERSION)),
'value' => $t('@e: At least @a', array('@e' => $error_type, '@a' => COLORBOX_MIN_PLUGIN_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => $t('You need to download the !colorbox, extract the archive and place the colorbox directory in the %path directory on your server.', array('!colorbox' => l($t('Colorbox plugin'), $library['download url']), '%path' => 'sites/all/libraries')),
'description' => $t('!error You need to download the !colorbox, extract the archive and place the colorbox directory in the %path directory on your server.', array('!error' => $error_message, '!colorbox' => l($t('Colorbox plugin'), $library['download url']), '%path' => 'sites/all/libraries')),
);
}
elseif (version_compare($library['version'], COLORBOX_MIN_PLUGIN_VERSION, '>=')) {
......
......@@ -77,7 +77,7 @@ function colorbox_libraries_info() {
$libraries['colorbox'] = array(
'name' => 'Colorbox plugin',
'vendor url' => 'http://www.jacklmoore.com/colorbox',
'download url' => 'http://www.jacklmoore.com/colorbox',
'download url' => 'https://github.com/jackmoore/colorbox/archive/1.x.zip',
'version arguments' => array(
'file' => 'jquery.colorbox-min.js',
'pattern' => '@(?i:Colorbox) v([0-9\.a-z]+)@',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment