TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Frontend\Page\PageRepository Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Page\PageRepository:
t3lib_pageSelect TYPO3\CMS\Frontend\Tests\Unit\ContentObject\Fixtures\PageRepositoryFixture

Public Member Functions

 init ($show_hidden)
 
 getPage ($uid, $disableGroupAccessCheck=FALSE)
 
 getPage_noCheck ($uid)
 
 getFirstWebPage ($uid)
 
 getPageIdFromAlias ($alias)
 
 getPageOverlay ($pageInput, $lUid=-1)
 
 getRecordOverlay ($table, $row, $sys_language_content, $OLmode='')
 
 getMenu ($uid, $fields=' *', $sortField='sorting', $addWhere='', $checkShortcuts=TRUE)
 
 getDomainStartPage ($domain, $path='', $request_uri='')
 
 getRootLine ($uid, $MP='', $ignoreMPerrors=FALSE)
 
 getPathFromRootline ($rl, $len=20)
 
 getExtURL ($pagerow, $disable=0)
 
 getMountPointInfo ($pageId, $pageRec=FALSE, $prevMountPids=array(), $firstPageUid=0)
 
 checkRecord ($table, $uid, $checkPage=0)
 
 getRawRecord ($table, $uid, $fields=' *', $noWSOL=FALSE)
 
 getRecordsByField ($theTable, $theField, $theValue, $whereClause='', $groupBy='', $orderBy='', $limit='')
 
 deleteClause ($table)
 
 enableFields ($table, $show_hidden=-1, $ignore_array=array(), $noVersionPreview=FALSE)
 
 getMultipleGroupsWhereClause ($field, $table)
 
 fixVersioningPid ($table, &$rr)
 
 versionOL ($table, &$row, $unsetMovePointers=FALSE, $bypassEnableFieldsCheck=FALSE)
 
 movePlhOL ($table, &$row)
 
 getMovePlaceholder ($table, $uid, $fields=' *')
 
 getWorkspaceVersionOfRecord ($workspace, $table, $uid, $fields=' *', $bypassEnableFieldsCheck=FALSE)
 
 checkWorkspaceAccess ($wsid)
 

Static Public Member Functions

static getHash ($hash, $expTime=0)
 
static storeHash ($hash, $data, $ident, $lifetime=0)
 

Public Attributes

 $urltypes = array('', 'http://', 'ftp://', 'mailto:', 'https://')
 
 $where_hid_del = ' AND pages.deleted=0'
 
 $where_groupAccess = ''
 
 $sys_language_uid = 0
 
 $versioningPreview = FALSE
 
 $versioningWorkspaceId = 0
 
 $workspaceCache = array()
 
 $error_getRootLine = ''
 
 $error_getRootLine_failPid = 0
 
const DOKTYPE_DEFAULT = 1
 
const DOKTYPE_LINK = 3
 
const DOKTYPE_SHORTCUT = 4
 
const DOKTYPE_BE_USER_SECTION = 6
 
const DOKTYPE_MOUNTPOINT = 7
 
const DOKTYPE_SPACER = 199
 
const DOKTYPE_SYSFOLDER = 254
 
const DOKTYPE_RECYCLER = 255
 
const SHORTCUT_MODE_NONE = 0
 
const SHORTCUT_MODE_FIRST_SUBPAGE = 1
 
const SHORTCUT_MODE_RANDOM_SUBPAGE = 2
 
const SHORTCUT_MODE_PARENT_PAGE = 3
 

Protected Member Functions

 purgeComputedProperties (array $row)
 
 shouldFieldBeOverlaid ($table, $field, $value)
 

Protected Attributes

 $cache_getRootLine = array()
 
 $cache_getPage = array()
 
 $cache_getPage_noCheck = array()
 
 $cache_getPageIdFromAlias = array()
 
 $cache_getMountPointInfo = array()
 
 $tableNamesAllowedOnRootLevel
 
 $computedPropertyNames
 

Detailed Description

Page functions, a lot of sql/pages-related functions

Mainly used in the frontend but also in some cases in the backend. It's important to set the right $where_hid_del in the object so that the functions operate properly

Author
Kasper Skårhøj kaspe.nosp@m.rYYY.nosp@m.Y@typ.nosp@m.o3.c.nosp@m.om
See also
::fetch_the_id()

Definition at line 30 of file PageRepository.php.

Member Function Documentation

