';
$output .= '
';
$index = 0;
foreach (element_children($element) as $key) {
if ($element[$key]['#type'] && $element[$key]['#type'] == 'tabpage') {
$index++;
$output .= '- '. $element[$key]['#title'] .'
';
}
}
$output .= '
';
$output .= $element['#children'];
$output .= '';
return $output;
}
function theme_tabpage($element) {
$output .='';
$output .= '
'. $element['#title'] .'
';
$output .= $element['#content'] . $element['#children'];
$output .='';
return $output;
}
/**
* Add required js and css files.
*/
function tabs_load() {
static $loaded = FALSE;
if (!$loaded) {
$path = drupal_get_path('module', 'tabs');
drupal_add_js($path . '/jquery.tabs.pack.js');
drupal_add_js(drupal_get_path('module', 'jstools') . '/jquery.history.pack.js');
drupal_add_js($path . '/tabs.js');
drupal_add_css($path . '/drupal-tabs.css');
drupal_add_css($path . '/tabs.css');
drupal_set_html_head('
');
$loaded = TRUE;
}
}
/**
* Render a tabset 'manually' (when not rendering as part of a regular form render).
*/
function tabs_render($form) {
return drupal_render(form_builder('tabset', $form));
}
/**
* Implementation of hook_elements().
*/
function tabs_elements() {
$type = array();
$type['tabset'] = array('#process' => array('tabs_process_tabset' => array()));
$type['tabpage'] = array('#content' => '');
return $type;
}