Beispiel #1
0
 /**
  * ItemProcFunc for colpos items
  *
  * @param array $params : The array of parameters that is used to render the item list
  *
  * @return void
  */
 public function itemsProcFunc(&$params)
 {
     parent::init();
     if ($params['row']['pid'] > 0) {
         $ContentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
         $params['items'] = $this->addColPosListLayoutItems($params['row']['pid'], $params['items'], $ContentType, $params['row']['tx_gridelements_container']);
     } else {
         // negative uid_pid values indicate that the element has been inserted after an existing element
         // so there is no pid to get the backendLayout for and we have to get that first
         $existingElement = $this->databaseConnection->exec_SELECTgetSingleRow('pid, CType, tx_gridelements_container', 'tt_content', 'uid=' . -(int) $params['row']['pid']);
         if ($existingElement['pid'] > 0) {
             $params['items'] = $this->addColPosListLayoutItems($existingElement['pid'], $params['items'], $existingElement['CType'], $existingElement['tx_gridelements_container']);
         }
     }
 }
Beispiel #2
0
 /**
  * initializes this class
  *
  * @param int $pageUid
  */
 public function init($pageUid)
 {
     parent::init();
     if (!$this->layoutSetup instanceof LayoutSetup) {
         $this->layoutSetup = GeneralUtility::makeInstance(LayoutSetup::class)->init($pageUid);
     }
 }