t3lib_pageSelect Klassenreferenz

Aufstellung aller Elemente

Öffentliche Methoden

 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=1)
 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='')
 getHash ($hash, $expTime=0)
 storeHash ($hash, $data, $ident)
 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)

Öffentliche Attribute

 $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

Geschützte Attribute

 $cache_getRootLine = array()
 $cache_getPage = array()
 $cache_getMountPointInfo = array()

Dokumentation der Elementfunktionen

t3lib_pageSelect::checkRecord ( table,
uid,
checkPage = 0 
)

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

Parameter:
string The table name to search
integer The uid to look up in $table
boolean If checkPage is set, it's also required that the page on which the record resides is accessible
Rückgabe:
mixed Returns array (the record) if OK, otherwise blank/0 (zero)
t3lib_pageSelect::checkWorkspaceAccess ( wsid  ) 

Checks if user has access to workspace.

Parameter:
int $wsid Workspace ID
Rückgabe:
boolean true if has access
t3lib_pageSelect::deleteClause ( table  ) 

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

Parameter:
string Tablename
Rückgabe:
string
Siehe auch:
enableFields()
t3lib_pageSelect::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 $TCA arrays "ctrl" part where the key "enablefields" determines for each table which of these features applies to that table.

Parameter:
string Table name found in the $TCA array
integer If $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 tslib_cObj->enableFields where it's implemented correctly.
array Array 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 If set, enableFields will be applied regardless of any versioning preview settings which might otherwise disable enableFields
Rückgabe:
string The clause starting like " AND ...=... AND ...=..."
Siehe auch:
tslib_cObj::enableFields(), deleteClause()
t3lib_pageSelect::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?

Parameter:
string Table name
array Record 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.
Rückgabe:
void (Passed by ref).
Siehe auch:
t3lib_BEfunc::fixVersioningPid(), versionOL(), getRootLine()
t3lib_pageSelect::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.

Parameter:
string Domain name to search for. Eg. "www.typo3.com". Typical the HTTP_HOST value.
string Path for the current script in domain. Eg. "/somedir/subdir". Typ. supplied by t3lib_div::getIndpEnv('SCRIPT_NAME')
string Request URI: Used to get parameters from if they should be appended. Typ. supplied by t3lib_div::getIndpEnv('REQUEST_URI')
Rückgabe:
mixed If found, returns integer with page UID where found. Otherwise blank. Might exit if location-header is sent, see description.
Siehe auch:
tslib_fe::findDomainRecord()
t3lib_pageSelect::getExtURL ( pagerow,
disable = 0 
)

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

Parameter:
array The page row to return URL type for
boolean A flag to simply disable any output from here.
Rückgabe:
string The URL type from $this->urltypes array. False if not found or disabled.
Siehe auch:
tslib_fe::setExternalJumpUrl()
t3lib_pageSelect::getFirstWebPage ( uid  ) 

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

Parameter:
integer The page id for which to fetch first subpages (PID)
Rückgabe:
mixed If found: The page record (with overlayed localized fields, if any). If NOT found: blank value (not array!)
Siehe auch:
tslib_fe::fetch_the_id()
t3lib_pageSelect::getHash ( hash,
expTime = 0 
)

Returns string value stored for the hash string in the table "cache_hash" Can be used to retrieved a cached value 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 t3lib_pageSelect::getHash()

Parameter:
string The hash-string which was used to store the data value
integer Allowed expiretime in seconds. Basically a record is selected only if it is not older than this value in seconds. If expTime is not set, the hashed value will never expire.
Rückgabe:
string The "content" field of the "cache_hash" table row.
Siehe auch:
tslib_TStemplate::start(), storeHash()
t3lib_pageSelect::getMenu ( uid,
fields = '*',
sortField = 'sorting',
addWhere = '',
checkShortcuts = 1 
)

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.

Parameter:
integer The page id for which to fetch subpages (PID)
string List of fields to select. Default is "*" = all
string The field to sort by. Default is "sorting"
string Optional additional where clauses. Like "AND title like '%blabla%'" for instance.
boolean check if shortcuts exist, checks by default
Rückgabe:
array Array with key/value pairs; keys are page-uid numbers. values are the corresponding page records (with overlayed localized fields, if any)
Siehe auch:
tslib_fe::getPageShortcut(), tslib_menu::makeMenu(), tx_wizardcrpages_webfunc_2, tx_wizardsortpages_webfunc_2
t3lib_pageSelect::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.

Parameter:
integer Page 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 Optional 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 Array accumulating formerly tested page ids for mount points. Used for recursivity brake.
integer The first page id.
Rückgabe:
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.
Siehe auch:
tslib_menu
t3lib_pageSelect::getMovePlaceholder ( table,
uid,
fields = '*' 
)

Returns move placeholder of online (live) version

Parameter:
string Table name
integer Record UID of online version
string Field list, default is *
Rückgabe:
array If found, the record, otherwise nothing.
Siehe auch:
t3lib_BEfunc::getMovePlaceholder()
t3lib_pageSelect::getMultipleGroupsWhereClause ( field,
table 
)

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

Parameter:
string Field with group list
string Table name
Rückgabe:
string AND sql-clause
Siehe auch:
enableFields()
t3lib_pageSelect::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.

Parameter:
integer The page id to look up.
boolean If set, the check for group access is disabled. VERY rarely used
Rückgabe:
array The page row with overlayed localized fields. Empty it no page.
Siehe auch:
getPage_noCheck()
t3lib_pageSelect::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!

