sessionGet('initial_page_request','script'); if ($requests[0] == 'embed' && isset($requests[1])) { $embed_location = false; if (isset($requests[3])) { $embed_location = $requests[3]; $embed_location = str_replace('!slash!', '/', $embed_location); } $template = @file_get_contents(dirname(CASH_PLATFORM_PATH) . '/settings/defaults/embed.mustache'); $embed_data = array(); $element_markup = false; ob_start(); CASHSystem::embedElement($requests[1],'embed',$embed_location); $embed_data['element_markup'] = ob_get_contents(); ob_end_clean(); // open up some mustache in here: include_once(dirname(CASH_PLATFORM_PATH) . '/lib/mustache/Mustache.php'); $freddiemercury = new Mustache; header('P3P: CP="ALL CUR OUR"'); // IE P3P privacy policy fix $template = str_replace('', '', $template); // used this trick to grab cross-broser document height -> http://james.padolsey.com/javascript/get-document-height-cross-browser/ $template = str_replace('', '', $template); $encoded_html = $freddiemercury->render($template, $embed_data); echo $encoded_html; } else { header('Content-Type: text/html; charset=utf-8'); if ($initial_page_request) { if (in_array('outputresponse', $requests)) { $output = $initial_page_request['response']['payload']; } else { $output = array( 'response' => $initial_page_request['response'] ); } } else { $output = array( 'response' => false ); } if (in_array('outputresponse', $requests)) { echo (string)$output; } else { echo json_encode($output); } } } } ?>