◆ checkRecord()

TYPO3\CMS\Frontend\Page\PageRepository::checkRecord (   $table,
  $uid,
  $checkPage = 0 
)

Checks if a record exists and is accessible. The row is returned if everything's OK.

Parameters
string$tableThe table name to search
integer$uidThe uid to look up in $table
boolean$checkPageIf checkPage is set, it's also required that the page on which the record resides is accessible
Returns
mixed Returns array (the record) if OK, otherwise blank/0 (zero)
Todo:
Define visibility

Definition at line 790 of file PageRepository.php.

References $GLOBALS, $uid, TYPO3\CMS\Frontend\Page\PageRepository\enableFields(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ checkWorkspaceAccess()

TYPO3\CMS\Frontend\Page\PageRepository::checkWorkspaceAccess (   $wsid)

Checks if user has access to workspace.

Parameters
integer$wsidWorkspace ID
Returns
boolean TRUE if has access
Todo:
Define visibility

Definition at line 1344 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Frontend\Page\PageRepository\shouldFieldBeOverlaid().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\fixVersioningPid().

◆ deleteClause()

TYPO3\CMS\Frontend\Page\PageRepository::deleteClause (   $table)

Returns the "AND NOT deleted" clause for the tablename given IF $GLOBALS['TCA'] configuration points to such a field.

Parameters
string$tableTablename
Returns
string
See also
enableFields()
Todo:
Define visibility

Definition at line 930 of file PageRepository.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\getMovePlaceholder(), TYPO3\CMS\Frontend\Page\PageRepository\getPage_noCheck(), TYPO3\CMS\Frontend\Page\PageRepository\getRawRecord(), TYPO3\CMS\Frontend\Page\PageRepository\getRecordsByField(), and TYPO3\CMS\Frontend\Page\PageRepository\getWorkspaceVersionOfRecord().

◆ enableFields()

TYPO3\CMS\Frontend\Page\PageRepository::enableFields (   $table,
  $show_hidden = -1,
  $ignore_array = array(),
  $noVersionPreview = FALSE 
)

Returns a part of a WHERE clause which will filter out records with start/end times or hidden/fe_groups fields set to values that should de-select them according to the current time, preview settings or user login. Definitely a frontend function.

Is using the $GLOBALS['TCA'] arrays "ctrl" part where the key "enablefields" determines for each table which of these features applies to that table.

Parameters
string$tableTable name found in the $GLOBALS['TCA'] array
integer$show_hiddenIf $show_hidden is set (0/1), any hidden-fields in records are ignored. NOTICE: If you call this function, consider what to do with the show_hidden parameter. Maybe it should be set? See ContentObjectRenderer->enableFields where it's implemented correctly.
array$ignore_arrayArray you can pass where keys can be "disabled", "starttime", "endtime", "fe_group" (keys from "enablefields" in TCA) and if set they will make sure that part of the clause is not added. Thus disables the specific part of the clause. For previewing etc.
boolean$noVersionPreviewIf set, enableFields will be applied regardless of any versioning preview settings which might otherwise disable enableFields
Exceptions

Definition at line 958 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Versioning\VersionState\DEFAULT_STATE, and TYPO3\CMS\Frontend\Page\PageRepository\getMultipleGroupsWhereClause().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\checkRecord(), TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), TYPO3\CMS\Frontend\Page\PageRepository\getRecordOverlay(), TYPO3\CMS\Frontend\Page\PageRepository\getWorkspaceVersionOfRecord(), and TYPO3\CMS\Frontend\Page\PageRepository\movePlhOL().

◆ fixVersioningPid()

TYPO3\CMS\Frontend\Page\PageRepository::fixVersioningPid (   $table,
$rr 
)

Finding online PID for offline version record

ONLY active when backend user is previewing records. MUST NEVER affect a site served which is not previewed by backend users!!!

Will look if the "pid" value of the input record is -1 (it is an offline version) and if the table supports versioning; if so, it will translate the -1 PID into the PID of the original record.

Used whenever you are tracking something back, like making the root line.

Principle; Record offline! => Find online?

Parameters
string$tableTable name
array$rrRecord array passed by reference. As minimum, "pid" and "uid" fields must exist! "t3ver_oid" and "t3ver_wsid" is nice and will save you a DB query.
Returns
void (Passed by ref).
See also
::fixVersioningPid(), versionOL(), getRootLine()
Todo:
Define visibility

