You are here

function _popup_form in Popup 6.x

Same name and namespace in other branches
  1. 8 includes/popup.api.inc \_popup_form()
  2. 7 includes/popup.api.inc \_popup_form()
  3. 7.x includes/popup.api.inc \_popup_form()

File

includes/popup.api.inc, line 364

Code

function _popup_form($attributes, $return = FALSE) {
  $title = $attributes['title'] ? $attributes['title'] : 'form';
  if ($return == 'title') {
    return $title;
  }
  $body = drupal_get_form($attributes['form']);
  if ($attributes['ajax']) {
    $body = '<div class="ajax-form-wrapper">' . $body . '</div>';
  }
  if ($return == 'body') {
    return $body;
  }
  return popup_element($title, $body, $attributes);
}