You are here

function oa_core_refresh_oa_section_ref_target_id in Open Atrium Core 7.2

Replaces any changed elements on the form on ajax.

1 string reference to 'oa_core_refresh_oa_section_ref_target_id'
oa_core_form_views_content_views_panes_content_type_edit_process in ./oa_core.module
Only way I figured out to change the #ajax of this w/o changing the weight. Can't hook_form_alter cause go before panopoly_magic and panopoly_magic does module implements alter and puts itself last. Argh!

File

./oa_core.module, line 1305

Code

function oa_core_refresh_oa_section_ref_target_id($form, $form_state) {
  $messages = theme('status_messages');
  $messages = $messages ? $messages : '';
  $return = array(
    '#type' => 'ajax',
    '#commands' => array(),
  );
  $return['#commands'][] = ajax_command_replace('#panopoly-form-widget-preview', $messages . panopoly_magic_ajax_update_preview($form, $form_state));
  if (isset($form['exposed']['filter-oa_section_ref_target_id']['oa_section_ref_target_id'])) {
    $form['exposed']['filter-oa_section_ref_target_id']['oa_section_ref_target_id']['#theme_wrappers'] = array();
    $form['exposed']['filter-oa_section_ref_target_id']['oa_section_ref_target_id']['#attributes']['id'] = 'edit-exposed-oa-section-ref-target-id';
    $return['#commands'][] = ajax_command_replace('#edit-exposed-oa-section-ref-target-id', drupal_render($form['exposed']['filter-oa_section_ref_target_id']['oa_section_ref_target_id']));
  }
  return $return;
}