TYPO3 CMS  TYPO3_6-2
PageRepository.php
Go to the documentation of this file.
1 <?php
3 
19 
31 
36  public $urltypes = array('', 'http://', 'ftp://', 'mailto:', 'https://');
37 
46  public $where_hid_del = ' AND pages.deleted=0';
47 
54  public $where_groupAccess = '';
55 
60  public $sys_language_uid = 0;
61 
62  // Versioning preview related
63 
72  public $versioningPreview = FALSE;
73 
81 
86  public $workspaceCache = array();
87 
88  // Internal, dynamic
89 
96  public $error_getRootLine = '';
97 
105 
106  // Internal caching
107 
111  protected $cache_getRootLine = array();
112 
116  protected $cache_getPage = array();
117 
121  protected $cache_getPage_noCheck = array();
122 
126  protected $cache_getPageIdFromAlias = array();
127 
131  protected $cache_getMountPointInfo = array();
132 
136  protected $tableNamesAllowedOnRootLevel = array(
137  'sys_file_metadata',
138  'sys_category',
139  );
140 
146  protected $computedPropertyNames = array(
147  '_LOCALIZED_UID',
148  '_MP_PARAM',
149  '_ORIG_uid',
150  '_ORIG_pid',
151  '_PAGES_OVERLAY',
152  '_PAGES_OVERLAY_UID',
153  '_PAGES_OVERLAY_LANGUAGE',
154  );
155 
159  const DOKTYPE_DEFAULT = 1;
160  const DOKTYPE_LINK = 3;
161  const DOKTYPE_SHORTCUT = 4;
164  const DOKTYPE_SPACER = 199;
165  const DOKTYPE_SYSFOLDER = 254;
166  const DOKTYPE_RECYCLER = 255;
167 
175 
187  public function init($show_hidden) {
188  $this->where_groupAccess = '';
189  $this->where_hid_del = ' AND pages.deleted=0 ';
190  if (!$show_hidden) {
191  $this->where_hid_del .= 'AND pages.hidden=0 ';
192  }
193  $this->where_hid_del .= 'AND pages.starttime<=' . $GLOBALS['SIM_ACCESS_TIME'] . ' AND (pages.endtime=0 OR pages.endtime>' . $GLOBALS['SIM_ACCESS_TIME'] . ') ';
194  // Filter out new/deleted place-holder pages in case we are NOT in a
195  // versioning preview (that means we are online!)
196  if (!$this->versioningPreview) {
197  $this->where_hid_del .= ' AND NOT pages.t3ver_state>' . new VersionState(VersionState::DEFAULT_STATE);
198  } else {
199  // For version previewing, make sure that enable-fields are not
200  // de-selecting hidden pages - we need versionOL() to unset them only
201  // if the overlay record instructs us to.
202  // Copy where_hid_del to other variable (used in relation to versionOL())
203  $this->versioningPreview_where_hid_del = $this->where_hid_del;
204  // Clear where_hid_del
205  $this->where_hid_del = ' AND pages.deleted=0 ';
206  // Restrict to live and current workspaces
207  $this->where_hid_del .= ' AND (pages.t3ver_wsid=0 OR pages.t3ver_wsid=' . (int)$this->versioningWorkspaceId . ')';
208  }
209  }
210 
211  /**************************
212  *
213  * Selecting page records
214  *
215  **************************/
216 
229  public function getPage($uid, $disableGroupAccessCheck = FALSE) {
230  // Hook to manipulate the page uid for special overlay handling
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) {
233  $hookObject = GeneralUtility::getUserObj($classRef);
234  if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface) {
235  throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageHookInterface', 1251476766);
236  }
237  $hookObject->getPage_preProcess($uid, $disableGroupAccessCheck, $this);
238  }
239  }
240  $accessCheck = $disableGroupAccessCheck ? '' : $this->where_groupAccess;
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];
244  }
245  $result = array();
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);
249  if ($row) {
250  $this->versionOL('pages', $row);
251  if (is_array($row)) {
252  $result = $this->getPageOverlay($row);
253  }
254  }
255  $this->cache_getPage[$uid][$cacheKey] = $result;
256  return $result;
257  }
258 
268  public function getPage_noCheck($uid) {
269  if ($this->cache_getPage_noCheck[$uid]) {
270  return $this->cache_getPage_noCheck[$uid];
271  }
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);
275  $result = array();
276  if ($row) {
277  $this->versionOL('pages', $row);
278  if (is_array($row)) {
279  $result = $this->getPageOverlay($row);
280  }
281  }
282  $this->cache_getPage_noCheck[$uid] = $result;
283  return $result;
284  }
285 
294  public function getFirstWebPage($uid) {
295  $output = '';
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);
299  if ($row) {
300  $this->versionOL('pages', $row);
301  if (is_array($row)) {
302  $output = $this->getPageOverlay($row);
303  }
304  }
305  return $output;
306  }
307 
316  public function getPageIdFromAlias($alias) {
317  $alias = strtolower($alias);
318  if ($this->cache_getPageIdFromAlias[$alias]) {
319  return $this->cache_getPageIdFromAlias[$alias];
320  }
321  $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'alias=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($alias, 'pages') . ' AND pid>=0 AND pages.deleted=0');
322  // "AND pid>=0" because of versioning (means that aliases sent MUST be online!)
323  $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
324  $GLOBALS['TYPO3_DB']->sql_free_result($res);
325  if ($row) {
326  $this->cache_getPageIdFromAlias[$alias] = $row['uid'];
327  return $row['uid'];
328  }
329  $this->cache_getPageIdFromAlias[$alias] = 0;
330  return 0;
331  }
332 
342  public function getPageOverlay($pageInput, $lUid = -1) {
343  // Initialize:
344  if ($lUid < 0) {
345  $lUid = $this->sys_language_uid;
346  }
347  $row = NULL;
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) {
350  $hookObject = GeneralUtility::getUserObj($classRef);
351  if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetPageOverlayHookInterface) {
352  throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageOverlayHookInterface', 1269878881);
353  }
354  $hookObject->getPageOverlay_preProcess($pageInput, $lUid, $this);
355  }
356  }
357  // If language UID is different from zero, do overlay:
358  if ($lUid) {
359  $fieldArr = GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields'], TRUE);
360  if (is_array($pageInput)) {
361  // Was the whole record
362  $page_id = $pageInput['uid'];
363  // Make sure that only fields which exist in the incoming record are overlaid!
364  $fieldArr = array_intersect($fieldArr, array_keys($this->purgeComputedProperties($pageInput)));
365  } else {
366  // Was the id
367  $page_id = $pageInput;
368  }
369  if (count($fieldArr)) {
370  // NOTE to enabledFields('pages_language_overlay'):
371  // Currently the showHiddenRecords of TSFE set will allow
372  // pages_language_overlay records to be selected as they are
373  // child-records of a page.
374  // However you may argue that the showHiddenField flag should
375  // determine this. But that's not how it's done right now.
376  // Selecting overlay record:
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;
386  // Unset vital fields that are NOT allowed to be overlaid:
387  unset($row['uid']);
388  unset($row['pid']);
389  }
390  }
391  }
392  // Create output:
393  if (is_array($pageInput)) {
394  if (is_array($row)) {
395  // Overwrite the original field with the overlay
396  foreach ($row as $fieldName => $fieldValue) {
397  if ($fieldName !== 'uid' && $fieldName !== 'pid') {
398  if ($this->shouldFieldBeOverlaid('pages_language_overlay', $fieldName, $fieldValue)) {
399  $pageInput[$fieldName] = $fieldValue;
400  }
401  }
402  }
403  }
404  return $pageInput;
405  } else {
406  // Always an array in return
407  return is_array($row) ? $row : array();
408  }
409  }
410 
423  public function getRecordOverlay($table, $row, $sys_language_content, $OLmode = '') {
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) {
426  $hookObject = GeneralUtility::getUserObj($classRef);
427  if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface) {
428  throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetRecordOverlayHookInterface', 1269881658);
429  }
430  $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
431  }
432  }
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']) {
436  // Will not be able to work with other tables (Just didn't implement it yet;
437  // Requires a scan over all tables [ctrl] part for first FIND the table that
438  // carries localization information for this table (which could even be more
439  // than a single table) and then use that. Could be implemented, but obviously
440  // takes a little more....) Will try to overlay a record only if the
441  // sys_language_content value is larger than zero.
442  if ($sys_language_content > 0) {
443  // Must be default language or [All], otherwise no overlaying:
444  if ($row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] <= 0) {
445  // Select overlay record:
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);
449  $this->versionOL($table, $olrow);
450  // Merge record content by traversing all fields:
451  if (is_array($olrow)) {
452  if (isset($olrow['_ORIG_uid'])) {
453  $row['_ORIG_uid'] = $olrow['_ORIG_uid'];
454  }
455  if (isset($olrow['_ORIG_pid'])) {
456  $row['_ORIG_pid'] = $olrow['_ORIG_pid'];
457  }
458  foreach ($row as $fN => $fV) {
459  if ($fN != 'uid' && $fN != 'pid' && isset($olrow[$fN])) {
460  if ($this->shouldFieldBeOverlaid($table, $fN, $olrow[$fN])) {
461  $row[$fN] = $olrow[$fN];
462  }
463  } elseif ($fN == 'uid') {
464  $row['_LOCALIZED_UID'] = $olrow['uid'];
465  }
466  }
467  } elseif ($OLmode === 'hideNonTranslated' && $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] == 0) {
468  // Unset, if non-translated records should be hidden. ONLY done if the source
469  // record really is default language and not [All] in which case it is allowed.
470  unset($row);
471  }
472  } elseif ($sys_language_content != $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']]) {
473  unset($row);
474  }
475  } else {
476  // When default language is displayed, we never want to return a record carrying
477  // another language!
478  if ($row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] > 0) {
479  unset($row);
480  }
481  }
482  }
483  }
484  }
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) {
487  $hookObject = GeneralUtility::getUserObj($classRef);
488  if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface) {
489  throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetRecordOverlayHookInterface', 1269881659);
490  }
491  $hookObject->getRecordOverlay_postProcess($table, $row, $sys_language_content, $OLmode, $this);
492  }
493  }
494  return $row;
495  }
496 
497  /************************************************
498  *
499  * Page related: Menu, Domain record, Root line
500  *
501  ************************************************/
502 
521  public function getMenu($uid, $fields = '*', $sortField = 'sorting', $addWhere = '', $checkShortcuts = TRUE) {
522  $output = array();
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)) {
525  $this->versionOL('pages', $row, TRUE);
526  if (is_array($row)) {
527  // Keep mount point:
528  $origUid = $row['uid'];
529  // $row MUST have "uid", "pid", "doktype", "mount_pid", "mount_pid_ol" fields
530  // in it
531  $mount_info = $this->getMountPointInfo($origUid, $row);
532  // There is a valid mount point.
533  if (is_array($mount_info) && $mount_info['overlay']) {
534  // Using "getPage" is OK since we need the check for enableFields AND for type 2
535  // of mount pids we DO require a doktype < 200!
536  $mp_row = $this->getPage($mount_info['mount_pid']);
537  if (count($mp_row)) {
538  $row = $mp_row;
539  $row['_MP_PARAM'] = $mount_info['MPvar'];
540  } else {
541  unset($row);
542  }
543  }
544  // If shortcut, look up if the target exists and is currently visible
545  if ($row['doktype'] == self::DOKTYPE_SHORTCUT && ($row['shortcut'] || $row['shortcut_mode']) && $checkShortcuts) {
546  if ($row['shortcut_mode'] == self::SHORTCUT_MODE_NONE) {
547  // No shortcut_mode set, so target is directly set in $row['shortcut']
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) {
551  // Check subpages - first subpage or random subpage
552  $searchField = 'pid';
553  // If a shortcut mode is set and no valid page is given to select subpags
554  // from use the actual page.
555  $searchUid = (int)$row['shortcut'] ?: $row['uid'];
556  } elseif ($row['shortcut_mode'] == self::SHORTCUT_MODE_PARENT_PAGE) {
557  // Shortcut to parent page
558  $searchField = 'uid';
559  $searchUid = $row['pid'];
560  }
561  $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'pages', $searchField . '=' . $searchUid . $this->where_hid_del . $this->where_groupAccess . ' ' . $addWhere);
562  if (!$count) {
563  unset($row);
564  }
565  } elseif ($row['doktype'] == self::DOKTYPE_SHORTCUT && $checkShortcuts) {
566  // Neither shortcut target nor mode is set. Remove the page from the menu.
567  unset($row);
568  }
569  // Add to output array after overlaying language:
570  if (is_array($row)) {
571  $output[$origUid] = $this->getPageOverlay($row);
572  }
573  }
574  }
575  $GLOBALS['TYPO3_DB']->sql_free_result($res);
576  return $output;
577  }
578 
591  public function getDomainStartPage($domain, $path = '', $request_uri = '') {
592  $domain = explode(':', $domain);
593  $domain = strtolower(preg_replace('/\\.$/', '', $domain[0]));
594  // Removing extra trailing slashes
595  $path = trim(preg_replace('/\\/[^\\/]*$/', '', $path));
596  // Appending to domain string
597  $domain .= $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);
604  if ($row) {
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;
611  }
612  $statusCode = (int)$row['redirectHttpStatusCode'];
613  if ($statusCode && defined('TYPO3\\CMS\\Core\\Utility\\HttpUtility::HTTP_STATUS_' . $statusCode)) {
614  \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl, constant('TYPO3\\CMS\\Core\\Utility\\HttpUtility::HTTP_STATUS_' . $statusCode));
615  } else {
616  \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl, \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_301);
617  }
618  die;
619  } else {
620  return $row['uid'];
621  }
622  }
623  }
624 
646  public function getRootLine($uid, $MP = '', $ignoreMPerrors = FALSE) {
647  $rootline = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\RootlineUtility', $uid, $MP, $this);
648  try {
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;
655  }
656  return array();
658  } elseif ($ex->getCode() === 1343589451) {
659  return array();
660  }
661  throw $ex;
662  }
663  }
664 
675  public function getPathFromRootline($rl, $len = 20) {
676  if (is_array($rl)) {
677  $c = count($rl);
678  $path = '';
679  for ($a = 0; $a < $c; $a++) {
680  if ($rl[$a]['uid']) {
681  $path .= '/' . GeneralUtility::fixed_lgd_cs(strip_tags($rl[$a]['title']), $len);
682  }
683  }
684  return $path;
685  }
686  }
687 
698  public function getExtURL($pagerow, $disable = 0) {
699  if ($pagerow['doktype'] == self::DOKTYPE_LINK && !$disable) {
700  $redirectTo = $this->urltypes[$pagerow['urltype']] . $pagerow['url'];
701  // If relative path, prefix Site URL:
702  $uI = parse_url($redirectTo);
703  // Relative path assumed now.
704  if (!$uI['scheme'] && $redirectTo[0] !== '/') {
705  $redirectTo = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $redirectTo;
706  }
707  return $redirectTo;
708  }
709  }
710 
725  public function getMountPointInfo($pageId, $pageRec = FALSE, $prevMountPids = array(), $firstPageUid = 0) {
726  $result = FALSE;
727  if ($GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids']) {
728  if (isset($this->cache_getMountPointInfo[$pageId])) {
729  return $this->cache_getMountPointInfo[$pageId];
730  }
731  // Get pageRec if not supplied:
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);
736  // Only look for version overlay if page record is not supplied; This assumes
737  // that the input record is overlaid with preview version, if any!
738  $this->versionOL('pages', $pageRec);
739  }
740  // Set first Page uid:
741  if (!$firstPageUid) {
742  $firstPageUid = $pageRec['uid'];
743  }
744  // Look for mount pid value plus other required circumstances:
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)) {
747  // Get the mount point record (to verify its general existence):
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);
751  $this->versionOL('pages', $mountRec);
752  if (is_array($mountRec)) {
753  // Look for recursive mount point:
754  $prevMountPids[] = $mount_pid;
755  $recursiveMountPid = $this->getMountPointInfo($mount_pid, $mountRec, $prevMountPids, $firstPageUid);
756  // Return mount point information:
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
763  );
764  } else {
765  // Means, there SHOULD have been a mount point, but there was none!
766  $result = -1;
767  }
768  }
769  }
770  $this->cache_getMountPointInfo[$pageId] = $result;
771  return $result;
772  }
773 
774  /********************************
775  *
776  * Selecting records in general
777  *
778  ********************************/
779 
790  public function checkRecord($table, $uid, $checkPage = 0) {
791  $uid = (int)$uid;
792  if (is_array($GLOBALS['TCA'][$table]) && $uid > 0) {
793  $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $table, 'uid = ' . $uid . $this->enableFields($table));
794  $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
795  $GLOBALS['TYPO3_DB']->sql_free_result($res);
796  if ($row) {
797  $this->versionOL($table, $row);
798  if (is_array($row)) {
799  if ($checkPage) {
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);
803  if ($numRows > 0) {
804  return $row;
805  } else {
806  return 0;
807  }
808  } else {
809  return $row;
810  }
811  }
812  }
813  }
814  }
815 
827  public function getRawRecord($table, $uid, $fields = '*', $noWSOL = FALSE) {
828  $uid = (int)$uid;
829  // Excluding pages here so we can ask the function BEFORE TCA gets initialized.
830  // Support for this is followed up in deleteClause()...
831  if ((is_array($GLOBALS['TCA'][$table]) || $table == 'pages') && $uid > 0) {
832  $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, 'uid = ' . $uid . $this->deleteClause($table));
833  $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
834  $GLOBALS['TYPO3_DB']->sql_free_result($res);
835  if ($row) {
836  if (!$noWSOL) {
837  $this->versionOL($table, $row);
838  }
839  if (is_array($row)) {
840  return $row;
841  }
842  }
843  }
844  }
845 
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);
862  $rows = array();
863  while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
864  if (is_array($row)) {
865  $rows[] = $row;
866  }
867  }
868  $GLOBALS['TYPO3_DB']->sql_free_result($res);
869  if (count($rows)) {
870  return $rows;
871  }
872  }
873  }
874 
875  /********************************
876  *
877  * Caching and standard clauses
878  *
879  ********************************/
880 
893  static public function getHash($hash, $expTime = 0) {
894  $hashContent = NULL;
895  $contentHashCache = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('cache_hash');
896  $cacheEntry = $contentHashCache->get($hash);
897  if ($cacheEntry) {
898  $hashContent = $cacheEntry;
899  }
900  return $hashContent;
901  }
902 
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);
919  }
920 
930  public function deleteClause($table) {
931  // Hardcode for pages because TCA might not be loaded yet (early frontend
932  // initialization)
933  if ($table === 'pages') {
934  return ' AND pages.deleted=0';
935  } else {
936  return $GLOBALS['TCA'][$table]['ctrl']['delete'] ? ' AND ' . $table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0' : '';
937  }
938  }
939 
958  public function enableFields($table, $show_hidden = -1, $ignore_array = array(), $noVersionPreview = FALSE) {
959  if ($show_hidden === -1 && is_object($GLOBALS['TSFE'])) {
960  // If show_hidden was not set from outside and if TSFE is an object, set it
961  // based on showHiddenPage and showHiddenRecords from TSFE
962  $show_hidden = $table == 'pages' ? $GLOBALS['TSFE']->showHiddenPage : $GLOBALS['TSFE']->showHiddenRecords;
963  }
964  if ($show_hidden === -1) {
965  $show_hidden = 0;
966  }
967  // If show_hidden was not changed during the previous evaluation, do it here.
968  $ctrl = $GLOBALS['TCA'][$table]['ctrl'];
969  $query = '';
970  if (is_array($ctrl)) {
971  // Delete field check:
972  if ($ctrl['delete']) {
973  $query .= ' AND ' . $table . '.' . $ctrl['delete'] . '=0';
974  }
975  if ($ctrl['versioningWS']) {
976  if (!$this->versioningPreview) {
977  // Filter out placeholder records (new/moved/deleted items)
978  // in case we are NOT in a versioning preview (that means we are online!)
979  $query .= ' AND ' . $table . '.t3ver_state<=' . new VersionState(VersionState::DEFAULT_STATE);
980  } else {
981  if ($table !== 'pages') {
982  // show only records of live and of the current workspace
983  // in case we are in a versioning preview
984  $query .= ' AND (' .
985  $table . '.t3ver_wsid=0 OR ' .
986  $table . '.t3ver_wsid=' . (int)$this->versioningWorkspaceId .
987  ')';
988  }
989  }
990 
991  // Filter out versioned records
992  if (!$noVersionPreview && empty($ignore_array['pid'])) {
993  $query .= ' AND ' . $table . '.pid<>-1';
994  }
995  }
996 
997  // Enable fields:
998  if (is_array($ctrl['enablecolumns'])) {
999  // In case of versioning-preview, enableFields are ignored (checked in
1000  // versionOL())
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';
1005  }
1006  if ($ctrl['enablecolumns']['starttime'] && !$ignore_array['starttime']) {
1007  $field = $table . '.' . $ctrl['enablecolumns']['starttime'];
1008  $query .= ' AND ' . $field . '<=' . $GLOBALS['SIM_ACCESS_TIME'];
1009  }
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'] . ')';
1013  }
1014  if ($ctrl['enablecolumns']['fe_group'] && !$ignore_array['fe_group']) {
1015  $field = $table . '.' . $ctrl['enablecolumns']['fe_group'];
1016  $query .= $this->getMultipleGroupsWhereClause($field, $table);
1017  }
1018  // Call hook functions for additional enableColumns
1019  // It is used by the extension ingmar_accessctrl which enables assigning more
1020  // than one usergroup to content and page records
1021  if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'])) {
1022  $_params = array(
1023  'table' => $table,
1024  'show_hidden' => $show_hidden,
1025  'ignore_array' => $ignore_array,
1026  'ctrl' => $ctrl
1027  );
1028  foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['addEnableColumns'] as $_funcRef) {
1029  $query .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
1030  }
1031  }
1032  }
1033  }
1034  } else {
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);
1036  }
1037  return $query;
1038  }
1039 
1050  public function getMultipleGroupsWhereClause($field, $table) {
1051  $memberGroups = GeneralUtility::intExplode(',', $GLOBALS['TSFE']->gr_list);
1052  $orChecks = array();
1053  // If the field is empty, then OK
1054  $orChecks[] = $field . '=\'\'';
1055  // If the field is NULL, then OK
1056  $orChecks[] = $field . ' IS NULL';
1057  // If the field contsains zero, then OK
1058  $orChecks[] = $field . '=\'0\'';
1059  foreach ($memberGroups as $value) {
1060  $orChecks[] = $GLOBALS['TYPO3_DB']->listQuery($field, $value, $table);
1061  }
1062  return ' AND (' . implode(' OR ', $orChecks) . ')';
1063  }
1064 
1065  /**********************
1066  *
1067  * Versioning Preview
1068  *
1069  **********************/
1070 
1091  public function fixVersioningPid($table, &$rr) {
1092  if ($this->versioningPreview && is_array($rr) && $rr['pid'] == -1 && ($table == 'pages' || $GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
1093  // Have to hardcode it for "pages" table since TCA is not loaded at this moment!
1094  // Check values for t3ver_oid and t3ver_wsid:
1095  if (isset($rr['t3ver_oid']) && isset($rr['t3ver_wsid'])) {
1096  // If "t3ver_oid" is already a field, just set this:
1097  $oid = $rr['t3ver_oid'];
1098  $wsid = $rr['t3ver_wsid'];
1099  } else {
1100  // Otherwise we have to expect "uid" to be in the record and look up based
1101  // on this:
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'];
1106  }
1107  }
1108  // If workspace ids matches and ID of current online version is found, look up
1109  // the PID value of that:
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)) {
1113  // SWAP uid as well? Well no, because when fixing a versioning PID happens it is
1114  // assumed that this is a "branch" type page and therefore the uid should be
1115  // kept (like in versionOL()). However if the page is NOT a branch version it
1116  // should not happen - but then again, direct access to that uid should not
1117  // happen!
1118  $rr['_ORIG_pid'] = $rr['pid'];
1119  $rr['pid'] = $oidRec['pid'];
1120  }
1121  }
1122  }
1123  // Changing PID in case of moving pointer:
1124  if ($movePlhRec = $this->getMovePlaceholder($table, $rr['uid'], 'pid')) {
1125  $rr['pid'] = $movePlhRec['pid'];
1126  }
1127  }
1128 
1150  public function versionOL($table, &$row, $unsetMovePointers = FALSE, $bypassEnableFieldsCheck = FALSE) {
1151  if ($this->versioningPreview && is_array($row)) {
1152  // will overlay any movePlhOL found with the real record, which in turn
1153  // will be overlaid with its workspace version if any.
1154  $movePldSwap = $this->movePlhOL($table, $row);
1155  // implode(',',array_keys($row)) = Using fields from original record to make
1156  // sure no additional fields are selected. This is best for eg. getPageOverlay()
1157  // Computed properties are excluded since those would lead to SQL errors.
1158  $fieldNames = implode(',', array_keys($this->purgeComputedProperties($row)));
1159  if ($wsAlt = $this->getWorkspaceVersionOfRecord($this->versioningWorkspaceId, $table, $row['uid'], $fieldNames, $bypassEnableFieldsCheck)) {
1160  if (is_array($wsAlt)) {
1161  // Always fix PID (like in fixVersioningPid() above). [This is usually not
1162  // the important factor for versioning OL]
1163  // Keep the old (-1) - indicates it was a version...
1164  $wsAlt['_ORIG_pid'] = $wsAlt['pid'];
1165  // Set in the online versions PID.
1166  $wsAlt['pid'] = $row['pid'];
1167  // For versions of single elements or page+content, preserve online UID and PID
1168  // (this will produce true "overlay" of element _content_, not any references)
1169  // For page+content the "_ORIG_uid" should actually be used as PID for selection
1170  // of tables with "versioning_followPages" enabled.
1171  $wsAlt['_ORIG_uid'] = $wsAlt['uid'];
1172  $wsAlt['uid'] = $row['uid'];
1173  // Translate page alias as well so links are pointing to the _online_ page:
1174  if ($table === 'pages') {
1175  $wsAlt['alias'] = $row['alias'];
1176  }
1177  // Changing input record to the workspace version alternative:
1178  $row = $wsAlt;
1179  // Check if it is deleted/new
1180  $rowVersionState = VersionState::cast($row['t3ver_state']);
1181  if (
1182  $rowVersionState->equals(VersionState::NEW_PLACEHOLDER)
1183  || $rowVersionState->equals(VersionState::DELETE_PLACEHOLDER)
1184  ) {
1185  // Unset record if it turned out to be deleted in workspace
1186  $row = FALSE;
1187  }
1188  // Check if move-pointer in workspace (unless if a move-placeholder is the
1189  // reason why it appears!):
1190  // You have to specifically set $unsetMovePointers in order to clear these
1191  // because it is normally a display issue if it should be shown or not.
1192  if (
1193  ($rowVersionState->equals(VersionState::MOVE_POINTER)
1194  && !$movePldSwap
1195  ) && $unsetMovePointers
1196  ) {
1197  // Unset record if it turned out to be deleted in workspace
1198  $row = FALSE;
1199  }
1200  } else {
1201  // No version found, then check if t3ver_state = VersionState::NEW_PLACEHOLDER
1202  // (online version is dummy-representation)
1203  // Notice, that unless $bypassEnableFieldsCheck is TRUE, the $row is unset if
1204  // enablefields for BOTH the version AND the online record deselects it. See
1205  // note for $bypassEnableFieldsCheck
1206  if ($wsAlt <= -1 || VersionState::cast($row['t3ver_state'])->indicatesPlaceholder()) {
1207  // Unset record if it turned out to be "hidden"
1208  $row = FALSE;
1209  }
1210  }
1211  }
1212  }
1213  }
1214 
1226  public function movePlhOL($table, &$row) {
1227  if (
1228  ($table == 'pages'
1229  || (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2
1230  ) && (int)VersionState::cast($row['t3ver_state'])->equals(VersionState::MOVE_PLACEHOLDER)
1231  ) {
1232  // Only for WS ver 2... (moving)
1233  // If t3ver_move_id is not found, then find it (but we like best if it is here)
1234  if (!isset($row['t3ver_move_id'])) {
1235  $moveIDRec = $this->getRawRecord($table, $row['uid'], 't3ver_move_id', TRUE);
1236  $moveID = $moveIDRec['t3ver_move_id'];
1237  } else {
1238  $moveID = $row['t3ver_move_id'];
1239  }
1240  // Find pointed-to record.
1241  if ($moveID) {
1242  $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',', array_keys($this->purgeComputedProperties($row))), $table, 'uid=' . (int)$moveID . $this->enableFields($table));
1243  $origRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
1244  $GLOBALS['TYPO3_DB']->sql_free_result($res);
1245  if ($origRow) {
1246  $row = $origRow;
1247  return TRUE;
1248  }
1249  }
1250  }
1251  return FALSE;
1252  }
1253 
1264  public function getMovePlaceholder($table, $uid, $fields = '*') {
1265  if ($this->versioningPreview) {
1266  $workspace = (int)$this->versioningWorkspaceId;
1267  if (($table == 'pages' || (int)$GLOBALS['TCA'][$table]['ctrl']['versioningWS'] >= 2) && $workspace !== 0) {
1268  // Select workspace version of record:
1269  $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow($fields, $table, 'pid<>-1 AND
1270  t3ver_state=' . new VersionState(VersionState::MOVE_PLACEHOLDER) . ' AND
1271  t3ver_move_id=' . (int)$uid . ' AND
1272  t3ver_wsid=' . (int)$workspace . $this->deleteClause($table));
1273  if (is_array($row)) {
1274  return $row;
1275  }
1276  }
1277  }
1278  return FALSE;
1279  }
1280 
1293  public function getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields = '*', $bypassEnableFieldsCheck = FALSE) {
1294  if ($workspace !== 0 && !empty($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
1295  $workspace = (int)$workspace;
1296  $uid = (int)$uid;
1297  // Have to hardcode it for "pages" table since TCA is not loaded at this moment!
1298  // Setting up enableFields for version record:
1299  if ($table == 'pages') {
1300  $enFields = $this->versioningPreview_where_hid_del;
1301  } else {
1302  $enFields = $this->enableFields($table, -1, array(), TRUE);
1303  }
1304  // Select workspace version of record, only testing for deleted.
1305  $newrow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow($fields, $table, 'pid=-1 AND
1306  t3ver_oid=' . $uid . ' AND
1307  t3ver_wsid=' . $workspace . $this->deleteClause($table));
1308  // If version found, check if it could have been selected with enableFields on
1309  // as well:
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)) {
1314  // Return offline version, tested for its enableFields.
1315  return $newrow;
1316  } else {
1317  // Return -1 because offline version was de-selected due to its enableFields.
1318  return -1;
1319  }
1320  } else {
1321  // OK, so no workspace version was found. Then check if online version can be
1322  // selected with full enable fields and if so, return 1:
1323  if ($bypassEnableFieldsCheck || $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid', $table, 'uid=' . $uid . $enFields)) {
1324  // Means search was done, but no version found.
1325  return 1;
1326  } else {
1327  // Return -2 because the online record was de-selected due to its enableFields.
1328  return -2;
1329  }
1330  }
1331  }
1332  // No look up in database because versioning not enabled / or workspace not
1333  // offline
1334  return FALSE;
1335  }
1336 
1344  public function checkWorkspaceAccess($wsid) {
1345  if (!$GLOBALS['BE_USER'] || !\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('workspaces')) {
1346  return FALSE;
1347  }
1348  if (isset($this->workspaceCache[$wsid])) {
1349  $ws = $this->workspaceCache[$wsid];
1350  } else {
1351  if ($wsid > 0) {
1352  // No $GLOBALS['TCA'] yet!
1353  $ws = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_workspace', 'uid=' . (int)$wsid . ' AND deleted=0');
1354  if (!is_array($ws)) {
1355  return FALSE;
1356  }
1357  } else {
1358  $ws = $wsid;
1359  }
1360  $ws = $GLOBALS['BE_USER']->checkWorkspace($ws);
1361  $this->workspaceCache[$wsid] = $ws;
1362  }
1363  return $ws['_ACCESS'] != '';
1364  }
1365 
1374  public function getFileReferences($tableName, $fieldName, array $element) {
1376  $fileRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
1377  $currentId = !empty($element['uid']) ? $element['uid'] : 0;
1378 
1379  // Fetch the references of the default element
1380  $references = $fileRepository->findByRelation($tableName, $fieldName, $currentId);
1381 
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'];
1387  }
1388 
1389  if (!empty($GLOBALS['TCA'][$tableName]['ctrl']['transForeignTable'])) {
1390  $tableName = $GLOBALS['TCA'][$tableName]['ctrl']['transForeignTable'];
1391  }
1392 
1393  $isTableLocalizable = (
1394  !empty($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
1395  && !empty($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
1396  );
1397  if ($isTableLocalizable && $localizedId !== NULL) {
1398  $localizedReferences = $fileRepository->findByRelation($tableName, $fieldName, $localizedId);
1399  $localizedReferencesValue = $localizedReferences ?: '';
1400  if ($this->shouldFieldBeOverlaid($tableName, $fieldName, $localizedReferencesValue)) {
1401  $references = $localizedReferences;
1402  }
1403  }
1404 
1405  return $references;
1406  }
1407 
1415  protected function purgeComputedProperties(array $row) {
1416  foreach ($this->computedPropertyNames as $computedPropertyName) {
1417  if (array_key_exists($computedPropertyName, $row)) {
1418  unset($row[$computedPropertyName]);
1419  }
1420  }
1421  return $row;
1422  }
1423 
1432  protected function shouldFieldBeOverlaid($table, $field, $value) {
1433  $l10n_mode = isset($GLOBALS['TCA'][$table]['columns'][$field]['l10n_mode'])
1434  ? $GLOBALS['TCA'][$table]['columns'][$field]['l10n_mode']
1435  : '';
1436 
1437  $shouldFieldBeOverlaid = TRUE;
1438 
1439  if ($l10n_mode === 'exclude') {
1440  $shouldFieldBeOverlaid = FALSE;
1441  } elseif ($l10n_mode === 'mergeIfNotBlank') {
1442  $checkValue = $value;
1443 
1444  // 0 values are considered blank when coming from a group field
1445  if (empty($value) && $GLOBALS['TCA'][$table]['columns'][$field]['config']['type'] === 'group') {
1446  $checkValue = '';
1447  }
1448 
1449  if ($checkValue === array() || !is_array($checkValue) && trim($checkValue) === '') {
1450  $shouldFieldBeOverlaid = FALSE;
1451  }
1452  }
1453 
1454  return $shouldFieldBeOverlaid;
1455  }
1456 }
getRecordOverlay($table, $row, $sys_language_content, $OLmode='')
getMountPointInfo($pageId, $pageRec=FALSE, $prevMountPids=array(), $firstPageUid=0)
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)
$uid
Definition: server.php:36
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
die
Definition: index.php:6
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
getDomainStartPage($domain, $path='', $request_uri='')
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
getRootLine($uid, $MP='', $ignoreMPerrors=FALSE)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields=' *', $bypassEnableFieldsCheck=FALSE)
static storeHash($hash, $data, $ident, $lifetime=0)
shouldFieldBeOverlaid($table, $field, $value)
getPage($uid, $disableGroupAccessCheck=FALSE)
getMovePlaceholder($table, $uid, $fields=' *')
checkRecord($table, $uid, $checkPage=0)
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
Definition: HttpUtility.php:76
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'][]
versionOL($table, &$row, $unsetMovePointers=FALSE, $bypassEnableFieldsCheck=FALSE)