function _colorbox_admin_settings_check_plugin_path in Colorbox 6
Same name and namespace in other branches
- 7 colorbox.admin.inc \_colorbox_admin_settings_check_plugin_path()
Checks if the directory in $form_element exists and contains a file named 'jquery.colorbox.js'. If validation fails, the form element is flagged with an error from within the file_check_directory function.
Parameters
$form_element: The form element containing the name of the directory to check.
1 string reference to '_colorbox_admin_settings_check_plugin_path'
- colorbox_admin_settings in ./
colorbox.admin.inc - General configuration form for controlling the colorbox behaviour.
File
- ./
colorbox.admin.inc, line 376 - Administrative page callbacks for the colorbox module.
Code
function _colorbox_admin_settings_check_plugin_path($form_element) {
$library_path = $form_element['#value'];
if (!is_dir($library_path) || !(file_exists($library_path . '/colorbox/jquery.colorbox.js') && file_exists($library_path . '/colorbox/jquery.colorbox-min.js'))) {
form_set_error($form_element['#parents'][0], t('You need to download the !colorbox and extract the entire contents of the archive into the %path folder of your server.', array(
'!colorbox' => l(t('Colorbox plugin'), 'http://colorpowered.com/colorbox/'),
'%path' => $library_path,
)));
}
return $form_element;
}