You are here

function microdata_form_node_type_form_alter in Microdata 7

Implements hook_form_FORM_ID_alter().

File

includes/microdata.form_alter.inc, line 10
Provides inline structured data using Microdata format.

Code

function microdata_form_node_type_form_alter(&$form, &$form_state) {
  module_load_include('inc', 'microdata', 'microdata.admin');
  $entity_type = 'node';
  $bundle_type = $form['#node_type']->type;
  $mapping = microdata_get_mapping($entity_type, $bundle_type);

  // Create the vertical tab for microdata settings.
  $form['microdata'] = array(
    '#type' => 'fieldset',
    '#title' => t('Microdata settings'),
    '#collapsible' => TRUE,
    '#group' => 'additional_settings',
    '#tree' => TRUE,
  );
  $form['microdata'][$entity_type] = array(
    '#type' => 'container',
  );

  // Add the bundle mapping fields into the vertical tab.
  $form['microdata'][$entity_type] = array_merge($form['microdata'][$entity_type], microdata_get_bundle_type_mapping_form($mapping, $entity_type, $bundle_type));

  // Add the submit handler.
  $form['#submit'] = array_merge($form['#submit'], array(
    'microdata_bundle_type_mapping_form_submit',
  ));
}