You are here

function theme_ajax_page in Webform Ajax Page 7

Same name and namespace in other branches
  1. 6 webform_ajax_page.module \theme_ajax_page()

Theme callback

2 theme calls to theme_ajax_page()
_webform_display_ajax_page in ./webform_ajax_page.module
Implements _webform_display_component().
_webform_render_ajax_page in ./webform_ajax_page.module
Implements _webform_render_component().

File

./webform_ajax_page.module, line 262
Ajax page element for webform

Code

function theme_ajax_page($variables) {
  drupal_add_library('system', 'ui.tabs');
  $element = $variables['element'];
  if (!array_key_exists('#attributes', $element)) {
    $element['#attributes'] = array();
  }
  if (variable_get('webform_ajax_page_css', 1)) {
    drupal_add_css(drupal_get_path('module', 'webform_ajax_page') . '/webform_ajax_page.css');
  }
  $element['#children'] = !empty($element['#children']) ? $element['#children'] : drupal_render_children($element);
  drupal_add_js(drupal_get_path('module', 'webform_ajax_page') . '/webform_ajax_page.js');
  return '<div id="' . $element['#id'] . '" ' . drupal_attributes($element['#attributes']) . ' >' . ($element['#title'] ? '<h3>' . $element['#title'] . '</h3>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">' . $element['#description'] . '</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') . "</div>\n";
}