function _path_breadcrumbs_ui_form_step_breadcrumbs_settings_validate in Path Breadcrumbs 7.2
Same name and namespace in other branches
- 7.3 path_breadcrumbs_ui/path_breadcrumbs_ui.module \_path_breadcrumbs_ui_form_step_breadcrumbs_settings_validate()
Validate function for breadcrumbs settings form (fourth step).
_state
Parameters
$form:
Return value
mixed
1 string reference to '_path_breadcrumbs_ui_form_step_breadcrumbs_settings_validate'
- _path_breadcrumbs_ui_form_step_breadcrumbs_settings in path_breadcrumbs_ui/
path_breadcrumbs_ui.module - FOURTH STEP. Provide form for breadcrumb settings.
File
- path_breadcrumbs_ui/
path_breadcrumbs_ui.module, line 758 - Provide user interface for CRUD operations with path breadcrumbs.
Code
function _path_breadcrumbs_ui_form_step_breadcrumbs_settings_validate($form, $form_state) {
// Do not validate form if DELETE button was submitted.
if (array_search(t('Delete'), $form_state['values'], TRUE)) {
return;
}
// Every title and path should contain value.
if (!empty($form_state['values']['breadcrumbs_table'])) {
foreach ($form_state['values']['breadcrumbs_table'] as $key => $value) {
if (empty($value['left_value'])) {
form_set_error('breadcrumbs_table][' . $key . '][left_value', t('Link title should contain value.'));
}
if (empty($value['right_value'])) {
form_set_error('breadcrumbs_table][' . $key . '][right_value', t('Link path should contain value.'));
}
}
}
}