Public Member Functions | |
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 into account | |
getPage ($uid) | |
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. | |
getPage_noCheck ($uid) | |
Return the $row for the page with uid = $uid WITHOUT checking for ->where_hid_del (start- and endtime or hidden). | |
getFirstWebPage ($uid) | |
Returns the $row of the first web-page in the tree (for the default menu...). | |
getPageIdFromAlias ($alias) | |
Returns a pagerow for the page with alias $alias. | |
getPageOverlay ($pageInput, $lUid=-1) | |
Returns the relevant page overlay record fields. | |
getRecordOverlay ($table, $row, $sys_language_content, $OLmode='') | |
Creates language-overlay for records in general (where translation is found in records from the same table). | |
getMenu ($uid, $fields='*', $sortField='sorting', $addWhere='') | |
Returns an array with pagerows for subpages with pid=$uid (which is pid here!). | |
getDomainStartPage ($domain, $path='', $request_uri='') | |
Will find the page carrying the domain record matching the input domain. | |
Public Attributes | |
$urltypes = Array('','http://','ftp://','mailto:') | |
$where_hid_del = ' AND pages.deleted=0' | |
$sys_language_uid = 0 | |
$versioningPreview = FALSE | |
$versionPreviewMap | |
$error_getRootLine = '' | |
$error_getRootLine_failPid = 0 |
|
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.
Creates a "path" string for the input root line array titles. Used for writing statistics.
Returns the URL type for the input page row IF the doktype is 3 and not disabled.
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.
Checks if a record exists and is accessible. The row is returned if everything's OK.
Returns record no matter what - except if record is deleted
Selects records based on matching a field (ei. other than UID) with a value
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()
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()
Returns the "AND NOT deleted" clause for the tablename given IF $TCA configuration points to such a field.
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.
Find page-tree PID for versionized record Will look if the "pid" value of the input record is -1 and if the table supports versioning - if so, it will translate the -1 PID into the PID of the original record
Versioning Preview Overlay ONLY active when backend user is previewing records. MUST NEVER affect a site served which is not previewed by backend users!!!
Definition at line 431 of file class.t3lib_page.php. References table(). |
|
Returns the $row of the first web-page in the tree (for the default menu...).
Definition at line 203 of file class.t3lib_page.php. 00203 { 00204 $output = ''; 00205 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'pid='.intval($uid).$this->where_hid_del, '', 'sorting', '1'); 00206 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00207 #?? $this->versionOL('pages',$row); 00208 $output = $this->getPageOverlay($row); 00209 } 00210 $GLOBALS['TYPO3_DB']->sql_free_result($res); 00211 return $output; 00212 }
|
|
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.
Definition at line 396 of file class.t3lib_page.php. 00396 { 00397 $output = Array(); 00398 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, 'pages', 'pid='.intval($uid).$this->where_hid_del.' '.$addWhere, '', $sortField); 00399 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00400 #?? $this->versionOL('pages',$row); 00401 00402 // Keep mount point: 00403 $origUid = $row['uid']; 00404 $mount_info = $this->getMountPointInfo($origUid, $row); // $row MUST have "uid", "pid", "doktype", "mount_pid", "mount_pid_ol" fields in it 00405 if (is_array($mount_info) && $mount_info['overlay']) { // There is a valid mount point. 00406 $mp_row = $this->getPage($mount_info['mount_pid']); // Using "getPage" is OK since we need the check for enableFields AND for type 2 of mount pids we DO require a doktype < 200! 00407 if (count($mp_row)) { 00408 $row = $mp_row; 00409 $row['_MP_PARAM'] = $mount_info['MPvar']; 00410 } else unset($row); // If the mount point could not be fetched with respect to enableFields, unset the row so it does not become a part of the menu! 00411 } 00412 00413 // Add to output array after overlaying language: 00414 if (is_array($row)) { 00415 $output[$origUid] = $this->getPageOverlay($row); 00416 } 00417 } 00418 return $output; 00419 }
|
|
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.
Definition at line 171 of file class.t3lib_page.php. 00171 { 00172 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid='.intval($uid).$this->where_hid_del); 00173 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00174 #?? $this->versionOL('pages',$row); 00175 return $this->getPageOverlay($row); 00176 } 00177 return Array(); 00178 }
|
|
Return the $row for the page with uid = $uid WITHOUT checking for ->where_hid_del (start- and endtime or hidden). Only "deleted" is checked!
Definition at line 187 of file class.t3lib_page.php. 00187 { 00188 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid='.intval($uid).$this->deleteClause('pages')); 00189 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00190 #?? $this->versionOL('pages',$row); 00191 return $this->getPageOverlay($row); 00192 } 00193 return Array(); 00194 }
|
|
Returns a pagerow for the page with alias $alias.
Definition at line 221 of file class.t3lib_page.php. 00221 { 00222 $alias = strtolower($alias); 00223 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'alias="'.$GLOBALS['TYPO3_DB']->quoteStr($alias, 'pages').'" AND pid>=0 AND pages.deleted=0'); // "AND pid>=0" is because of versioning... 00224 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00225 return $row['uid']; 00226 } 00227 return 0; 00228 }
|
|
Returns the relevant page overlay record fields.
Definition at line 237 of file class.t3lib_page.php. 00237 { 00238 00239 // Initialize: 00240 if ($lUid<0) $lUid = $this->sys_language_uid; 00241 unset($row); 00242 00243 // If language UID is different from zero, do overlay: 00244 if ($lUid) { 00245 $fieldArr = explode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['pageOverlayFields']); 00246 if (is_array($pageInput)) { 00247 $page_id = $pageInput['uid']; // Was the whole record 00248 $fieldArr = array_intersect($fieldArr,array_keys($pageInput)); // Make sure that only fields which exist in the incoming record are overlaid! 00249 } else { 00250 $page_id = $pageInput; // Was the id 00251 } 00252 00253 if (count($fieldArr)) { 00254 /* 00255 NOTE to enabledFields('pages_language_overlay'): 00256 Currently the showHiddenRecords of TSFE set will allow pages_language_overlay records to be selected as they are child-records of a page. 00257 However you may argue that the showHiddenField flag should determine this. But that's not how it's done right now. 00258 */ 00259 00260 // Selecting overlay record: 00261 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 00262 implode(',',$fieldArr), 00263 'pages_language_overlay', 00264 'pid='.intval($page_id).' 00265 AND sys_language_uid='.intval($lUid). 00266 $this->enableFields('pages_language_overlay'), 00267 '', 00268 '', 00269 '1' 00270 ); 00271 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); 00272 if (is_array($row)) { 00273 $row['_PAGES_OVERLAY'] = TRUE; 00274 $this->versionOL('pages_language_overlay',$row); 00275 00276 // Unset vital fields that are NOT allowed to be overlaid: 00277 unset($row['uid']); 00278 unset($row['pid']); 00279 } 00280 } 00281 } 00282 00283 // Create output: 00284 if (is_array($pageInput)) { 00285 return is_array($row) ? array_merge($pageInput,$row) : $pageInput; // If the input was an array, simply overlay the newfound array and return... 00286 } else { 00287 return is_array($row) ? $row : array(); // always an array in return 00288 } 00289 }
|
|
Creates language-overlay for records in general (where translation is found in records from the same table).
Definition at line 300 of file class.t3lib_page.php. 00300 { 00301 global $TCA; 00302 00303 if ($row['uid']>0 && $row['pid']>0) { 00304 if ($TCA[$table] && $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField']) { 00305 if (!$TCA[$table]['ctrl']['transOrigPointerTable']) { // Will not be able to work with other tables (Just didn't implement it yet; Requires a scan over all tables [ctrl] part for first FIND the table that carries localization information for this table (which could even be more than a single table) and then use that. Could be implemented, but obviously takes a little more....) 00306 00307 // Will try to overlay a record only if the sys_language_content value is larger that zero. 00308 if ($sys_language_content>0) { 00309 00310 // Must be default language or [All], otherwise no overlaying: 00311 if ($row[$TCA[$table]['ctrl']['languageField']]<=0) { 00312 00313 // Select overlay record: 00314 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 00315 '*', 00316 $table, 00317 'pid='.intval($row['pid']). 00318 ' AND '.$TCA[$table]['ctrl']['languageField'].'='.intval($sys_language_content). 00319 ' AND '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']). 00320 $this->enableFields($table), 00321 '', 00322 '', 00323 '1' 00324 ); 00325 $olrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); 00326 $this->versionOL($table,$olrow); 00327 #debug($row); 00328 #debug($olrow); 00329 // Merge record content by traversing all fields: 00330 if (is_array($olrow)) { 00331 foreach($row as $fN => $fV) { 00332 if ($fN!='uid' && $fN!='pid' && isset($olrow[$fN])) { 00333 00334 if ($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN]!='exclude' 00335 && ($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN]!='mergeIfNotBlank' || strcmp(trim($olrow[$fN]),''))) { 00336 $row[$fN] = $olrow[$fN]; 00337 } 00338 } 00339 } 00340 } elseif ($OLmode==='hideNonTranslated' && $row[$TCA[$table]['ctrl']['languageField']]==0) { // Unset, if non-translated records should be hidden. ONLY done if the source record really is default language and not [All] in which case it is allowed. 00341 unset($row); 00342 } 00343 00344 // Otherwise, check if sys_language_content is different from the value of the record - that means a japanese site might try to display french content. 00345 } elseif ($sys_language_content!=$row[$TCA[$table]['ctrl']['languageField']]) { 00346 unset($row); 00347 } 00348 } else { 00349 // When default language is displayed, we never want to return a record carrying another language!: 00350 if ($row[$TCA[$table]['ctrl']['languageField']]>0) { 00351 unset($row); 00352 } 00353 } 00354 } 00355 } 00356 } 00357 00358 return $row; 00359 }
|
|
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 into account
Definition at line 132 of file class.t3lib_page.php. 00132 {
00133 $this->where_hid_del = ' AND pages.deleted=0 ';
00134 if (!$show_hidden) {
00135 $this->where_hid_del.= 'AND pages.hidden=0 ';
00136 }
00137 $this->where_hid_del.= 'AND (pages.starttime<='.$GLOBALS['SIM_EXEC_TIME'].') AND (pages.endtime=0 OR pages.endtime>'.$GLOBALS['SIM_EXEC_TIME'].') ';
00138 }
|
|
Definition at line 120 of file class.t3lib_page.php. |
|
Definition at line 121 of file class.t3lib_page.php. |
|
Definition at line 110 of file class.t3lib_page.php. |
|
Definition at line 108 of file class.t3lib_page.php. |
|
Definition at line 113 of file class.t3lib_page.php. |
|
Initial value: array( # EXAMPLE: 'tt_content:421' => 427 ) Definition at line 114 of file class.t3lib_page.php. |
|
Definition at line 109 of file class.t3lib_page.php. |