Exemplo n.º 1
0
 /**
  * Collects tt_content data from a single tt_content element
  *
  * @param PageLayoutView $parentObject : The paren object that triggered this hook
  * @param int $colPos : The column position to collect the items for
  * @param array $row : The current data row for the container item
  * @param string $showHidden : query String containing enable fields
  * @param string $deleteClause : query String to check for deleted items
  *
  * @return array            collected items for the given column
  */
 public function collectItemsForColumn(PageLayoutView $parentObject, &$colPos, &$row, &$showHidden, &$deleteClause)
 {
     // Due to the pid being "NOT USED" in makeQueryArray we have to set pidSelect here
     $originalPidSelect = $parentObject->pidSelect;
     $helper = Helper::getInstance();
     $specificIds = $helper->getSpecificIds($row);
     $parentObject->pidSelect = 'pid = ' . $row['pid'];
     if (!$parentObject->tt_contentConfig['languageMode']) {
         $showLanguage = ' AND (sys_language_uid = -1 OR sys_language_uid=' . $parentObject->tt_contentConfig['sys_language_uid'] . ')';
     } else {
         if ($row['sys_language_uid'] > 0) {
             $showLanguage = ' AND sys_language_uid=' . $row['sys_language_uid'];
         } else {
             $showLanguage = '';
         }
     }
     if ($helper->getBackendUser()->workspace > 0 && $row['t3ver_wsid'] > 0) {
         $where = 'AND t3ver_wsid = ' . $row['t3ver_wsid'];
     }
     $where .= ' AND colPos = -1 AND tx_gridelements_container IN (' . $row['uid'] . ',' . $specificIds['uid'] . ') AND tx_gridelements_columns=' . $colPos . $showHidden . $deleteClause . $showLanguage;
     $queryParts = $parentObject->makeQueryArray('tt_content', $row['pid'], $where);
     // Due to the pid being "NOT USED" in makeQueryArray we have to reset pidSelect here
     $parentObject->pidSelect = $originalPidSelect;
     $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
     return $parentObject->getResult($result);
 }
Exemplo n.º 2
0
 /**
  * @param PageLayoutView $view
  * @param array $row
  * @param string $area
  * @return array
  */
 protected function getRecords(PageLayoutView $view, array $row, $area)
 {
     // The following solution is half lifted from \TYPO3\CMS\Backend\View\PageLayoutView::getContentRecordsPerColumn
     // and relies on TYPO3 core query parts for enable-clause-, language- and versioning placeholders. All that needs
     // to be done after this, is filter the array according to moved/deleted placeholders since TYPO3 will not remove
     // records based on them having remove placeholders.
     $condition = "AND tx_flux_parent = '" . $row['uid'] . "' AND tx_flux_column = '" . $area . "' ";
     $condition .= "AND colPos = '" . ContentService::COLPOS_FLUXCONTENT . "' ";
     $condition .= 1 === $view->tt_contentConfig['showHidden'] ? '' : 'AND hidden = 0 ';
     $queryParts = $view->makeQueryArray('tt_content', $row['pid'], $condition);
     $result = $this->getDatabaseConnection()->exec_SELECT_queryArray($queryParts);
     $rows = $view->getResult($result);
     $rows = $this->processRecordOverlays($rows, $view);
     return $rows;
 }