Definition at line 1091 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Frontend\Page\PageRepository\checkWorkspaceAccess(), TYPO3\CMS\Frontend\Page\PageRepository\getMovePlaceholder(), and TYPO3\CMS\Frontend\Page\PageRepository\getRawRecord().

◆ getDomainStartPage()

TYPO3\CMS\Frontend\Page\PageRepository::getDomainStartPage (   $domain,
  $path = '',
  $request_uri = '' 
)

Will find the page carrying the domain record matching the input domain. Might exit after sending a redirect-header IF a found domain record instructs to do so.

Parameters
string$domainDomain name to search for. Eg. "www.typo3.com". Typical the HTTP_HOST value.
string$pathPath for the current script in domain. Eg. "/somedir/subdir". Typ. supplied by ::getIndpEnv('SCRIPT_NAME')
string$request_uriRequest URI: Used to get parameters from if they should be appended. Typ. supplied by ::getIndpEnv('REQUEST_URI')
Returns
mixed If found, returns integer with page UID where found. Otherwise blank. Might exit if location-header is sent, see description.
See also
::findDomainRecord()
Todo:
Define visibility

Definition at line 591 of file PageRepository.php.

References $GLOBALS, die, and TYPO3\CMS\Core\Utility\HttpUtility\redirect().

◆ getExtURL()

TYPO3\CMS\Frontend\Page\PageRepository::getExtURL (   $pagerow,
  $disable = 0 
)

Returns the URL type for the input page row IF the doktype is 3 and not disabled.

Parameters
array$pagerowThe page row to return URL type for
boolean$disableA flag to simply disable any output from here.
Returns
string The URL type from $this->urltypes array. False if not found or disabled.
See also
::setExternalJumpUrl()
Todo:
Define visibility

Definition at line 698 of file PageRepository.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv().

◆ getFirstWebPage()

TYPO3\CMS\Frontend\Page\PageRepository::getFirstWebPage (   $uid)

Returns the $row of the first web-page in the tree (for the default menu...)

Parameters
integer$uidThe page id for which to fetch first subpages (PID)
Returns
mixed If found: The page record (with overlayed localized fields, if any). If NOT found: blank value (not array!)
See also
::fetch_the_id()
Todo:
Define visibility

Definition at line 294 of file PageRepository.php.

References $GLOBALS, $uid, TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ getHash()

static TYPO3\CMS\Frontend\Page\PageRepository::getHash (   $hash,
  $expTime = 0 
)
static

Returns data stored for the hash string in the cache "cache_hash" Can be used to retrieved a cached value, array or object Can be used from your frontend plugins if you like. It is also used to store the parsed TypoScript template structures. You can call it directly like ::getHash()

Parameters
string$hashThe hash-string which was used to store the data value
integerThe expiration time (not used anymore)
Returns
mixed The "data" from the cache
See also
tslib_TStemplate::start(), storeHash()

Definition at line 893 of file PageRepository.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\getCurrentPageData(), and TYPO3\CMS\Core\Utility\GeneralUtility\xml2array().

◆ getMenu()

TYPO3\CMS\Frontend\Page\PageRepository::getMenu (   $uid,
  $fields = '*',
  $sortField = 'sorting',
  $addWhere = '',
  $checkShortcuts = TRUE 
)

Returns an array with pagerows for subpages with pid=$uid (which is pid here!). This is used for menus. If there are mount points in overlay mode the _MP_PARAM field is set to the corret MPvar.

If the $uid being input does in itself require MPvars to define a correct rootline these must be handled externally to this function.

Parameters
integer$uidThe page id for which to fetch subpages (PID)
string$fieldsList of fields to select. Default is "*" = all
string$sortFieldThe field to sort by. Default is "sorting @param string $addWhere Optional additional where clauses. Like "AND title like 'blabla'" for instance.
boolean$checkShortcutsCheck if shortcuts exist, checks by default
Returns
array Array with key/value pairs; keys are page-uid numbers. values are the corresponding page records (with overlayed localized fields, if any)
See also
::getPageShortcut(), ::makeMenu()
,
Todo:
Define visibility

Definition at line 521 of file PageRepository.php.

References $GLOBALS, $uid, TYPO3\CMS\Frontend\Page\PageRepository\getMountPointInfo(), TYPO3\CMS\Frontend\Page\PageRepository\getPage(), TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ getMountPointInfo()

