示例#1
0
 /**
  * Processes the items of the new content element wizard
  * and inserts necessary default values for items created within a grid
  *
  * @param array $wizardItems : The array containing the current status of the wizard item list before rendering
  * @param \TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController $parentObject : The parent object that triggered this hook
  *
  * @return void
  */
 public function manipulateWizardItems(&$wizardItems, &$parentObject)
 {
     if (!GeneralUtility::inList($GLOBALS['BE_USER']->groupData['explicit_allowdeny'], 'tt_content:CType:gridelements_pi1:DENY')) {
         $pageID = $parentObject->id;
         $this->init($pageID);
         $container = (int) GeneralUtility::_GP('tx_gridelements_container');
         $column = (int) GeneralUtility::_GP('tx_gridelements_columns');
         $allowed_GP = GeneralUtility::_GP('tx_gridelements_allowed');
         if (!empty($allowed_GP)) {
             $allowed = array_flip(explode(',', $allowed_GP));
             $allowedGridTypes_GP = GeneralUtility::_GP('tx_gridelements_allowed_grid_types');
             if (!empty($allowedGridTypes_GP)) {
                 $allowed['gridelements_pi1'] = 1;
             }
             $this->removeDisallowedWizardItems($allowed, $wizardItems);
         } else {
             $allowed = null;
         }
         if (empty($allowed) || isset($allowed['gridelements_pi1'])) {
             $allowedGridTypes = array_flip(GeneralUtility::trimExplode(',', GeneralUtility::_GP('tx_gridelements_allowed_grid_types'), true));
             $excludeLayouts = $this->getExcludeLayouts($container, $parentObject);
             $gridItems = $this->layoutSetup->getLayoutWizardItems($parentObject->colPos, $excludeLayouts, $allowedGridTypes);
             $this->addGridItemsToWizard($gridItems, $wizardItems);
         }
         $this->addGridValuesToWizardItems($wizardItems, $container, $column);
         $this->removeEmptyHeadersFromWizard($wizardItems);
     }
 }