From 2718e40b3a3da0d354364811cbf30b634787ddec Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Wed, 8 Sep 2010 15:05:26 +0000 Subject: [PATCH] Provided a setGenerateSheetNavigationBlock(false); option to suppress generation of the sheet navigation block when writing multiple worksheets to HTML git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@60582 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Writer/HTML.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Writer/HTML.php b/Classes/PHPExcel/Writer/HTML.php index 3e17873d..8f5432cc 100644 --- a/Classes/PHPExcel/Writer/HTML.php +++ b/Classes/PHPExcel/Writer/HTML.php @@ -125,6 +125,13 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { */ protected $_isPdf = false; + /** + * Generate the Navigation block + * + * @var boolean + */ + private $_generateSheetNavigationBlock = true; + /** * Create a new PHPExcel_Writer_HTML * @@ -170,7 +177,7 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { fwrite($fileHandle, $this->generateHTMLHeader(!$this->_useInlineCss)); // Write navigation (tabs) - if (!$this->_isPdf) { + if ((!$this->_isPdf) && ($this->_generateSheetNavigationBlock)) { fwrite($fileHandle, $this->generateNavigation()); } @@ -250,6 +257,26 @@ class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { return $this; } + /** + * Get sheet index + * + * @return boolean + */ + public function getGenerateSheetNavigationBlock() { + return $this->_generateSheetNavigationBlock; + } + + /** + * Set sheet index + * + * @param boolean $pValue Flag indicating whether the sheet navigation block should be generated or not + * @return PHPExcel_Writer_HTML + */ + public function setGenerateSheetNavigationBlock($pValue = true) { + $this->_generateSheetNavigationBlock = (bool) $pValue; + return $this; + } + /** * Write all sheets (resets sheetIndex to NULL) */