function chart_settings_validate in Google Chart Tools: Image Charts 6
Same name and namespace in other branches
- 5 chart.module \chart_settings_validate()
- 7 chart.module \chart_settings_validate()
Implementation of hook_validate();
File
- ./
chart.module, line 382 - Provides Google chart API integration.
Code
function chart_settings_validate($form, &$form_state) {
if (!empty($form_state['values']['chart_global_bg']) && !preg_match('/[a-fA-F0-9]{6}/is', $form_state['values']['chart_global_bg'])) {
form_set_error('chart_global_bg', t('Invalid color. Formatted as RRGGBB with no pound sign.'));
}
if (!empty($form_state['values']['chart_max_width']) && !is_numeric($form_state['values']['chart_max_width'])) {
form_set_error('chart_max_width', t('Width must be an integer.'));
}
if (!empty($form_state['values']['chart_max_height']) && !is_numeric($form_state['values']['chart_max_height'])) {
form_set_error('chart_max_height', t('Height must be an integer.'));
}
}