Ejemplo n.º 1
0
function GetRequire($_content, $_once = true)
{
    global $loaded_urls;
    $data = "";
    if ($_once == false) {
        $array = explode("<!-- require ", $_content);
    } else {
        $array = explode("<!-- require_once ", $_content);
    }
    if (count($array) >= 2) {
        $array2 = explode(" -->", $array[1]);
        if (count($array2) >= 2) {
            $require_code = file_get_contents($array2[0]);
            if (empty($require_code) == false) {
                $res = GetRequire($require_code, true);
                if (empty($res) == false) {
                    $data .= $res;
                }
                $res = GetRequire($require_code, false);
                if (empty($res) == false) {
                    $data .= $res;
                }
                $data .= $require_code;
            }
            $loaded_urls[] = $array2[0];
        }
    }
    return $data;
}
Ejemplo n.º 2
0
function process_print_view()
{
    $form_id = $_GET["fid"];
    $lead_id = $_GET["lid"];
    $filename = "form-{$form_id}-entry-{$lead_id}.pdf";
    $entry = GetRequire(dirname(__FILE__) . "/print-view.php");
    //Parse the default print view from Gravity forms so we can play with it.
    $entry = absolutify_html($entry);
    //Load the DOMPDF Engine to render the PDF
    require_once "dompdf/dompdf_config.inc.php";
    $dompdf = new DOMPDF();
    $dompdf->load_html($entry);
    $dompdf->set_base_path(site_url());
    $dompdf->render();
    return $dompdf;
}