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