TYPO3\CMS\Frontend\Page\PageRepository::getMountPointInfo (   $pageId,
  $pageRec = FALSE,
  $prevMountPids = array(),
  $firstPageUid = 0 
)

Returns MountPoint id for page

Does a recursive search if the mounted page should be a mount page itself. It has a run-away break so it can't go into infinite loops.

Parameters
integer$pageIdPage id for which to look for a mount pid. Will be returned only if mount pages are enabled, the correct doktype (7) is set for page and there IS a mount_pid (which has a valid record that is not deleted...)
array$pageRecOptional page record for the page id. If not supplied it will be looked up by the system. Must contain at least uid,pid,doktype,mount_pid,mount_pid_ol
array$prevMountPidsArray accumulating formerly tested page ids for mount points. Used for recursivity brake.
integer$firstPageUidThe first page id.
Returns
mixed Returns FALSE if no mount point was found, "-1" if there should have been one, but no connection to it, otherwise an array with information about mount pid and modes.
See also
Todo:
Define visibility

Definition at line 725 of file PageRepository.php.

References $GLOBALS, $result, and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\getMenu().

◆ getMovePlaceholder()

TYPO3\CMS\Frontend\Page\PageRepository::getMovePlaceholder (   $table,
  $uid,
  $fields = '*' 
)

Returns move placeholder of online (live) version

Parameters
string$tableTable name
integer$uidRecord UID of online version
string$fieldsField list, default is *
Returns
array If found, the record, otherwise nothing.
See also
::getMovePlaceholder()
Todo:
Define visibility

Definition at line 1264 of file PageRepository.php.

References $GLOBALS, $uid, TYPO3\CMS\Frontend\Page\PageRepository\deleteClause(), and TYPO3\CMS\Core\Versioning\VersionState\MOVE_PLACEHOLDER.

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\fixVersioningPid().

◆ getMultipleGroupsWhereClause()

TYPO3\CMS\Frontend\Page\PageRepository::getMultipleGroupsWhereClause (   $field,
  $table 
)

Creating where-clause for checking group access to elements in enableFields function

Parameters
string$fieldField with group list
string$tableTable name
Returns
string AND sql-clause
See also
enableFields()
Todo:
Define visibility

Definition at line 1050 of file PageRepository.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\enableFields().

◆ getPage()

TYPO3\CMS\Frontend\Page\PageRepository::getPage (   $uid,
  $disableGroupAccessCheck = FALSE 
)

Returns the $row for the page with uid = $uid (observing ->where_hid_del) Any pages_language_overlay will be applied before the result is returned. If no page is found an empty array is returned.

Parameters
integer$uidThe page id to look up.
boolean$disableGroupAccessCheckIf set, the check for group access is disabled. VERY rarely used
Exceptions

Definition at line 229 of file PageRepository.php.

References $GLOBALS, $result, $uid, TYPO3\CMS\Frontend\Page\PageRepository\$where_groupAccess, TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\getMenu().

◆ getPage_noCheck()

TYPO3\CMS\Frontend\Page\PageRepository::getPage_noCheck (   $uid)

Return the $row for the page with uid = $uid WITHOUT checking for ->where_hid_del (start- and endtime or hidden). Only "deleted" is checked!

Parameters
integer$uidThe page id to look up
Returns
array The page row with overlayed localized fields. Empty array if no page.
See also
getPage()
Todo:
Define visibility

Definition at line 268 of file PageRepository.php.

References $GLOBALS, $result, $uid, TYPO3\CMS\Frontend\Page\PageRepository\deleteClause(), TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ getPageIdFromAlias()

TYPO3\CMS\Frontend\Page\PageRepository::getPageIdFromAlias (   $alias)

Returns a pagerow for the page with alias $alias

Parameters
string$aliasThe alias to look up the page uid for.
Returns
integer Returns page uid (integer) if found, otherwise 0 (zero)
See also
::checkAndSetAlias(), ContentObjectRenderer::typoLink()
Todo:
Define visibility

Definition at line 316 of file PageRepository.php.

References $GLOBALS.

◆ getPageOverlay()

TYPO3\CMS\Frontend\Page\PageRepository::getPageOverlay (   $pageInput,
  $lUid = -1 
)

Returns the relevant page overlay record fields

