36 public $urltypes = array(
'',
'http://',
'ftp://',
'mailto:',
'https://');
152 '_PAGES_OVERLAY_UID',
153 '_PAGES_OVERLAY_LANGUAGE',
187 public function init($show_hidden) {
188 $this->where_groupAccess =
'';
189 $this->where_hid_del =
' AND pages.deleted=0 ';
191 $this->where_hid_del .=
'AND pages.hidden=0 ';
193 $this->where_hid_del .=
'AND pages.starttime<=' .
$GLOBALS[
'SIM_ACCESS_TIME'] .
' AND (pages.endtime=0 OR pages.endtime>' .
$GLOBALS[
'SIM_ACCESS_TIME'] .
') ';
196 if (!$this->versioningPreview) {
205 $this->where_hid_del =
' AND pages.deleted=0 ';
207 $this->where_hid_del .=
' AND (pages.t3ver_wsid=0 OR pages.t3ver_wsid=' . (int)$this->versioningWorkspaceId .
')';
231 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getPage'])) {
232 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getPage'] as $classRef) {
235 throw new \UnexpectedValueException(
'$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageHookInterface', 1251476766);
237 $hookObject->getPage_preProcess(
$uid, $disableGroupAccessCheck, $this);
241 $cacheKey = md5($accessCheck .
'-' . $this->where_hid_del .
'-' . $this->sys_language_uid);
242 if (is_array($this->cache_getPage[
$uid][$cacheKey])) {
243 return $this->cache_getPage[
$uid][$cacheKey];
246 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'pages',
'uid=' . (
int)
$uid . $this->where_hid_del . $accessCheck);
247 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
248 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
251 if (is_array($row)) {
269 if ($this->cache_getPage_noCheck[
$uid]) {
270 return $this->cache_getPage_noCheck[
$uid];
272 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'pages',
'uid=' . (
int)$uid . $this->
deleteClause(
'pages'));
273 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
274 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
278 if (is_array($row)) {
296 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'pages',
'pid=' . (
int)
$uid . $this->where_hid_del . $this->where_groupAccess,
'',
'sorting',
'1');
297 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
298 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
301 if (is_array($row)) {
317 $alias = strtolower($alias);
318 if ($this->cache_getPageIdFromAlias[$alias]) {
319 return $this->cache_getPageIdFromAlias[$alias];
321 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid',
'pages',
'alias=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($alias,
'pages') .
' AND pid>=0 AND pages.deleted=0');
323 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
324 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
326 $this->cache_getPageIdFromAlias[$alias] = $row[
'uid'];
329 $this->cache_getPageIdFromAlias[$alias] = 0;
348 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getPageOverlay'])) {
349 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getPageOverlay'] as $classRef) {
352 throw new \UnexpectedValueException(
'$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageOverlayHookInterface', 1269878881);
354 $hookObject->getPageOverlay_preProcess($pageInput, $lUid, $this);
360 if (is_array($pageInput)) {
362 $page_id = $pageInput[
'uid'];
367 $page_id = $pageInput;
369 if (count($fieldArr)) {
377 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(implode(
',', $fieldArr),
'pages_language_overlay',
'pid=' . (
int)$page_id .
' 378 AND sys_language_uid=' . (
int)$lUid . $this->
enableFields(
'pages_language_overlay'),
'',
'',
'1');
379 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
380 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
381 $this->
versionOL(
'pages_language_overlay', $row);
382 if (is_array($row)) {
383 $row[
'_PAGES_OVERLAY'] = TRUE;
384 $row[
'_PAGES_OVERLAY_UID'] = $row[
'uid'];
385 $row[
'_PAGES_OVERLAY_LANGUAGE'] = $lUid;
393 if (is_array($pageInput)) {
394 if (is_array($row)) {
396 foreach ($row as $fieldName => $fieldValue) {
397 if ($fieldName !==
'uid' && $fieldName !==
'pid') {
399 $pageInput[$fieldName] = $fieldValue;
407 return is_array($row) ? $row : array();
424 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getRecordOverlay'])) {
425 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getRecordOverlay'] as $classRef) {
428 throw new \UnexpectedValueException(
'$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetRecordOverlayHookInterface', 1269881658);
430 $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
433 if ($row[
'uid'] > 0 && ($row[
'pid'] > 0 || in_array($table, $this->tableNamesAllowedOnRootLevel))) {
434 if (
$GLOBALS[
'TCA'][$table] &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']) {
435 if (!
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerTable']) {
442 if ($sys_language_content > 0) {
444 if ($row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] <= 0) {
446 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*', $table,
'pid=' . (
int)$row[
'pid'] .
' AND ' .
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] .
'=' . (
int)$sys_language_content .
' AND ' .
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField'] .
'=' . (
int)$row[
'uid'] . $this->
enableFields($table),
'',
'',
'1');
447 $olrow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
448 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
451 if (is_array($olrow)) {
452 if (isset($olrow[
'_ORIG_uid'])) {
453 $row[
'_ORIG_uid'] = $olrow[
'_ORIG_uid'];
455 if (isset($olrow[
'_ORIG_pid'])) {
456 $row[
'_ORIG_pid'] = $olrow[
'_ORIG_pid'];
458 foreach ($row as $fN => $fV) {
459 if ($fN !=
'uid' && $fN !=
'pid' && isset($olrow[$fN])) {
461 $row[$fN] = $olrow[$fN];
463 } elseif ($fN ==
'uid') {
464 $row[
'_LOCALIZED_UID'] = $olrow[
'uid'];
467 } elseif ($OLmode ===
'hideNonTranslated' && $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] == 0) {
472 } elseif ($sys_language_content != $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']]) {
478 if ($row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] > 0) {
485 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getRecordOverlay'])) {
486 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'getRecordOverlay'] as $classRef) {
489 throw new \UnexpectedValueException(
'$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetRecordOverlayHookInterface', 1269881659);
491 $hookObject->getRecordOverlay_postProcess($table, $row, $sys_language_content, $OLmode, $this);
521 public function getMenu(
$uid, $fields =
'*', $sortField =
'sorting', $addWhere =
'', $checkShortcuts = TRUE) {
523 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery($fields,
'pages',
'pid=' . (
int)
$uid . $this->where_hid_del . $this->where_groupAccess .
' ' . $addWhere,
'', $sortField);
524 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
526 if (is_array($row)) {
528 $origUid = $row[
'uid'];
533 if (is_array($mount_info) && $mount_info[
'overlay']) {
536 $mp_row = $this->
getPage($mount_info[
'mount_pid']);
537 if (count($mp_row)) {
539 $row[
'_MP_PARAM'] = $mount_info[
'MPvar'];
545 if ($row[
'doktype'] == self::DOKTYPE_SHORTCUT && ($row[
'shortcut'] || $row[
'shortcut_mode']) && $checkShortcuts) {
546 if ($row[
'shortcut_mode'] == self::SHORTCUT_MODE_NONE) {
548 $searchField =
'uid';
549 $searchUid = (int)$row[
'shortcut'];
550 } elseif ($row[
'shortcut_mode'] == self::SHORTCUT_MODE_FIRST_SUBPAGE || $row[
'shortcut_mode'] == self::SHORTCUT_MODE_RANDOM_SUBPAGE) {
552 $searchField =
'pid';
555 $searchUid = (int)$row[
'shortcut'] ?: $row[
'uid'];
556 } elseif ($row[
'shortcut_mode'] == self::SHORTCUT_MODE_PARENT_PAGE) {
558 $searchField =
'uid';
559 $searchUid = $row[
'pid'];
561 $count =
$GLOBALS[
'TYPO3_DB']->exec_SELECTcountRows(
'uid',
'pages', $searchField .
'=' . $searchUid . $this->where_hid_del . $this->where_groupAccess .
' ' . $addWhere);
565 } elseif ($row[
'doktype'] == self::DOKTYPE_SHORTCUT && $checkShortcuts) {
570 if (is_array($row)) {
575 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
592 $domain = explode(
':', $domain);
593 $domain = strtolower(preg_replace(
'/\\.$/',
'', $domain[0]));
595 $path = trim(preg_replace(
'/\\/[^\\/]*$/',
'', $path));
598 $domain = preg_replace(
'/\\/*$/',
'', $domain);
599 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'pages.uid,sys_domain.redirectTo,sys_domain.redirectHttpStatusCode,sys_domain.prepend_params',
'pages,sys_domain',
'pages.uid=sys_domain.pid 600 AND sys_domain.hidden=0 601 AND (sys_domain.domainName=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($domain,
'sys_domain') .
' OR sys_domain.domainName=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr(($domain .
'/'),
'sys_domain') .
') ' . $this->where_hid_del . $this->where_groupAccess,
'',
'', 1);
602 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
603 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
605 if ($row[
'redirectTo']) {
606 $redirectUrl = $row[
'redirectTo'];
607 if ($row[
'prepend_params']) {
608 $redirectUrl = rtrim($redirectUrl,
'/');
609 $prependStr = ltrim(substr($request_uri, strlen($path)),
'/');
610 $redirectUrl .=
'/' . $prependStr;
612 $statusCode = (int)$row[
'redirectHttpStatusCode'];
613 if ($statusCode && defined(
'TYPO3\\CMS\\Core\\Utility\\HttpUtility::HTTP_STATUS_' . $statusCode)) {
649 return $rootline->get();
650 }
catch (\RuntimeException $ex) {
651 if ($ignoreMPerrors) {
652 $this->error_getRootLine = $ex->getMessage();
653 if (substr($this->error_getRootLine, -7) ==
'uid -1.') {
654 $this->error_getRootLine_failPid = -1;
658 } elseif ($ex->getCode() === 1343589451) {
679 for ($a = 0; $a < $c; $a++) {
680 if ($rl[$a][
'uid']) {
699 if ($pagerow[
'doktype'] == self::DOKTYPE_LINK && !$disable) {
700 $redirectTo = $this->urltypes[$pagerow[
'urltype']] . $pagerow[
'url'];
702 $uI = parse_url($redirectTo);
704 if (!$uI[
'scheme'] && $redirectTo[0] !==
'/') {
725 public function getMountPointInfo($pageId, $pageRec = FALSE, $prevMountPids = array(), $firstPageUid = 0) {
727 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'FE'][
'enable_mount_pids']) {
728 if (isset($this->cache_getMountPointInfo[$pageId])) {
729 return $this->cache_getMountPointInfo[$pageId];
732 if (!is_array($pageRec)) {
733 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid,pid,doktype,mount_pid,mount_pid_ol,t3ver_state',
'pages',
'uid=' . (
int)$pageId .
' AND pages.deleted=0 AND pages.doktype<>255');
734 $pageRec =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
735 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
741 if (!$firstPageUid) {
742 $firstPageUid = $pageRec[
'uid'];
745 $mount_pid = (int)$pageRec[
'mount_pid'];
746 if (is_array($pageRec) && $pageRec[
'doktype'] == self::DOKTYPE_MOUNTPOINT && $mount_pid > 0 && !in_array($mount_pid, $prevMountPids)) {
748 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid,pid,doktype,mount_pid,mount_pid_ol,t3ver_state',
'pages',
'uid=' . $mount_pid .
' AND pages.deleted=0 AND pages.doktype<>255');
749 $mountRec =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
750 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
752 if (is_array($mountRec)) {
754 $prevMountPids[] = $mount_pid;
755 $recursiveMountPid = $this->
getMountPointInfo($mount_pid, $mountRec, $prevMountPids, $firstPageUid);
757 $result = $recursiveMountPid ?: array(
758 'mount_pid' => $mount_pid,
759 'overlay' => $pageRec[
'mount_pid_ol'],
760 'MPvar' => $mount_pid .
'-' . $firstPageUid,
761 'mount_point_rec' => $pageRec,
762 'mount_pid_rec' => $mountRec
770 $this->cache_getMountPointInfo[$pageId] =
$result;
794 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
795 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
798 if (is_array($row)) {
800 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid',
'pages',
'uid=' . (
int)$row[
'pid'] . $this->
enableFields(
'pages'));
801 $numRows =
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res);
802 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
831 if ((is_array(
$GLOBALS[
'TCA'][$table]) || $table ==
'pages') &&
$uid > 0) {
833 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
834 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
839 if (is_array($row)) {
859 public function getRecordsByField($theTable, $theField, $theValue, $whereClause =
'', $groupBy =
'', $orderBy =
'', $limit =
'') {
860 if (is_array(
$GLOBALS[
'TCA'][$theTable])) {
861 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*', $theTable, $theField .
'=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($theValue, $theTable) . $this->
deleteClause($theTable) .
' ' . $whereClause, $groupBy, $orderBy, $limit);
863 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
864 if (is_array($row)) {
868 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
893 static public function getHash($hash, $expTime = 0) {
896 $cacheEntry = $contentHashCache->get($hash);
898 $hashContent = $cacheEntry;
917 static public function storeHash($hash, $data, $ident, $lifetime = 0) {
918 GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache(
'cache_hash')->set($hash, $data, array(
'ident_' . $ident), (
int)$lifetime);
933 if ($table ===
'pages') {
934 return ' AND pages.deleted=0';
936 return $GLOBALS[
'TCA'][$table][
'ctrl'][
'delete'] ?
' AND ' . $table .
'.' .
$GLOBALS[
'TCA'][$table][
'ctrl'][
'delete'] .
'=0' :
'';
958 public function enableFields($table, $show_hidden = -1, $ignore_array = array(), $noVersionPreview = FALSE) {
959 if ($show_hidden === -1 && is_object(
$GLOBALS[
'TSFE'])) {
962 $show_hidden = $table ==
'pages' ?
$GLOBALS[
'TSFE']->showHiddenPage :
$GLOBALS[
'TSFE']->showHiddenRecords;
964 if ($show_hidden === -1) {
968 $ctrl =
$GLOBALS[
'TCA'][$table][
'ctrl'];
970 if (is_array($ctrl)) {
972 if ($ctrl[
'delete']) {
973 $query .=
' AND ' . $table .
'.' . $ctrl[
'delete'] .
'=0';
975 if ($ctrl[
'versioningWS']) {
976 if (!$this->versioningPreview) {
981 if ($table !==
'pages') {
985 $table .
'.t3ver_wsid=0 OR ' .
986 $table .
'.t3ver_wsid=' . (int)$this->versioningWorkspaceId .
992 if (!$noVersionPreview && empty($ignore_array[
'pid'])) {
993 $query .=
' AND ' . $table .
'.pid<>-1';
998 if (is_array($ctrl[
'enablecolumns'])) {
1001 if (!$this->versioningPreview || !$ctrl[
'versioningWS'] || $noVersionPreview) {
1002 if ($ctrl[
'enablecolumns'][
'disabled'] && !$show_hidden && !$ignore_array[
'disabled']) {
1003 $field = $table .
'.' . $ctrl[
'enablecolumns'][
'disabled'];
1004 $query .=
' AND ' . $field .
'=0';
1006 if ($ctrl[
'enablecolumns'][
'starttime'] && !$ignore_array[
'starttime']) {
1007 $field = $table .
'.' . $ctrl[
'enablecolumns'][
'starttime'];
1008 $query .=
' AND ' . $field .
'<=' .
$GLOBALS[
'SIM_ACCESS_TIME'];
1010 if ($ctrl[
'enablecolumns'][
'endtime'] && !$ignore_array[
'endtime']) {
1011 $field = $table .
'.' . $ctrl[
'enablecolumns'][
'endtime'];
1012 $query .=
' AND (' . $field .
'=0 OR ' . $field .
'>' .
$GLOBALS[
'SIM_ACCESS_TIME'] .
')';
1014 if ($ctrl[
'enablecolumns'][
'fe_group'] && !$ignore_array[
'fe_group']) {
1015 $field = $table .
'.' . $ctrl[
'enablecolumns'][
'fe_group'];
1021 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'addEnableColumns'])) {
1024 'show_hidden' => $show_hidden,
1025 'ignore_array' => $ignore_array,
1028 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_page.php'][
'addEnableColumns'] as $_funcRef) {
1035 throw new \InvalidArgumentException(
'There is no entry in the $TCA array for the table "' . $table .
'". This means that the function enableFields() is ' .
'called with an invalid table name as argument.', 1283790586);
1052 $orChecks = array();
1054 $orChecks[] = $field .
'=\'\'';
1056 $orChecks[] = $field .
' IS NULL';
1058 $orChecks[] = $field .
'=\'0\'';
1059 foreach ($memberGroups as $value) {
1060 $orChecks[] =
$GLOBALS[
'TYPO3_DB']->listQuery($field, $value, $table);
1062 return ' AND (' . implode(
' OR ', $orChecks) .
')';
1092 if ($this->versioningPreview && is_array($rr) && $rr[
'pid'] == -1 && ($table ==
'pages' ||
$GLOBALS[
'TCA'][$table][
'ctrl'][
'versioningWS'])) {
1095 if (isset($rr[
't3ver_oid']) && isset($rr[
't3ver_wsid'])) {
1097 $oid = $rr[
't3ver_oid'];
1098 $wsid = $rr[
't3ver_wsid'];
1102 $newPidRec = $this->
getRawRecord($table, $rr[
'uid'],
't3ver_oid,t3ver_wsid', TRUE);
1103 if (is_array($newPidRec)) {
1104 $oid = $newPidRec[
't3ver_oid'];
1105 $wsid = $newPidRec[
't3ver_wsid'];
1110 if ($oid && ((
int)$this->versioningWorkspaceId === 0 && $this->
checkWorkspaceAccess($wsid) || (
int)$wsid === (
int)$this->versioningWorkspaceId)) {
1111 $oidRec = $this->
getRawRecord($table, $oid,
'pid', TRUE);
1112 if (is_array($oidRec)) {
1118 $rr[
'_ORIG_pid'] = $rr[
'pid'];
1119 $rr[
'pid'] = $oidRec[
'pid'];
1125 $rr[
'pid'] = $movePlhRec[
'pid'];
1150 public function versionOL($table, &$row, $unsetMovePointers = FALSE, $bypassEnableFieldsCheck = FALSE) {
1151 if ($this->versioningPreview && is_array($row)) {
1154 $movePldSwap = $this->
movePlhOL($table, $row);
1159 if ($wsAlt = $this->
getWorkspaceVersionOfRecord($this->versioningWorkspaceId, $table, $row[
'uid'], $fieldNames, $bypassEnableFieldsCheck)) {
1160 if (is_array($wsAlt)) {
1164 $wsAlt[
'_ORIG_pid'] = $wsAlt[
'pid'];
1166 $wsAlt[
'pid'] = $row[
'pid'];
1171 $wsAlt[
'_ORIG_uid'] = $wsAlt[
'uid'];
1172 $wsAlt[
'uid'] = $row[
'uid'];
1174 if ($table ===
'pages') {
1175 $wsAlt[
'alias'] = $row[
'alias'];
1195 ) && $unsetMovePointers
1206 if ($wsAlt <= -1 ||
VersionState::cast($row[
't3ver_state'])->indicatesPlaceholder()) {
1229 || (
int)
$GLOBALS[
'TCA'][$table][
'ctrl'][
'versioningWS'] >= 2
1234 if (!isset($row[
't3ver_move_id'])) {
1235 $moveIDRec = $this->
getRawRecord($table, $row[
'uid'],
't3ver_move_id', TRUE);
1236 $moveID = $moveIDRec[
't3ver_move_id'];
1238 $moveID = $row[
't3ver_move_id'];
1243 $origRow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
1244 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
1265 if ($this->versioningPreview) {
1266 $workspace = (int)$this->versioningWorkspaceId;
1267 if (($table ==
'pages' || (
int)
$GLOBALS[
'TCA'][$table][
'ctrl'][
'versioningWS'] >= 2) && $workspace !== 0) {
1269 $row =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow($fields, $table,
'pid<>-1 AND 1271 t3ver_move_id=' . (
int)
$uid .
' AND 1272 t3ver_wsid=' . (
int)$workspace . $this->
deleteClause($table));
1273 if (is_array($row)) {
1294 if ($workspace !== 0 && !empty(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'versioningWS'])) {
1295 $workspace = (int)$workspace;
1299 if ($table ==
'pages') {
1300 $enFields = $this->versioningPreview_where_hid_del;
1302 $enFields = $this->
enableFields($table, -1, array(), TRUE);
1305 $newrow =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow($fields, $table,
'pid=-1 AND 1306 t3ver_oid=' .
$uid .
' AND 1307 t3ver_wsid=' . $workspace . $this->
deleteClause($table));
1310 if (is_array($newrow)) {
1311 if ($bypassEnableFieldsCheck ||
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'uid', $table,
'pid=-1 AND 1312 t3ver_oid=' .
$uid .
' AND 1313 t3ver_wsid=' . $workspace . $enFields)) {
1323 if ($bypassEnableFieldsCheck ||
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'uid', $table,
'uid=' .
$uid . $enFields)) {
1345 if (!
$GLOBALS[
'BE_USER'] || !\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(
'workspaces')) {
1348 if (isset($this->workspaceCache[$wsid])) {
1349 $ws = $this->workspaceCache[$wsid];
1353 $ws =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'*',
'sys_workspace',
'uid=' . (
int)$wsid .
' AND deleted=0');
1354 if (!is_array($ws)) {
1360 $ws =
$GLOBALS[
'BE_USER']->checkWorkspace($ws);
1361 $this->workspaceCache[$wsid] = $ws;
1363 return $ws[
'_ACCESS'] !=
'';
1374 public function getFileReferences($tableName, $fieldName, array $element) {
1377 $currentId = !empty($element[
'uid']) ? $element[
'uid'] : 0;
1380 $references = $fileRepository->findByRelation($tableName, $fieldName, $currentId);
1382 $localizedId = NULL;
1383 if (isset($element[
'_LOCALIZED_UID'])) {
1384 $localizedId = $element[
'_LOCALIZED_UID'];
1385 } elseif (isset($element[
'_PAGES_OVERLAY_UID'])) {
1386 $localizedId = $element[
'_PAGES_OVERLAY_UID'];
1389 if (!empty(
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'transForeignTable'])) {
1390 $tableName =
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'transForeignTable'];
1393 $isTableLocalizable = (
1394 !empty(
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'languageField'])
1395 && !empty(
$GLOBALS[
'TCA'][$tableName][
'ctrl'][
'transOrigPointerField'])
1397 if ($isTableLocalizable && $localizedId !== NULL) {
1398 $localizedReferences = $fileRepository->findByRelation($tableName, $fieldName, $localizedId);
1399 $localizedReferencesValue = $localizedReferences ?:
'';
1401 $references = $localizedReferences;
1416 foreach ($this->computedPropertyNames as $computedPropertyName) {
1417 if (array_key_exists($computedPropertyName, $row)) {
1418 unset($row[$computedPropertyName]);
1433 $l10n_mode = isset(
$GLOBALS[
'TCA'][$table][
'columns'][$field][
'l10n_mode'])
1434 ?
$GLOBALS[
'TCA'][$table][
'columns'][$field][
'l10n_mode']
1437 $shouldFieldBeOverlaid = TRUE;
1439 if ($l10n_mode ===
'exclude') {
1440 $shouldFieldBeOverlaid = FALSE;
1441 } elseif ($l10n_mode ===
'mergeIfNotBlank') {
1442 $checkValue = $value;
1445 if (empty($value) &&
$GLOBALS[
'TCA'][$table][
'columns'][$field][
'config'][
'type'] ===
'group') {
1449 if ($checkValue === array() || !is_array($checkValue) && trim($checkValue) ===
'') {
1450 $shouldFieldBeOverlaid = FALSE;
1454 return $shouldFieldBeOverlaid;
getRecordOverlay($table, $row, $sys_language_content, $OLmode='')
const SHORTCUT_MODE_PARENT_PAGE
getMountPointInfo($pageId, $pageRec=FALSE, $prevMountPids=array(), $firstPageUid=0)
static getHash($hash, $expTime=0)
const SHORTCUT_MODE_FIRST_SUBPAGE
getRecordsByField($theTable, $theField, $theValue, $whereClause='', $groupBy='', $orderBy='', $limit='')
enableFields($table, $show_hidden=-1, $ignore_array=array(), $noVersionPreview=FALSE)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static getIndpEnv($getEnvName)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
getMultipleGroupsWhereClause($field, $table)
static makeInstance($className)
checkWorkspaceAccess($wsid)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
getExtURL($pagerow, $disable=0)
getDomainStartPage($domain, $path='', $request_uri='')
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
const SHORTCUT_MODE_RANDOM_SUBPAGE
getRootLine($uid, $MP='', $ignoreMPerrors=FALSE)
fixVersioningPid($table, &$rr)
getPageOverlay($pageInput, $lUid=-1)
getPathFromRootline($rl, $len=20)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields=' *', $bypassEnableFieldsCheck=FALSE)
$cache_getPageIdFromAlias
static storeHash($hash, $data, $ident, $lifetime=0)
shouldFieldBeOverlaid($table, $field, $value)
getPage($uid, $disableGroupAccessCheck=FALSE)
getPageIdFromAlias($alias)
getMovePlaceholder($table, $uid, $fields=' *')
checkRecord($table, $uid, $checkPage=0)
const DOKTYPE_BE_USER_SECTION
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
static fixed_lgd_cs($string, $chars, $appendString='...')
getRawRecord($table, $uid, $fields=' *', $noWSOL=FALSE)
getMenu($uid, $fields=' *', $sortField='sorting', $addWhere='', $checkShortcuts=TRUE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
$error_getRootLine_failPid
$tableNamesAllowedOnRootLevel
versionOL($table, &$row, $unsetMovePointers=FALSE, $bypassEnableFieldsCheck=FALSE)
purgeComputedProperties(array $row)