Exemplo n.º 1
0
 /**
  * Adds backend layouts to the given backend layout collection.
  * The default backend layout ('default_default') is not added
  * since it's the default fallback if nothing is specified.
  *
  * @param DataProviderContext $dataProviderContext
  * @param BackendLayoutCollection $backendLayoutCollection
  * @return void
  */
 public function addBackendLayouts(DataProviderContext $dataProviderContext, BackendLayoutCollection $backendLayoutCollection)
 {
     $layoutData = $this->getLayoutData($dataProviderContext->getFieldName(), $dataProviderContext->getPageTsConfig(), $dataProviderContext->getPageId());
     foreach ($layoutData as $data) {
         $backendLayout = $this->createBackendLayout($data);
         $backendLayoutCollection->add($backendLayout);
     }
 }
 /**
  * Gets PageTsConfig from DataProviderContext if available,
  * if not it will be generated for the current Page.
  *
  * @param DataProviderContext $dataProviderContext
  * @return void
  */
 protected function generatePageTsConfig($dataProviderContext = NULL)
 {
     if ($dataProviderContext === NULL) {
         $pageId = (int) ($this->getPageId() !== NULL ?: GeneralUtility::_GP('id'));
         $this->setPageTsConfig((array) BackendUtility::getPagesTSconfig($pageId));
     } else {
         $this->setPageTsConfig((array) $dataProviderContext->getPageTsConfig());
     }
 }
 /**
  * Gets PageTsConfig from DataProviderContext if available,
  * if not it will be generated for the current Page.
  *
  * @param DataProviderContext $dataProviderContext
  * @return void
  */
 protected function generatePageTsConfig($dataProviderContext = null)
 {
     if ($dataProviderContext === null) {
         $pageId = $this->getPageId();
         $pageId = $pageId > 0 ? $pageId : (int) GeneralUtility::_GP('id');
         $pageTsConfig = BackendUtility::getPagesTSconfig($pageId);
     } else {
         $pageTsConfig = $dataProviderContext->getPageTsConfig();
     }
     $this->setPageTsConfig($pageTsConfig);
 }