function fp_render_array

7.x render.inc fp_render_array($render_array, $use_callback = "")
6.x render.inc fp_render_array($render_array, $use_callback = "")
5.x render.inc fp_render_array($render_array, $use_callback = "")

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()

2 calls to fp_render_array()
fp_render_content in includes/render.inc
This is very similar to fp_get_form / fp_render_form, except in this case we are being passed the completed "render_array", which already contains all of our elements. We will call hooks on it, sort by weights, and then return the rendered…
fp_render_form in includes/render.inc
Render the form array from the callback to the screen, and set the form to save itself in our default submit handler. Valid form_types are: "system_settings" => values automatically saved to variables table. "normal" or BLANK…

File

includes/render.inc, line 142

Code

function fp_render_array($render_array, $use_callback = "") {
  $rtn = "";

  foreach ($render_array as $name => $element) {



    if (is_array($element) && (isset($element ["type"]) || isset($element ["value"]))) {

      // Is this a cfieldset (collapsible fieldset)?
      if (@$element ["type"] == "cfieldset") {
        $celements = $element ["elements"]; // get our list of form elements within this fieldset.
        // Go through these new elements and prepare to display them inside a collapsible fieldset.
        $html = "";
        foreach ($celements as $k => $v) {
          foreach ($celements [$k] as $name => $celement) {
            $html .= fp_render_element($name, $celement, $use_callback);
          }
        }
        // add to c_fieldset
        $rtn .= fp_render_c_fieldset($html, @$element ["label"], @$element ["start_closed"], @$element ['attributes']['class']);

      }
      else {
        // No, this is a normal element.  Not in a fieldset.
        $rtn .= fp_render_element($name, $element, $use_callback);
      }



    }
  }

  return $rtn;

}