function _jquery_carousel_config_validate in jQuery carousel 7
Same name and namespace in other branches
- 8 jquery_carousel.module \_jquery_carousel_config_validate()
Validation logic for carousel config.
2 calls to _jquery_carousel_config_validate()
- JqueryCarouselPluginStyleCarousel::options_validate in views/
plugins/ JqueryCarouselPluginStyleCarousel.inc - Validates the settings form values.
- jquery_carousel_config_form_validate in ./
jquery_carousel.module - Element validator for selector field.
File
- ./
jquery_carousel.module, line 115 - Provide jquery carousel style plugin for views.
Code
function _jquery_carousel_config_validate($element, $selector, $type = 'element') {
preg_match('/[a-zA-Z|-]*/', $selector, $matches);
if (count($matches) === 1 && $matches[0] === $selector) {
}
else {
if ($type == 'view') {
form_set_error($element, t("Selector should any special characters or spaces. Only special character allowed is '-'"));
}
else {
form_error($element, t("Selector should any special characters or spaces. Only special character allowed is '-'"));
}
}
}