/** * Init the configuration for CSVExport */ public function initConfiguration() { parent::initConfiguration(); if ($this->exportConfiguration->getSettings('outputEncoding')) { $this->outputEncoding = $this->exportConfiguration->getSettings('outputEncoding'); } if ($this->exportConfiguration->getSettings('delimiter')) { $this->delimiter = $this->exportConfiguration->getSettings('delimiter'); } if ($this->exportConfiguration->getSettings('enclosure')) { $this->enclosure = $this->exportConfiguration->getSettings('enclosure'); } }
/** * Initialize additional class properties */ public function initConfiguration() { parent::initConfiguration(); //echo 's'; $this->templatePath = $this->exportConfiguration->getSettings('templatePath'); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->templatePath, array('message' => 'No template path given for fluid export! 1284621481')); $this->setTemplatePathAndFilename(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->templatePath)); $this->paperSize = strtolower($this->exportConfiguration->getSettings('paperSize')); Tx_PtExtbase_Assertions_Assert::isNotEmptyString($this->paperSize, array('message' => 'No PaperSize given for the PDF output! 1322585559')); $this->paperOrientation = $this->exportConfiguration->getSettings('paperOrientation'); Tx_PtExtbase_Assertions_Assert::isInArray($this->paperOrientation, array('portrait', 'landscape'), array('message' => 'The Orientation must either be portrait or landscape! 1322585560')); $this->cssFilePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->exportConfiguration->getSettings('cssFilePath')); Tx_PtExtbase_Assertions_Assert::isTrue(file_exists($this->cssFilePath), array('message' => 'The CSS File with the filename ' . $this->cssFilePath . ' can not be found. 1322587627')); $this->dompdfSourcePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->exportConfiguration->getSettings('dompdfSourcePath')); Tx_PtExtbase_Assertions_Assert::isTrue(is_dir($this->dompdfSourcePath), array('message' => 'DomPdf source in path ' . $this->dompdfSourcePath . ' was not found. 1322753515')); $this->dompdfSourcePath = substr($this->dompdfSourcePath, -1, 1) == '/' ? $this->dompdfSourcePath : $this->dompdfSourcePath . '/'; }
/** * Returns download for given parameters * * @return string * @throws Exception */ public function downloadAction() { if ($this->listIdentifier == $this->exportListIdentifier || !$this->exportListIdentifier) { $list = $this->listFactory->createList($this->dataBackend, $this->configurationBuilder); } else { $exportListConfiguration = $this->settings['listConfig'][$this->exportListIdentifier]; if (!is_array($exportListConfiguration)) { throw new Exception('No export list configuration found for listIdentifier ' . $this->exportListIdentifier, 1317116470); } $extListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByCustomConfiguration($exportListConfiguration, $this->listIdentifier, false); $list = $extListContext->getList(true); } $this->view->setExportConfiguration($this->configurationBuilder->buildExportConfiguration()); $this->view->initConfiguration(); $this->view->assign('listHeader', $list->getListHeader()); $this->view->assign('listCaptions', $list->getRenderedListHeader()); $this->view->assign('listData', $list->getRenderedListData()); $this->view->assign('aggregateRows', $list->getRenderedAggregateListData()); return $this->view->render(); }
/** * Initialize additional class properties */ public function initConfiguration() { parent::initConfiguration(); $this->tempPdfBasePath = PATH_site . 'typo3temp/'; $this->cmd = 'wkhtmltopdf'; // This method seems not to work to check, whether a command is available in unix #if (!file_exists($this->cmd)) throw new Exception('WKPDF static executable "' . htmlspecialchars($this->cmd, ENT_QUOTES) . '" was not found.', 1373448917); do { $this->tmp = $this->tempPdfBasePath . 'tmp/' . mt_rand() . '.html'; } while (file_exists($this->tmp)); $this->initTypoScriptSettings(); }