Parameters
mixed$pageInputIf $pageInput is an integer, it's the pid of the pageOverlay record and thus the page overlay record is returned. If $pageInput is an array, it's a page-record and based on this page record the language record is found and OVERLAYED before the page record is returned.
integer$lUidLanguage UID if you want to set an alternative value to $this->sys_language_uid which is default. Should be >=0
Exceptions

Definition at line 342 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Frontend\Page\PageRepository\$sys_language_uid, TYPO3\CMS\Frontend\Page\PageRepository\enableFields(), TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj(), TYPO3\CMS\Frontend\Page\PageRepository\purgeComputedProperties(), TYPO3\CMS\Frontend\Page\PageRepository\shouldFieldBeOverlaid(), TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\getFirstWebPage(), TYPO3\CMS\Frontend\Page\PageRepository\getMenu(), TYPO3\CMS\Frontend\Page\PageRepository\getPage(), and TYPO3\CMS\Frontend\Page\PageRepository\getPage_noCheck().

◆ getPathFromRootline()

TYPO3\CMS\Frontend\Page\PageRepository::getPathFromRootline (   $rl,
  $len = 20 
)

Creates a "path" string for the input root line array titles. Used for writing statistics.

Parameters
array$rlA rootline array!
integer$lenThe max length of each title from the rootline.
Returns
string The path in the form "/page title/This is another pageti.../Another page
See also
::getConfigArray()
Todo:
Define visibility

Definition at line 675 of file PageRepository.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\fixed_lgd_cs().

◆ getRawRecord()

TYPO3\CMS\Frontend\Page\PageRepository::getRawRecord (   $table,
  $uid,
  $fields = '*',
  $noWSOL = FALSE 
)

Returns record no matter what - except if record is deleted

Parameters
string$tableThe table name to search
integer$uidThe uid to look up in $table
string$fieldsThe fields to select, default is "*
boolean$noWSOLIf set, no version overlay is applied
Returns
mixed Returns array (the record) if found, otherwise blank/0 (zero)
See also
getPage_noCheck()
Todo:
Define visibility

Definition at line 827 of file PageRepository.php.

References $GLOBALS, $uid, TYPO3\CMS\Frontend\Page\PageRepository\deleteClause(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\fixVersioningPid(), and TYPO3\CMS\Frontend\Page\PageRepository\movePlhOL().

◆ getRecordOverlay()

TYPO3\CMS\Frontend\Page\PageRepository::getRecordOverlay (   $table,
  $row,
  $sys_language_content,
  $OLmode = '' 
)

Creates language-overlay for records in general (where translation is found in records from the same table)

Parameters
string$tableTable name
array$rowRecord to overlay. Must containt uid, pid and $table]['ctrl']['languageField']
integer$sys_language_contentPointer to the sys_language uid for content on the site.
string$OLmodeOverlay mode. If "hideNonTranslated" then records without translation will not be returned un-translated but unset (and return value is FALSE)
Exceptions

Definition at line 423 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Frontend\Page\PageRepository\enableFields(), TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj(), TYPO3\CMS\Frontend\Page\PageRepository\shouldFieldBeOverlaid(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ getRecordsByField()

TYPO3\CMS\Frontend\Page\PageRepository::getRecordsByField (   $theTable,
  $theField,
  $theValue,
  $whereClause = '',
  $groupBy = '',
  $orderBy = '',
  $limit = '' 
)

Selects records based on matching a field (ei. other than UID) with a value

Parameters
string$theTableThe table name to search, eg. "pages" or "tt_content @param string $theField The fieldname to match, eg. "uid" or "alias
string$theValueThe value that fieldname must match, eg. "123" or "frontpage
string$whereClauseOptional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
string$groupByOptional GROUP BY field(s). If none, supply blank string.
string$orderByOptional ORDER BY field(s). If none, supply blank string.
string$limitOptional LIMIT value ([begin,]max). If none, supply blank string.
Returns
mixed Returns array (the record) if found, otherwise nothing (void)
Todo:
Define visibility

Definition at line 859 of file PageRepository.php.

References $GLOBALS, and TYPO3\CMS\Frontend\Page\PageRepository\deleteClause().

◆ getRootLine()

TYPO3\CMS\Frontend\Page\PageRepository::getRootLine (   $uid,
  $MP = '',
  $ignoreMPerrors = FALSE 
)

Returns array with fields of the pages from here ($uid) and back to the root

NOTICE: This function only takes deleted pages into account! So hidden, starttime and endtime restricted pages are included no matter what.

Further: If any "recycler" page is found (doktype=255) then it will also block for the rootline)

