Same name in other branches
- 8.x-1.x quicktabs.module \quicktabs_save()
Creates a new quicktab instance.
2 calls to quicktabs_save()
- quicktabs_form_submit in ./
quicktabs.admin.inc - Submit handler for quicktabs admin page.
- quicktabs_update in ./
quicktabs.module - Updates an existing quicktab instance.
File
-
./
quicktabs.module, line 298
Code
function quicktabs_save($quicktab) {
module_invoke_all('quicktabs_presave', $quicktab);
$exists = quicktabs_load($quicktab->machine_name);
if ($exists && empty($exists->in_code_only)) {
$ret = drupal_write_record('quicktabs', $quicktab, 'machine_name');
if ($ret == SAVED_UPDATED) {
quicktabs_i18n_update_strings(array(
$quicktab->machine_name,
));
}
else {
return FALSE;
}
}
else {
$ret = drupal_write_record('quicktabs', $quicktab);
if ($ret == SAVED_NEW) {
quicktabs_i18n_update_strings(array(
$quicktab->machine_name,
));
module_invoke_all('quicktabs_insert', $quicktab);
}
else {
return FALSE;
}
}
module_invoke_all('quicktabs_save', $quicktab);
return $quicktab;
}