function path_breadcrumbs_save in Path Breadcrumbs 7.3
Same name and namespace in other branches
- 7 path_breadcrumbs.module \path_breadcrumbs_save()
- 7.2 path_breadcrumbs.module \path_breadcrumbs_save()
Save path breadcrumb.
Parameters
object $path_breadcrumbs: Object with path breadcrumb data.
Return value
int ID of inserted/updated path breadcrumb.
4 calls to path_breadcrumbs_save()
- path_breadcrumbs_import_form_submit in path_breadcrumbs_ui/
path_breadcrumbs_ui.admin.inc - Submit callback for path breadcrumbs import form.
- path_breadcrumbs_ui_breadcrumbs_list_submit in path_breadcrumbs_ui/
path_breadcrumbs_ui.admin.inc - Submit callback for path_breadcrumbs_ui_breadcrumbs_list form.
- path_breadcrumbs_ui_edit_form_submit in path_breadcrumbs_ui/
path_breadcrumbs_ui.module - Submit callback for path breadcrumbs EDIT form.
- _path_breadcrumbs_ui_add_form_finish_ajax_callback in path_breadcrumbs_ui/
path_breadcrumbs_ui.module - Ajax callback for last step of breadcrumbs creating. Saves new path breadcrumb.
File
- ./
path_breadcrumbs.module, line 491
Code
function path_breadcrumbs_save($path_breadcrumbs) {
// Include Chaos Tools' exportable library.
ctools_include('export');
// Build array with full access data.
if (!empty($path_breadcrumbs->access) && !empty($path_breadcrumbs->logic)) {
$path_breadcrumbs->access['logic'] = $path_breadcrumbs->logic;
}
elseif (empty($path_breadcrumbs->access)) {
$path_breadcrumbs->access = array();
}
// Set defaults.
if (!isset($path_breadcrumbs->arguments)) {
$path_breadcrumbs->arguments = array();
}
if (!isset($path_breadcrumbs->export_type)) {
$path_breadcrumbs->export_type = NULL;
}
// Ctools will serialize data itself.
$path_breadcrumbs->data = array(
'titles' => $path_breadcrumbs->titles,
'paths' => $path_breadcrumbs->paths,
'home' => $path_breadcrumbs->home,
'translatable' => $path_breadcrumbs->translatable,
'arguments' => $path_breadcrumbs->arguments,
'access' => $path_breadcrumbs->access,
);
if (!empty($path_breadcrumbs->custom)) {
$path_breadcrumbs->data['custom'] = $path_breadcrumbs->custom;
}
$save_result = ctools_export_crud_save('path_breadcrumbs', $path_breadcrumbs);
// FALSE means error while saving.
if ($save_result) {
// Remove data from ctools object cache table.
path_breadcrumbs_object_cache_clear($path_breadcrumbs->machine_name);
// Allow modules to know that path_breadcrumbs were saved.
$path_breadcrumbs->is_new = $save_result == SAVED_NEW;
module_invoke_all('path_breadcrumbs_save', $path_breadcrumbs);
// Truncate all cached data.
cache_clear_all('*', PATH_BREADCRUMBS_CACHE_STORAGE, TRUE);
}
// Return saving result, SAVED_NEW or SAVED_UPDATED.
return $save_result;
}