currently it is not possible to pass options directly to the dialog when using dialog_form_wrapper. As you dont know wheather you get an 1 or 2 element-array(js settings), its rather bad to set them later using

$output[0]['options'] = ....

Thats the current code

/**
 * Render a form into an AJAX display.
 */
function dialog_form_render($form_state, $output) {
  $title = empty($form_state['title']) ? '' : $form_state['title'];

  // If there are messages for the form, render them.
  if ($messages = theme('status_messages')) {
    $output = $messages . $output;
  }

  $commands = array();
  if (isset($form_state['js settings'])) {
    $commands[] = ctools_ajax_command_settings($form_state['js settings']);
  }

  $commands[] = dialog_command_display($title, $output);
  return $commands;
}

Just pass $form_state['dialog options'], as dialog_command_display already has the needed signature.

/**
 * Render a form into an AJAX display.
 */
function dialog_form_render($form_state, $output) {
  $title = empty($form_state['title']) ? '' : $form_state['title'];

  // If there are messages for the form, render them.
  if ($messages = theme('status_messages')) {
    $output = $messages . $output;
  }

  $commands = array();
  if (isset($form_state['js settings'])) {
    $commands[] = ctools_ajax_command_settings($form_state['js settings']);
  }

  $commands[] = dialog_command_display($title, $output, $form_state['dialog options']);
  return $commands;
}

Marking as minor API bug, as there are no working "workarrounds".

Comments

devin carlson’s picture

Status: Active » Closed (outdated)

Dialog 6.x is no longer supported.