Actually, the guy doesn't have a clue :) The proper solution is to use format=raw to serve non-HTML data. Admin Tools does not suppose it is running in HTML mode. Not ever. I write software which uses format=raw (that's how downloads are served by Akeeba Release System) so it would be stupid on my part, to say the least, to have Admin Tools break this behaviour. No, sir, we don't do that. We use JDocument's setGenerator() method. This is present in the base class (JDocument) out of which both JDocumentHTML and JDocumentRaw extend.
But since we're using JFactory::getDocument() to fetch the document, we do force Joomla! to create a specialised document object. If format=html or skipped altogether in the URL (or the SEF extension is .html) then a JDcoumentHTML is created. If you do set format=raw, however, a JDocumentRaw object is created.
Even the way things are right now, the developer could work around that! JDocument doesn't get rendered until AFTER the component has finished executing. If you want to abuse format=html to deliver non-HTML data (as I do, for the same reasons, in Akeeba Backup's backup page, where the AJAX requests no longer use format=raw) there is a workaround. Just use @ob_end_clean(), output your headers and data, then call JFactory::getApplication()->close() or jexit() (both are fine, but AFAIK jexit() is deprecated since Joomla! 1.7). This will halt Joomla! before it has the chance to use its internal document renderer. This is infinitely more stable than betting on being able to set the document type in a component.
Of course, all of this requires that the developer actually understands how Joomla! works. This guy has a few things to learn, but instead of learning he prefers to put the blame on plugins which are written to use the Joomla! Framework correctly, unlike his component...
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!