function _path_breadcrumbs_ui_form_step_basic_settings_submit 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_basic_settings_submit()
Submit function for basic settings form (first step).
_state
Parameters
$form:
Return value
mixed
1 string reference to '_path_breadcrumbs_ui_form_step_basic_settings_submit'
- _path_breadcrumbs_ui_form_step_basic_settings in path_breadcrumbs_ui/
path_breadcrumbs_ui.module - FIRST STEP. Provide form with basic settings.
File
- path_breadcrumbs_ui/
path_breadcrumbs_ui.module, line 426 - Provide user interface for CRUD operations with path breadcrumbs.
Code
function _path_breadcrumbs_ui_form_step_basic_settings_submit($form, &$form_state) {
// Check if argument matches all keywords.
if (!empty($form_state['values']['keywords'])) {
// Load breadcrumb from the cache.
$breadcrumb = path_breadcrumbs_object_cache_get($form_state['storage']['machine_name']);
if (empty($breadcrumb)) {
return;
}
$arguments = array();
foreach ($form_state['values']['keywords'] as $keyword => $position) {
// Ensure that keywords were not changed after path update.
if (!empty($breadcrumb->arguments[$keyword])) {
$arguments[$keyword] = $breadcrumb->arguments[$keyword];
}
// Save keyword position.
$arguments[$keyword]['position'] = $position['position'];
}
$breadcrumb->arguments = $arguments;
path_breadcrumbs_object_cache_set($form_state['storage']['machine_name'], $breadcrumb);
}
}