If you want more fields in the rootline records than default such can be added by listing them in $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']

Parameters
integer$uidThe page uid for which to seek back to the page tree root.
string$MPCommalist of MountPoint parameters, eg. "1-2,3-4" etc. Normally this value comes from the GET var, MP
boolean$ignoreMPerrorsIf set, some errors related to Mount Points in root line are ignored.
Exceptions
See also
::getRecordArray

Definition at line 646 of file PageRepository.php.

References $uid, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ getWorkspaceVersionOfRecord()

TYPO3\CMS\Frontend\Page\PageRepository::getWorkspaceVersionOfRecord (   $workspace,
  $table,
  $uid,
  $fields = '*',
  $bypassEnableFieldsCheck = FALSE 
)

Select the version of a record for a workspace

Parameters
integer$workspaceWorkspace ID
string$tableTable name to select from
integer$uidRecord uid for which to find workspace version.
string$fieldsField list to select
boolean$bypassEnableFieldsCheckIf TRUE, enablefields are not checked for.
Returns
mixed If found, return record, otherwise other value: Returns 1 if version was sought for but not found, returns -1/-2 if record (offline/online) existed but had enableFields that would disable it. Returns FALSE if not in workspace or no versioning for record. Notice, that the enablefields of the online record is also tested.
See also
::getWorkspaceVersionOfRecord()
Todo:
Define visibility

Definition at line 1293 of file PageRepository.php.

References $GLOBALS, $uid, TYPO3\CMS\Frontend\Page\PageRepository\deleteClause(), and TYPO3\CMS\Frontend\Page\PageRepository\enableFields().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ init()

TYPO3\CMS\Frontend\Page\PageRepository::init (   $show_hidden)

init() MUST be run directly after creating a new template-object This sets the internal variable $this->where_hid_del to the correct where clause for page records taking deleted/hidden/starttime/endtime/t3ver_state into account

Parameters
boolean$show_hiddenIf $show_hidden is TRUE, the hidden-field is ignored!! Normally this should be FALSE. Is used for previewing.
Returns
void
See also
::fetch_the_id(), ::initialize_editor()
Todo:
Define visibility

Definition at line 187 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Frontend\Page\PageRepository\$where_hid_del, and TYPO3\CMS\Core\Versioning\VersionState\DEFAULT_STATE.

◆ movePlhOL()

TYPO3\CMS\Frontend\Page\PageRepository::movePlhOL (   $table,
$row 
)

Checks if record is a move-placeholder (t3ver_state==VersionState::MOVE_PLACEHOLDER) and if so it will set $row to be the pointed-to live record (and return TRUE) Used from versionOL

Parameters
string$tableTable name
array$rowRow (passed by reference) - only online records...
Returns
boolean TRUE if overlay is made.
See also
::movePlhOl()
Todo:
Define visibility

Definition at line 1226 of file PageRepository.php.

References $GLOBALS, TYPO3\CMS\Core\Type\Enumeration\cast(), TYPO3\CMS\Frontend\Page\PageRepository\enableFields(), TYPO3\CMS\Frontend\Page\PageRepository\getRawRecord(), TYPO3\CMS\Core\Versioning\VersionState\MOVE_PLACEHOLDER, and TYPO3\CMS\Frontend\Page\PageRepository\purgeComputedProperties().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ purgeComputedProperties()

TYPO3\CMS\Frontend\Page\PageRepository::purgeComputedProperties ( array  $row)
protected

Purges computed properties from database rows, such as _ORIG_uid or _ORIG_pid for instance.

Parameters
array$row
Returns
array

Definition at line 1415 of file PageRepository.php.

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), TYPO3\CMS\Frontend\Page\PageRepository\movePlhOL(), and TYPO3\CMS\Frontend\Page\PageRepository\versionOL().

◆ shouldFieldBeOverlaid()

TYPO3\CMS\Frontend\Page\PageRepository::shouldFieldBeOverlaid (   $table,
  $field,
  $value 
)
protected

Determine if a field needs an overlay

Parameters
string$tableTCA tablename
string$fieldTCA fieldname
mixed$valueCurrent value of the field
Returns
boolean Returns TRUE if a given record field needs to be overlaid

