$type = $formValues['document_type'];
$mimeType = self::getMimeType($type);
+ // ^^ Useful side-effect: consistently throws error for unrecognized types.
if ($type == 'pdf') {
$fileName = "CiviLetter.$type";
* @param array $pages
* List of HTML snippets.
* @param string $fileName
+ * The logical filename to return to client.
+ * Ex: "HelloWorld.odt".
* @param array|int $format
*/
public static function html2doc($pages, $fileName, $format = array()) {
/**
* @param object|string $phpWord
* @param string $ext
+ * File extension/type.
+ * Ex: docx, odt, html.
* @param string $fileName
+ * The logical filename to return to client.
+ * Ex: "HelloWorld.odt".
+ * Alternatively, a full path of a file to display. This seems sketchy.
+ * Ex: "/var/lib/data/HelloWorld.odt".
*/
public static function printDoc($phpWord, $ext, $fileName) {
$formats = array(
* Content of formatted/token-replaced document.
* List of HTML snippets.
* @param string $fileName
- * Document file name
+ * The logical filename to return to client.
+ * Ex: "HelloWorld.odt".
* @param string $docType
* Document type e.g. odt/docx
* @param clsTbsZip $zip
* @param array $text
* List of HTML snippets.
* @param string $fileName
+ * The logical filename to display.
+ * Ex: "HelloWorld.pdf".
* @param bool $output
+ * FALSE to display PDF. TRUE to return as string.
* @param null $pdfFormat
+ * Unclear. Possibly PdfFormat or formValues.
*
* @return string|void
*/