trigger ('plgVmOnSelfCallFE', array($type, $name, &$render)); if ($render) { // Get the document object. $document = JFactory::getDocument (); if (JRequest::getWord ('cache') == 'no') { JResponse::setHeader ('Cache-Control', 'no-cache, must-revalidate'); JResponse::setHeader ('Expires', 'Mon, 6 Jul 2000 10:00:00 GMT'); } $format = JRequest::getWord ('format', 'json'); if ($format == 'json') { $document->setMimeEncoding ('application/json'); // Change the suggested filename. JResponse::setHeader ('Content-Disposition', 'attachment;filename="' . $type . '".json"'); echo json_encode ($render); } else { echo $render; } } } }