function xmlsitemap_link_bundle_settings_form_submit in XML sitemap 6.2
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_link_bundle_settings_form_submit()
- 7.2 xmlsitemap.module \xmlsitemap_link_bundle_settings_form_submit()
- 2.x xmlsitemap.module \xmlsitemap_link_bundle_settings_form_submit()
1 string reference to 'xmlsitemap_link_bundle_settings_form_submit'
- xmlsitemap_add_link_bundle_settings in ./
xmlsitemap.admin.inc - Add the link type XML sitemap options to the link type's form.
File
- ./
xmlsitemap.module, line 1281 - Main file for the xmlsitemap module.
Code
function xmlsitemap_link_bundle_settings_form_submit($form, &$form_state) {
$entity = $form['xmlsitemap']['#entity'];
$bundle = $form['xmlsitemap']['#bundle'];
// Handle new bundles by fetching the proper bundle key value from the form
// state values.
if (empty($bundle)) {
$entity_info = $form['xmlsitemap']['#entity_info'];
if (isset($entity_info['bundle keys']['bundle'])) {
$bundle_key = $entity_info['bundle keys']['bundle'];
if (isset($form_state['values'][$bundle_key])) {
$bundle = $form_state['values'][$bundle_key];
$form['xmlsitemap']['#bundle'] = $bundle;
}
}
}
xmlsitemap_link_bundle_settings_save($entity, $bundle, $form_state['values']['xmlsitemap']);
$entity_info = $form['xmlsitemap']['#entity_info'];
if (!empty($form['xmlsitemap']['#show_message'])) {
drupal_set_message(t('XML sitemap settings for the @bundle-label %bundle have been saved.', array(
'@bundle-label' => drupal_strtolower($entity_info['bundle label']),
'%bundle' => $entity_info['bundles'][$bundle]['label'],
)));
}
// Unset the form values since we have already saved the bundle settings and
// we don't want these values to get saved as variables in-case this form
// also uses system_settings_form().
unset($form_state['values']['xmlsitemap']);
}