From 2d362092baeab40289ac48bd4b2d2691e32ebb8d Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 23 Mar 2011 16:34:31 +0000 Subject: [PATCH] Added document properties to HTML output as meta tags git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@70829 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Writer/HTML.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Writer/HTML.php b/Classes/PHPExcel/Writer/HTML.php index 9337c1f..ff44cba 100644 --- a/Classes/PHPExcel/Writer/HTML.php +++ b/Classes/PHPExcel/Writer/HTML.php @@ -302,15 +302,36 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { } // Construct HTML + $properties = $this->_phpExcel->getProperties(); $html = '' . PHP_EOL; $html .= '' . PHP_EOL; $html .= '' . PHP_EOL; $html .= ' ' . PHP_EOL; - $html .= ' ' . PHP_EOL; - $html .= ' ' . htmlspecialchars($this->_phpExcel->getProperties()->getTitle()) . '' . PHP_EOL; + $html .= ' ' . PHP_EOL; + if ($properties->getTitle() > '') + $html .= ' ' . htmlspecialchars($properties->getTitle()) . '' . PHP_EOL; + + if ($properties->getCreator() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getTitle() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getDescription() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getSubject() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getKeywords() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getCategory() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getCompany() > '') + $html .= ' ' . PHP_EOL; + if ($properties->getManager() > '') + $html .= ' ' . PHP_EOL; + if ($pIncludeStyles) { $html .= $this->generateStyles(true); } + $html .= ' ' . PHP_EOL; $html .= '' . PHP_EOL; $html .= ' ' . PHP_EOL;