'metatags_quick'))->fetchCol(); } function gvf_meta($form, &$form_state) { $fields = gvf_meta_find_fields(); foreach ($fields as $field) { if (isset($form[$field])) { $form['vertical_tabs_meta'][$field] = $form[$field]; unset($form[$field]); } } if (!isset($form['vertical_tabs_meta'])) { return $form; } $form['#submit'][] = '_gvf_meta_submit'; $form['vertical_tabs_meta'] += array( '#type' => 'fieldset', '#title' => t('Meta search information'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#attributes' => array( 'class' => array('gvf-meta-form'), ), // The #group value must match the name of the vertical tabs element. // In most cases, this is 'additional_settings'. '#group' => 'additional_settings', // Attach the javascript for vertical tabs. '#attached' => array( 'js' => array( 'vertical-tabs' => drupal_get_path('module', 'gvf') . '/gvf.meta.js', ), ), '#tree' => TRUE, '#weight' => -2, ); return $form; } function _gvf_meta_submit(&$form, &$form_state) { $fields = gvf_meta_find_fields(); foreach ($fields as $field) { if (isset($form_state['values']['vertical_tabs_meta'][$field])) { $form_state['values'][$field] = $form_state['values']['vertical_tabs_meta'][$field]; unset($form_state['values']['vertical_tabs_meta'][$field]); } } } // below goes in gvf.meta.js file (function ($) { /** * Custom summary for the module vertical tab. */ Drupal.behaviors.gvf_meta = { attach: function (context) { // Use the fieldset class to identify the vertical tab element $('fieldset.gvf-meta-form', context).drupalSetSummary(function (context) { var total = 0; $('.gvf-meta-form :input').each(function() { total += this.value.length; }); return total ? Drupal.t('Using custom information') : Drupal.t('None'); }); } }; })(jQuery);