Definition at line 1432 of file PageRepository.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\checkWorkspaceAccess(), TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), and TYPO3\CMS\Frontend\Page\PageRepository\getRecordOverlay().

◆ storeHash()

static TYPO3\CMS\Frontend\Page\PageRepository::storeHash (   $hash,
  $data,
  $ident,
  $lifetime = 0 
)
static

Stores $data in the 'cache_hash' cache with the hash key, $hash and visual/symbolic identification, $ident

Can be used from your frontend plugins if you like. You can call it directly like ::storeHash()

Parameters
string$hash32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored)
mixed$dataThe data to store
string$identIs just a textual identification in order to inform about the content!
integer$lifetimeThe lifetime for the cache entry in seconds
Returns
void
See also
tslib_TStemplate::start(), getHash()

Definition at line 917 of file PageRepository.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\getCurrentPageData(), TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getExtDirectApi(), and TYPO3\CMS\Core\Utility\GeneralUtility\xml2array().

◆ versionOL()

TYPO3\CMS\Frontend\Page\PageRepository::versionOL (   $table,
$row,
  $unsetMovePointers = FALSE,
  $bypassEnableFieldsCheck = FALSE 
)

Versioning Preview Overlay

ONLY active when backend user is previewing records. MUST NEVER affect a site served which is not previewed by backend users!!!

Generally ALWAYS used when records are selected based on uid or pid. If records are selected on other fields than uid or pid (eg. "email = ....") then usage might produce undesired results and that should be evaluated on individual basis.

Principle; Record online! => Find offline?

Parameters
string$tableTable name
array$rowRecord array passed by reference. As minimum, the "uid", "pid" and "t3ver_state" fields must exist! The record MAY be set to FALSE in which case the calling function should act as if the record is forbidden to access!
boolean$unsetMovePointersIf set, the $row is cleared in case it is a move-pointer. This is only for preview of moved records (to remove the record from the original location so it appears only in the new location)
boolean$bypassEnableFieldsCheckUnless this option is TRUE, the $row is unset if enablefields for BOTH the version AND the online record deselects it. This is because when versionOL() is called it is assumed that the online record is already selected with no regards to it's enablefields. However, after looking for a new version the online record enablefields must ALSO be evaluated of course. This is done all by this function!
Returns
void (Passed by ref).
See also
fixVersioningPid(), ::workspaceOL()
Todo:
Define visibility

Definition at line 1150 of file PageRepository.php.

References TYPO3\CMS\Core\Type\Enumeration\cast(), TYPO3\CMS\Core\Versioning\VersionState\DELETE_PLACEHOLDER, TYPO3\CMS\Frontend\Page\PageRepository\getWorkspaceVersionOfRecord(), TYPO3\CMS\Core\Versioning\VersionState\MOVE_POINTER, TYPO3\CMS\Frontend\Page\PageRepository\movePlhOL(), TYPO3\CMS\Core\Versioning\VersionState\NEW_PLACEHOLDER, and TYPO3\CMS\Frontend\Page\PageRepository\purgeComputedProperties().

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\checkRecord(), TYPO3\CMS\Frontend\Page\PageRepository\getFirstWebPage(), TYPO3\CMS\Frontend\Page\PageRepository\getMenu(), TYPO3\CMS\Frontend\Page\PageRepository\getMountPointInfo(), TYPO3\CMS\Frontend\Page\PageRepository\getPage(), TYPO3\CMS\Frontend\Page\PageRepository\getPage_noCheck(), TYPO3\CMS\Frontend\Page\PageRepository\getPageOverlay(), TYPO3\CMS\Frontend\Page\PageRepository\getRawRecord(), and TYPO3\CMS\Frontend\Page\PageRepository\getRecordOverlay().

Member Data Documentation

◆ $cache_getMountPointInfo

TYPO3\CMS\Frontend\Page\PageRepository::$cache_getMountPointInfo = array()
protected

Definition at line 131 of file PageRepository.php.

◆ $cache_getPage

TYPO3\CMS\Frontend\Page\PageRepository::$cache_getPage = array()
protected

Definition at line 116 of file PageRepository.php.

◆ $cache_getPage_noCheck

TYPO3\CMS\Frontend\Page\PageRepository::$cache_getPage_noCheck = array()
protected

Definition at line 121 of file PageRepository.php.

◆ $cache_getPageIdFromAlias