Parameter:
integer The page id to look up
Rückgabe:
array The page row with overlayed localized fields. Empty it no page.
Siehe auch:
getPage()
t3lib_pageSelect::getPageIdFromAlias ( alias  ) 

Returns a pagerow for the page with alias $alias

Parameter:
string The alias to look up the page uid for.
Rückgabe:
integer Returns page uid (integer) if found, otherwise 0 (zero)
Siehe auch:
tslib_fe::checkAndSetAlias(), tslib_cObj::typoLink()
t3lib_pageSelect::getPageOverlay ( pageInput,
lUid = -1 
)

Returns the relevant page overlay record fields

Parameter:
mixed If $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 Language UID if you want to set an alternative value to $this->sys_language_uid which is default. Should be >=0
Rückgabe:
array Page row which is overlayed with language_overlay record (or the overlay record alone)
t3lib_pageSelect::getPathFromRootline ( rl,
len = 20 
)

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

Parameter:
array A rootline array!
integer The max length of each title from the rootline.
Rückgabe:
string The path in the form "/page title/This is another pageti.../Another page"
Siehe auch:
tslib_fe::getConfigArray()
t3lib_pageSelect::getRawRecord ( table,
uid,
fields = '*',
noWSOL = FALSE 
)

Returns record no matter what - except if record is deleted

Parameter:
string The table name to search
integer The uid to look up in $table
string The fields to select, default is "*"
boolean If set, no version overlay is applied
Rückgabe:
mixed Returns array (the record) if found, otherwise blank/0 (zero)
Siehe auch:
getPage_noCheck()
t3lib_pageSelect::getRecordOverlay ( table,
row,
sys_language_content,
OLmode = '' 
)

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

Parameter:
string Table name
array Record to overlay. Must containt uid, pid and $table]['ctrl']['languageField']
integer Pointer to the sys_language uid for content on the site.
string Overlay mode. If "hideNonTranslated" then records without translation will not be returned un-translated but unset (and return value is false)
Rückgabe:
mixed Returns the input record, possibly overlaid with a translation. But if $OLmode is "hideNonTranslated" then it will return false if no translation is found.
t3lib_pageSelect::getRecordsByField ( theTable,
theField,
theValue,
whereClause = '',
groupBy = '',
orderBy = '',
limit = '' 
)

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

Parameter:
string The table name to search, eg. "pages" or "tt_content"
string The fieldname to match, eg. "uid" or "alias"
string The value that fieldname must match, eg. "123" or "frontpage"
string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
string Optional GROUP BY field(s), if none, supply blank string.
string Optional ORDER BY field(s), if none, supply blank string.
string Optional LIMIT value ([begin,]max), if none, supply blank string.
Rückgabe:
mixed Returns array (the record) if found, otherwise nothing (void)
t3lib_pageSelect::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']

Parameter:
integer The page uid for which to seek back to the page tree root.
string Commalist of MountPoint parameters, eg. "1-2,3-4" etc. Normally this value comes from the GET var, MP
boolean If set, some errors related to Mount Points in root line are ignored.
Rückgabe:
array Array with page records from the root line as values. The array is ordered with the outer records first and root record in the bottom. The keys are numeric but in reverse order. So if you traverse/sort the array by the numeric keys order you will get the order from root and out. If an error is found (like eternal looping or invalid mountpoint) it will return an empty array.
Siehe auch:
tslib_fe::getPageAndRootline()
t3lib_pageSelect::getWorkspaceVersionOfRecord ( workspace,
table,
uid,
fields = '*',
bypassEnableFieldsCheck = FALSE 
)

Select the version of a record for a workspace

Parameter:
integer Workspace ID
string Table name to select from
integer Record uid for which to find workspace version.
string Field list to select
boolean If true, enablefields are not checked for.
Rückgabe:
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.
Siehe auch:
t3lib_befunc::getWorkspaceVersionOfRecord()
t3lib_pageSelect::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

Parameter:
boolean If $show_hidden is true, the hidden-field is ignored!! Normally this should be false. Is used for previewing.
Rückgabe:
void
Siehe auch:
tslib_fe::fetch_the_id(), tx_tstemplateanalyzer::initialize_editor()
t3lib_pageSelect::movePlhOL ( table,
&$  row 
)

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

Parameter:
string Table name
array Row (passed by reference) - only online records...
Rückgabe:
boolean True if overlay is made.
Siehe auch:
t3lib_BEfunc::movePlhOl()
t3lib_pageSelect::storeHash ( hash,
data,
ident 
)

Stores a string value in the cache_hash table identified by $hash. Can be used from your frontend plugins if you like. You can call it directly like t3lib_pageSelect::storeHash()

Parameter:
string 32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored)
string The data string. If you want to store an array, then just serialize it first.
string $ident is just a textual identification in order to inform about the content! May be 20 characters long.
Rückgabe:
void
Siehe auch:
tslib_TStemplate::start(), getHash()
t3lib_pageSelect::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?

Parameter:
string Table name
array Record 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 If 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 Unless 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!
Rückgabe:
void (Passed by ref).
Siehe auch:
fixVersioningPid(), t3lib_BEfunc::workspaceOL()

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:
 Alle Klassen Namensbereiche Funktionen Variablen

Erzeugt am Wed Oct 28 16:40:23 2009 für Typo3 von  doxygen 1.6.1