You are here

function xmlsitemap_link_bundle_settings_form in XML sitemap 7.2

Same name and namespace in other branches
  1. 6.2 xmlsitemap.admin.inc \xmlsitemap_link_bundle_settings_form()

Link bundle settings form.

1 string reference to 'xmlsitemap_link_bundle_settings_form'
xmlsitemap_menu in ./xmlsitemap.module
Implements hook_menu().

File

./xmlsitemap.admin.inc, line 698
Administrative page callbacks for the xmlsitemap module.

Code

function xmlsitemap_link_bundle_settings_form(array $form, array &$form_state, array $bundle) {
  if (empty($form_state['ajax']) && ($admin_path = xmlsitemap_get_bundle_path($bundle['entity'], $bundle['bundle']))) {

    // If this is a non-ajax form, redirect to the bundle administration page.
    $destination = drupal_get_destination();
    unset($_GET['destination']);
    drupal_goto($admin_path, array(
      'query' => $destination,
    ));
  }
  else {
    drupal_set_title(t('@bundle XML sitemap settings', array(
      '@bundle' => $bundle['info']['label'],
    )));
  }
  $form = array();
  xmlsitemap_add_link_bundle_settings($form, $form_state, $bundle['entity'], $bundle['bundle']);
  $form['xmlsitemap']['#type'] = 'markup';
  $form['xmlsitemap']['#value'] = '';
  $form['xmlsitemap']['#access'] = TRUE;
  $form['xmlsitemap']['#show_message'] = TRUE;
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['actions']['cancel'] = array(
    '#value' => l(t('Cancel'), isset($_GET['destination']) ? $_GET['destination'] : 'admin/config/search/xmlsitemap/settings'),
    '#weight' => 10,
  );
  return $form;
}