function form_process_vertical_tabs
form_process_vertical_tabs($element, &$form_state)
Creates a group formatted as vertical tabs.
Parameters
$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.
Return value
The processed element.
Related topics
File
- includes/form.inc, line 3841
- Functions for form and batch generation and processing.
Code
function form_process_vertical_tabs($element, &$form_state) { // Inject a new fieldset as child, so that form_process_fieldset() processes // this fieldset like any other fieldset. $element['group'] = array( '#type' => 'fieldset', '#theme_wrappers' => array(), '#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' => array('vertical-tabs-active-tab')), ); return $element; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!form.inc/function/form_process_vertical_tabs/7.x