Documentation TYPO3 par Ameos

t3lib_pageSelect Class Reference

List of all members.

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=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)
 getWorkspaceVersionOfRecord ($workspace, $table, $uid, $fields='*')

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
 $error_getRootLine = ''
 $error_getRootLine_failPid = 0

Detailed Description

Definition at line 109 of file class.t3lib_page.php.

Member Function Documentation

t3lib_pageSelect::checkRecord table,
checkPage = 0

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

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
mixed Returns array (the record) if OK, otherwise blank/0 (zero)

Definition at line 762 of file class.t3lib_page.php.

t3lib_pageSelect::deleteClause table  ) 

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

string Tablename
See also:

Definition at line 916 of file class.t3lib_page.php.

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.

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
string The clause starting like " AND ...=... AND ...=..."
See also:
tslib_cObj::enableFields(), deleteClause()

Definition at line 936 of file class.t3lib_page.php.

References t3lib_div::callUserFunction(), and getMultipleGroupsWhereClause().

Referenced by t3lib_tsfeBeUserAuth::extEditAction().

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?

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.
void (Passed by ref).
See also:
t3lib_BEfunc::fixVersioningPid(), versionOL(), getRootLine()

Definition at line 1053 of file class.t3lib_page.php.

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.

string Domain name to search for. Eg. "". 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')
mixed If found, returns integer with page UID where found. Otherwise blank. Might exit if location-header is sent, see description.
See also:

Definition at line 471 of file class.t3lib_page.php.

t3lib_pageSelect::getExtURL pagerow,
disable = 0

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

array The page row to return URL type for
boolean A flag to simply disable any output from here.
string The URL type from $this->urltypes array. False if not found or disabled.
See also:

Definition at line 661 of file class.t3lib_page.php.

t3lib_pageSelect::getFirstWebPage uid  ) 

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

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

Definition at line 216 of file class.t3lib_page.php.

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. Is also used to store the parsed TypoScript template structures. You can call it directly like t3lib_pageSelect::getHash()

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.
string The "content" field of the "cache_hash" table row.
See also:
tslib_TStemplate::start(), storeHash()

Definition at line 875 of file class.t3lib_page.php.

Referenced by t3lib_TStemplate::start().

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.

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
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:
tslib_fe::getPageShortcut(), tslib_menu::makeMenu(), tx_wizardcrpages_webfunc_2, tx_wizardsortpages_webfunc_2

Definition at line 413 of file class.t3lib_page.php.

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.

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.
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:

Definition at line 685 of file class.t3lib_page.php.

t3lib_pageSelect::getMultipleGroupsWhereClause field,

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

string Field with group list
string Table name
string AND sql-clause
See also:

Definition at line 1008 of file class.t3lib_page.php.

References t3lib_div::intExplode().

Referenced by 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.

integer The page id to look up.
boolean If set, the check for group access is disabled. VERY rarely used
array The page row with overlayed localized fields. Empty it no page.
See also:

Definition at line 184 of file class.t3lib_page.php.

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!

integer The page id to look up
array The page row with overlayed localized fields. Empty it no page.
See also:

Definition at line 200 of file class.t3lib_page.php.

t3lib_pageSelect::getPageIdFromAlias alias  ) 

Returns a pagerow for the page with alias $alias

string The alias to look up the page uid for.
integer Returns page uid (integer) if found, otherwise 0 (zero)
See also:
tslib_fe::checkAndSetAlias(), tslib_cObj::typoLink()

Definition at line 234 of file class.t3lib_page.php.

t3lib_pageSelect::getPageOverlay pageInput,
lUid = -1

Returns the relevant page overlay record fields

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
array Page row which is overlayed with language_overlay record (or the overlay record alone)

Definition at line 250 of file class.t3lib_page.php.

t3lib_pageSelect::getPathFromRootline rl,
len = 20

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

array A rootline array!
integer The max length of each title from the rootline.
string The path in the form "/page title/This is another pageti.../Another page"
See also:

Definition at line 640 of file class.t3lib_page.php.

t3lib_pageSelect::getRawRecord table,
fields = '*',

Returns record no matter what - except if record is deleted

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
mixed Returns array (the record) if found, otherwise blank/0 (zero)
See also:

Definition at line 797 of file class.t3lib_page.php.

t3lib_pageSelect::getRecordOverlay table,
OLmode = ''

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

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)
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.

Definition at line 314 of file class.t3lib_page.php.

t3lib_pageSelect::getRecordsByField theTable,
whereClause = '',
groupBy = '',
orderBy = '',
limit = ''

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

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.
mixed Returns array (the record) if found, otherwise blank/0 (zero)

Definition at line 823 of file class.t3lib_page.php.

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']

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.
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.
See also:

Definition at line 519 of file class.t3lib_page.php.

t3lib_pageSelect::getWorkspaceVersionOfRecord workspace,
fields = '*'

Select the version of a record for a workspace

integer Workspace ID
string Table name to select from
integer Record uid for which to find workspace version.
string Field list to select
array If found, return record, otherwise false. Returns 1 if version was sought for but not found, returns -1 if record existed but had enableFields that would disable it.
See also:

Definition at line 1149 of file class.t3lib_page.php.

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

boolean If $show_hidden is true, the hidden-field is ignored!! Normally this should be false. Is used for previewing.
See also:
tslib_fe::fetch_the_id(), tx_tstemplateanalyzer::initialize_editor()

Definition at line 134 of file class.t3lib_page.php.

t3lib_pageSelect::storeHash hash,

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()

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.
See also:
tslib_TStemplate::start(), getHash()

Definition at line 898 of file class.t3lib_page.php.

Referenced by t3lib_TStemplate::start().

t3lib_pageSelect::versionOL table,
&$  row

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?

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!
void (Passed by ref).
See also:
fixVersioningPid(), t3lib_BEfunc::workspaceOL()

Definition at line 1094 of file class.t3lib_page.php.

The documentation for this class was generated from the following file:

Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6