/** * @return string */ public function rawAction() { $record = $this->getRecord(); $templateFileReference = $record['tx_fluidpages_templatefile']; $templatePathAndFilename = $this->pageConfigurationService->convertFileReferenceToTemplatePathAndFilename($templateFileReference); $paths = $this->pageConfigurationService->getViewConfigurationByFileReference($templateFileReference); $this->provider->setTemplatePathAndFilename($templatePathAndFilename); $this->view->setTemplatePathAndFilename($templatePathAndFilename); $this->view->setTemplateRootPath($paths['templateRootPath']); $this->view->setPartialRootPath($paths['partialRootPath']); $this->view->setLayoutRootPath($paths['layoutRootPath']); }
/** * Renders a Fluid Template Layout select field * * @param array $parameters * @param mixed $pObj * @return string */ public function addLayoutOptions(&$parameters, &$pObj) { $referringField = $parameters['config']['arguments']['referring_field']; $currentValue = $parameters['row'][$referringField]; $configuration = $this->configurationService->getViewConfigurationByFileReference($currentValue); $templatePaths = new TemplatePaths($configuration); $files = $templatePaths->resolveAvailableLayoutFiles(); $files = array_map('basename', $files); foreach ($files as $file) { if (0 !== strpos($file, '.')) { $file = pathinfo($file, PATHINFO_FILENAME); array_push($parameters['items'], [$file, $file]); } } }
/** * Renders a Fluid Template Layout select field * * @param array $parameters * @param mixed $pObj * @return string */ public function addLayoutOptions(&$parameters, &$pObj) { $referringField = $parameters['config']['arguments']['referring_field']; $currentValue = $parameters['row'][$referringField]; $configuration = $this->configurationService->getViewConfigurationByFileReference($currentValue); $layoutRootPath = $configuration['layoutRootPath']; $layoutRootPath = GeneralUtility::getFileAbsFileName($layoutRootPath); $files = array(); $files = TRUE === is_dir($layoutRootPath) ? GeneralUtility::getAllFilesAndFoldersInPath($files, $layoutRootPath) : array(); foreach ($files as $file) { $file = substr($file, strlen($layoutRootPath)); if (0 !== strpos($file, '.')) { $dir = pathinfo($file, PATHINFO_DIRNAME); $file = pathinfo($file, PATHINFO_FILENAME); if ('.' !== $dir) { $file = $dir . '/' . $file; } array_push($parameters['items'], array($file, $file)); } } }