function fp_render_c_fieldset

6.x theme.inc fp_render_c_fieldset($content, $legend = "Click to expand/collapse", $bool_start_closed = false, $extra_class = "")
4.x theme.inc fp_render_c_fieldset($content, $legend = "Click to expand/collapse", $bool_start_closed = false)
5.x theme.inc fp_render_c_fieldset($content, $legend = "Click to expand/collapse", $bool_start_closed = false)

This function will return the HTML to contruct a collapsible fieldset, complete with javascript and style tags.

Parameters

String $content:

String $legend:

bool $bool_start_closed:

Return value

String

7 calls to fp_render_c_fieldset()
AdvisingScreen::build_test_scores in classes/AdvisingScreen.php
Constructs the HTML to show the student's test scores.
audit_display_audit in modules/audit/audit.module
blank_degrees_display_blank_degree in modules/blank_degrees/blank_degrees.module
comments_display_main in modules/comments/comments.module
This displays the primary Comments tab, where we see past comments and can enter a new one (with the right permissions).
fp_render_array in includes/render.inc
This takes a render_array and generates the HTML for it. This usually is not called directly, but instead you should call fp_render_content() or fp_render_form()

... See full list

File

includes/theme.inc, line 1616

Code

function fp_render_c_fieldset($content, $legend = "Click to expand/collapse", $bool_start_closed = false, $extra_class = "") 
 {

  // Create a random ID for this fieldset, js, and styles.
  $id = md5(rand(9, 99999) . time());

  $start_js_val = 1;
  $fsstate = "open";
  $content_style = "";

  if ($bool_start_closed) {
    $start_js_val = 0;
    $fsstate = "closed";
    $content_style = "display: none;";
  }

  $js = "<script type='text/javascript'>
  
  var fieldset_state_$id = $start_js_val;
  
  function toggle_fieldset_$id() {
    
    var content = document.getElementById('content_$id');
    var fs = document.getElementById('fs_$id');
      
    if (fieldset_state_$id == 1) {
      // Already open.  Let's close it.
      fieldset_state_$id = 0;      
      \$(content).slideUp('medium');
      fs.className = 'c-fieldset-closed-$id c-fieldset-closed c-fieldset';
    }
    else {
      // Was closed.  let's open it.
      fieldset_state_$id = 1;
      
      \$(content).slideDown('medium');
      fs.className = 'c-fieldset-open-$id c-fieldset-open c-fieldset';      
    }  
  }  
  </script>";

  $rtn = "  
    <fieldset class='c-fieldset-$fsstate-$id c-fieldset-$fsstate c-fieldset $extra_class' id='fs_$id'>
      <legend><a href='javascript: toggle_fieldset_$id();' class='nounderline'>$legend</a></legend>
      <div id='content_$id' class='c-fieldset-content' style='$content_style'>
        $content
      </div>
    </fieldset>
    $js  
    
  <style>
  fieldset.c-fieldset-open-$id {
    border: 1px solid;
  }

  fieldset.c-fieldset-closed-$id {
    border: 1px solid;
    border-bottom-width: 0;
    border-left-width: 0;
    border-right-width: 0;    
  }  

  legend a {
    text-decoration: none;
  }
  
  </style>
    
  ";


  return $rtn;
}