You are here

function theme_ctools_collapsible in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/collapsible.theme.inc \theme_ctools_collapsible()

Render a collapsible div.

Parameters

$handle: Text to put in the handle/title area of the div.

$content: Text to put in the content area of the div, this is what will get collapsed

$collapsed = FALSE: If true, this div will start out collapsed.

1 theme call to theme_ctools_collapsible()
page_manager_render_operations in page_manager/page_manager.admin.inc
Render an operations array.

File

includes/collapsible.theme.inc, line 37
Theme function for the collapsible div tool.

Code

function theme_ctools_collapsible($handle, $content, $collapsed = FALSE) {
  ctools_add_js('collapsible-div');
  ctools_add_css('collapsible-div');
  $class = $collapsed ? ' ctools-collapsed' : '';
  $output = '<div class="ctools-collapsible-container' . $class . '">';
  $output .= '<div class="ctools-collapsible-handle">' . $handle . '</div>';
  $output .= '<div class="ctools-collapsible-content">' . $content . '</div>';
  $output .= '</div>';
  return $output;
}