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 341

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;
}