TYPO3\CMS\Frontend\Page\PageRepository::$cache_getPageIdFromAlias = array()
protected

Definition at line 126 of file PageRepository.php.

◆ $cache_getRootLine

TYPO3\CMS\Frontend\Page\PageRepository::$cache_getRootLine = array()
protected

Definition at line 111 of file PageRepository.php.

◆ $computedPropertyNames

TYPO3\CMS\Frontend\Page\PageRepository::$computedPropertyNames
protected
Initial value:
= array(
'_LOCALIZED_UID',
'_MP_PARAM',
'_ORIG_uid',
'_ORIG_pid',
'_PAGES_OVERLAY',
'_PAGES_OVERLAY_UID',
'_PAGES_OVERLAY_LANGUAGE',
)

Definition at line 146 of file PageRepository.php.

◆ $error_getRootLine

TYPO3\CMS\Frontend\Page\PageRepository::$error_getRootLine = ''

Definition at line 96 of file PageRepository.php.

◆ $error_getRootLine_failPid

TYPO3\CMS\Frontend\Page\PageRepository::$error_getRootLine_failPid = 0

Definition at line 104 of file PageRepository.php.

◆ $sys_language_uid

TYPO3\CMS\Frontend\Page\PageRepository::$sys_language_uid = 0

◆ $tableNamesAllowedOnRootLevel

TYPO3\CMS\Frontend\Page\PageRepository::$tableNamesAllowedOnRootLevel
protected
Initial value:
= array(
'sys_file_metadata',
'sys_category',
)

Definition at line 136 of file PageRepository.php.

◆ $urltypes

TYPO3\CMS\Frontend\Page\PageRepository::$urltypes = array('', 'http://', 'ftp://', 'mailto:', 'https://')

Definition at line 36 of file PageRepository.php.

◆ $versioningPreview

TYPO3\CMS\Frontend\Page\PageRepository::$versioningPreview = FALSE

Definition at line 72 of file PageRepository.php.

◆ $versioningWorkspaceId

TYPO3\CMS\Frontend\Page\PageRepository::$versioningWorkspaceId = 0

Definition at line 80 of file PageRepository.php.

◆ $where_groupAccess

TYPO3\CMS\Frontend\Page\PageRepository::$where_groupAccess = ''

Definition at line 54 of file PageRepository.php.

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\getPage().

◆ $where_hid_del

TYPO3\CMS\Frontend\Page\PageRepository::$where_hid_del = ' AND pages.deleted=0'

Definition at line 46 of file PageRepository.php.

Referenced by TYPO3\CMS\Frontend\Page\PageRepository\init().

◆ $workspaceCache

TYPO3\CMS\Frontend\Page\PageRepository::$workspaceCache = array()

Definition at line 86 of file PageRepository.php.

◆ DOKTYPE_BE_USER_SECTION

const TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_BE_USER_SECTION = 6

◆ DOKTYPE_DEFAULT

const TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT = 1

Named constants for "magic numbers" of the field doktype

Definition at line 159 of file PageRepository.php.

◆ DOKTYPE_LINK

const TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_LINK = 3

◆ DOKTYPE_MOUNTPOINT

◆ DOKTYPE_RECYCLER

const TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER = 255

Definition at line 166 of file PageRepository.php.

Referenced by localPageTree\__construct().

◆ DOKTYPE_SHORTCUT

◆ DOKTYPE_SPACER

◆ DOKTYPE_SYSFOLDER

const TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SYSFOLDER = 254

Definition at line 165 of file PageRepository.php.

◆ SHORTCUT_MODE_FIRST_SUBPAGE

const TYPO3\CMS\Frontend\Page\PageRepository::SHORTCUT_MODE_FIRST_SUBPAGE = 1

◆ SHORTCUT_MODE_NONE

const TYPO3\CMS\Frontend\Page\PageRepository::SHORTCUT_MODE_NONE = 0

Named constants for "magic numbers" of the field shortcut_mode

Definition at line 171 of file PageRepository.php.

◆ SHORTCUT_MODE_PARENT_PAGE

const TYPO3\CMS\Frontend\Page\PageRepository::SHORTCUT_MODE_PARENT_PAGE = 3

◆ SHORTCUT_MODE_RANDOM_SUBPAGE

const TYPO3\CMS\Frontend\Page\PageRepository::SHORTCUT_MODE_RANDOM_SUBPAGE = 2