You are here

function commons_bw_partial_node_form_after_build in Drupal Commons 7.3

After-build call-back. See commons_bw_partial_node_form().

1 string reference to 'commons_bw_partial_node_form_after_build'
commons_bw_partial_node_form in modules/commons/commons_bw/commons_bw.module
Partial node form for the browsing widget.

File

modules/commons/commons_bw/commons_bw.module, line 270

Code

function commons_bw_partial_node_form_after_build($form) {
  $bundle = $form['#bundle'];

  // Set the form action to the form's tab.
  $tabs = commons_bw_get_tab_definitions();

  // Search for the tab displaying the current bundle.
  foreach ($tabs as $tab_id => $settings) {
    if ($settings['bundle'] == $bundle) {
      break;
    }
  }
  $form['#action'] = url(current_path(), array(
    'query' => array(
      'qt-commons_bw' => $tab_id,
    ),
  ));
  return $form;
}