function spaces_dashboard_add_validate in Spaces 7
Same name and namespace in other branches
- 6.3 spaces_dashboard/spaces_dashboard.admin.inc \spaces_dashboard_add_validate()
- 7.3 spaces_dashboard/spaces_dashboard.admin.inc \spaces_dashboard_add_validate()
Element validator for custom Dashboards.
1 string reference to 'spaces_dashboard_add_validate'
- spaces_dashboard_add in spaces_dashboard/
spaces_dashboard.admin.inc - Form for adding/editing custom Dashboards.
File
- spaces_dashboard/
spaces_dashboard.admin.inc, line 28
Code
function spaces_dashboard_add_validate($element, &$form_state) {
$value = trim($element['#value']);
$key = end($element['#parents']);
if ($key === 'custom-1' && empty($value)) {
$form_state['values']['spaces_dashboard_custom'][$key] = t('Dashboard');
}
else {
$form_state['values']['spaces_dashboard_custom'][$key] = $value;
}
}