function focal_point_validate in Focal Point 7
Validate a given focal point.
Parameters
string $focal_point: The focal point string to test.
Return value
bool TRUE if the given focal point value is valid; FALSE otherwise.
4 calls to focal_point_validate()
- focal_point_effect_crop_data in ./
focal_point.effects.inc - Compile the necessary data for the image crop effect.
- focal_point_element_form_validate in ./
focal_point.module - Validation function for the focal point widget.
- focal_point_form_validate in ./
focal_point.module - Form validation function for the focal point form item.
- focal_point_preview_page in ./
focal_point.admin.inc - Page callback function.
File
- ./
focal_point.module, line 408
Code
function focal_point_validate($focal_point) {
if (empty($focal_point) || preg_match('/^(100|[0-9]{1,2})(,)(100|[0-9]{1,2})$/', $focal_point)) {
return TRUE;
}
else {
return FALSE;
}
}