Documentation TYPO3 par Ameos |
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 |
Definition at line 109 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. |
Definition at line 134 of file class.t3lib_page.php.
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 |
Definition at line 184 of file class.t3lib_page.php.
References getPageOverlay(), and versionOL().
Referenced by getMenu().
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 |
Definition at line 200 of file class.t3lib_page.php.
References deleteClause(), getPageOverlay(), and versionOL().
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) |
Definition at line 216 of file class.t3lib_page.php.
References getPageOverlay(), and versionOL().
t3lib_pageSelect::getPageIdFromAlias | ( | $ | alias | ) |
Returns a pagerow for the page with alias $alias
string | The alias to look up the page uid for. |
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 |
Definition at line 250 of file class.t3lib_page.php.
References enableFields(), and versionOL().
Referenced by getFirstWebPage(), getMenu(), getPage(), and 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)
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) |
Definition at line 314 of file class.t3lib_page.php.
References enableFields(), and versionOL().
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 |
Definition at line 413 of file class.t3lib_page.php.
References getMountPointInfo(), getPage(), getPageOverlay(), and versionOL().
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. "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') |
Definition at line 471 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. |
Definition at line 519 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. |
Definition at line 640 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. |
Definition at line 661 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. |
Definition at line 685 of file class.t3lib_page.php.
Referenced by getMenu().
t3lib_pageSelect::checkRecord | ( | $ | table, | |
$ | uid, | |||
$ | 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 |
Definition at line 762 of file class.t3lib_page.php.
References enableFields(), and versionOL().
t3lib_pageSelect::getRawRecord | ( | $ | table, | |
$ | uid, | |||
$ | fields = '*' , |
|||
$ | noWSOL = FALSE | |||
) |
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 |
Definition at line 797 of file class.t3lib_page.php.
References deleteClause(), and versionOL().
Referenced by fixVersioningPid().
t3lib_pageSelect::getRecordsByField | ( | $ | theTable, | |
$ | theField, | |||
$ | theValue, | |||
$ | 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. |
Definition at line 823 of file class.t3lib_page.php.
References deleteClause().
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. |
Definition at line 875 of file class.t3lib_page.php.
Referenced by t3lib_TStemplate::start().
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()
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. |
Definition at line 898 of file class.t3lib_page.php.
Referenced by t3lib_TStemplate::start().
t3lib_pageSelect::deleteClause | ( | $ | table | ) |
Returns the "AND NOT deleted" clause for the tablename given IF $TCA configuration points to such a field.
string | Tablename |
Definition at line 916 of file class.t3lib_page.php.
Referenced by getPage_noCheck(), getRawRecord(), getRecordsByField(), and getWorkspaceVersionOfRecord().
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 |
Definition at line 936 of file class.t3lib_page.php.
References t3lib_div::callUserFunction(), and getMultipleGroupsWhereClause().
Referenced by checkRecord(), getPageOverlay(), getRecordOverlay(), and getWorkspaceVersionOfRecord().
t3lib_pageSelect::getMultipleGroupsWhereClause | ( | $ | field, | |
$ | table | |||
) |
Creating where-clause for checking group access to elements in enableFields function
string | Field with group list | |
string | Table name |
Definition at line 1008 of file class.t3lib_page.php.
References t3lib_div::intExplode().
Referenced by enableFields().
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. |
Definition at line 1054 of file class.t3lib_page.php.
References getRawRecord().
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! |
Definition at line 1095 of file class.t3lib_page.php.
References getWorkspaceVersionOfRecord().
Referenced by checkRecord(), getFirstWebPage(), getMenu(), getPage(), getPage_noCheck(), getPageOverlay(), getRawRecord(), and getRecordOverlay().
t3lib_pageSelect::getWorkspaceVersionOfRecord | ( | $ | workspace, | |
$ | table, | |||
$ | uid, | |||
$ | 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 |
Definition at line 1150 of file class.t3lib_page.php.
References deleteClause(), and enableFields().
Referenced by versionOL().