form_process_vertical_tabs

  1. drupal
    1. drupal7
Versionen
drupal7 form_process_vertical_tabs($element, &$form_state)

Creates a group formatted as vertical tabs.

Übergabeparameter

$element An associative array containing the properties and children of the fieldset.

$form_state The $form_state array for the form this vertical tab widget belongs to.

Rückgabewert

The processed element.

Verwandte Themen

Code

includes/form.inc, line 2319

<?php
function form_process_vertical_tabs($element, &$form_state) {
  // To save us from modifying the existing element and changing its #type,
  // a new form element is created as a child. The default #process hooks
  // are called automatically by the form renderer and we don't have to do
  // that manually.
  $element['group'] = array(
    '#type' => 'fieldset',
    '#theme_wrapper' => '',
    '#parents' => $element['#parents'],
  );

  // The JavaScript stores the currently selected tab in this hidden
  // field so that the active tab can be restored the next time the
  // form is rendered, e.g. on preview pages or when form validation
  // fails.
  $name = implode('__', $element['#parents']);
  if (isset($form_state['values'][$name . '__active_tab'])) {
    $element['#default_tab'] = $form_state['values'][$name . '__active_tab'];
  }
  $element[$name . '__active_tab'] = array(
    '#type' => 'hidden',
    '#default_value' => $element['#default_tab'],
    '#attributes' => array('class' => 'vertical-tabs-active-tab'),
  );

  return $element;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen