function _popup_form in Popup 7.x
Same name and namespace in other branches
- 8 includes/popup.api.inc \_popup_form()
- 7 includes/popup.api.inc \_popup_form()
- 6.x includes/popup.api.inc \_popup_form()
File
- includes/
popup.api.inc, line 381
Code
function _popup_form($attributes, $return = FALSE) {
$title = $attributes['title'] ? $attributes['title'] : 'form';
if ($return == 'title') {
return $title;
}
$body = drupal_render(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);
}