You are here

function xmlsitemap_link_bundle_settings_form in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap.admin.inc \xmlsitemap_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 631
Administrative page callbacks for the xmlsitemap module.

Code

function xmlsitemap_link_bundle_settings_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($_REQUEST['destination']);
    drupal_goto($admin_path, $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(
    '#weight' => 100,
  );
  $form['actions']['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  $form['actions']['cancel'] = array(
    '#value' => l(t('Cancel'), isset($_GET['destination']) ? $_GET['destination'] : 'admin/settings/xmlsitemap/settings'),
    '#weight' => 10,
  );
  return $form;
}