function quant_admin_settings_validate in Quant 7
Same name and namespace in other branches
- 6 includes/forms.inc \quant_admin_settings_validate()
Validate the admin settings form
File
- ./
quant.admin.inc, line 87 - Admin callbacks
Code
function quant_admin_settings_validate(&$form, &$form_state) {
// Check width
if (!is_numeric($form_state['values']['quant_width']) || strlen($form_state['values']['quant_width']) > 4 || strlen($form_state['values']['quant_width']) < 2) {
form_set_error('quant_width', t('The width must be a number that is between 2 and 4 digits'));
}
// Check height
if (!is_numeric($form_state['values']['quant_height']) || strlen($form_state['values']['quant_height']) > 4 || strlen($form_state['values']['quant_height']) < 2) {
form_set_error('quant_height', t('The height must be a number that is between 2 and 4 digits'));
}
// Allow chart plugins to validate
foreach (quant_get_quant_charts() as $plugin) {
$plugin->chart
->adminSettingsValidate($form, $form_state);
}
}