ich hab's mal so hingeschustert, dass die navigation sich nun nach unserm speziellen verhalten richten sollte - hab das ganze gleich in php gelöst weil mir das in typoscript zu schwierig war und ich auch in php noch nicht ganz fit bin.
schlüsselstellen sind:
config.linkVars = L, MP
somit sollten mountpoints, sprache und die realurl-anbindung entsprechend funktionieren, hier einige code-snippets:
//--------------------------------MAIN NAVI, SUB NAVI, SIDEBAR / SUBMENU------------------------------
# load the navigation php scripts
includeLibs.navigationHelper = typo3conf/ext/unisbghookconsumer/user_navigationhelper.php
#------------------------------------------------------------------------------------------------
# WATCH the sequence of creating the navigations, breadcrumb before subnavi and subnavi caption!
#------------------------------------------------------------------------------------------------
# breadcrumb navigation - COA_INT important not to be cached as it uses the FE session internally
lib.field_breadcrumbs = COA_INT
lib.field_breadcrumbs {
10 = TEXT
10 {
postUserFunc = user_navigationhelper->getBreadcrumbs
postUserFunc.TabIndex = 200
postUserFunc.AccessKey = b
postUserFunc.RootNodeUid = 3
}
}
# sub navigation in the left column - COA_INT important not to be cached as it uses the FE session internally
lib.field_subnavi = COA_INT
lib.field_subnavi {
10 = TEXT
10 {
postUserFunc = user_navigationhelper->getSubNavi
postUserFunc.TabIndex = 30
postUserFunc.AccessKey = u
}
}
lib.field_subnavicaption = COA_INT
lib.field_subnavicaption {
10 = TEXT
10 {
postUserFunc = user_navigationhelper->getMountPointTitle
}
}
# main navigation (horizontal)
lib.field_mainnavi = COA_INT
lib.field_mainnavi{
10 = TEXT
10 {
postUserFunc = user_navigationhelper->getMainNavi
postUserFunc.TabIndex = 20
postUserFunc.AccessKey = m
# pages.uid of the "zentrale navigation"
postUserFunc.ZentraleNaviUid = 18394
# max items to be shown in the navigation, disabled pages are ignored
postUserFunc.maxItems = 4
}
}
lib.field_mainverticalnavi = COA_INT
lib.field_mainverticalnavi {
10 = TEXT
10 {
postUserFunc = user_navigationhelper->getMainHorizontalNavi
postUserFunc {
TabIndex = 102
# pages.uid of the "zentrale navigation"
ZentraleNaviUid = 18394
# first page to start with, as all child-pages of the "zentrale navigation" could be shown, diabled pages are ignored
# caution starindex may change if pages are hidden or excluded as the range (the LIMIT statement) changes
firstItemIndex = 4
# max items to be shown in the navigation, disabled pages are ignored
maxItems = 4
# comma separated list of pages.uid to be ignored
excludeItemIds = 20708, 20084, 20083
}
}
<?php
require_once(PATH_t3lib . 'class.t3lib_div.php');
require_once(PATH_t3lib . 'class.t3lib_page.php');
class user_navigationhelper {
/**
* Gets the titel of the mount point if the current page was mounted in order to overwrite the pages title
*
* @param string content parameter.
* @param array Typoscript configuration array (containing assigned funtion parameters)
* @return string Returns the title of the mount point in order to overwrite it or the title of the current page.
*/
public function getMountPointTitle($content, $conf){
// get the session data created from breadcrumb
$sessionData = array();
$sessionData = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_unisbghookconsumer_breadcrumb');
// find the id and get the title
foreach ($sessionData as $page) {
if ($page['id'] == $uid = $GLOBALS['TSFE']->id){
$content .= $page['title'];
}
}
return $content;
}
/**
* Renders the main vertical navigation.
* @param string $content String submitted into this UserFunc in order to be manipulated and returned.
* @param array $conf Collection containing the functions parameter / config.
* @return string A <li> wrapped <a>-tag list representing the navigation
*/
public function getMainHorizontalNavi($content, $conf) {
// get TypoScript configured data
$tabindex = intval($conf['TabIndex']);
if (empty($tabindex)){
$tabindex = 20;
}
$accesskey = $conf['AccessKey'];
if (empty($accesskey)){
$accesskey = 'm';
}
$zentraleNaviUid = $conf['ZentraleNaviUid'];
if (empty($zentraleNaviUid)){
$zentraleNaviUid = 0;
}
$firstItemIndex = $conf['firstItemIndex'];
if (empty($firstItemIndex)){
$firstItemIndex = 0;
}
$maxItems = $conf['maxItems'];
if (empty($maxItems)){
$maxItems = 64;
}
$excludeItemIds = $conf['excludeItemIds'];
if (!empty($excludeItemIds)){
$excludeItemIds = 'and uid not in ('.$excludeItemIds.')';
}
// select a range out of all first level children of the parent node
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'uid,pid,title,target,(select p.title from pages_language_overlay p where p.pid=pages.uid) as translation',
'pages',
'pid='.$zentraleNaviUid.$GLOBALS['TSFE']->cObj->enableFields('pages').' '.$excludeItemIds,
'',
'sorting',
$firstItemIndex.','.$maxItems);
$counter = 0;
while(($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$activePage = '';
if ($row['uid'] == $GLOBALS['TSFE']->id){
$activePage = 'class="active"';
}
$title = $row['title'];
// not default language (de)
if ($GLOBALS['TSFE']->sys_language_uid > 0){
$title = $row['translation'];
}
$href = $GLOBALS['TSFE']->cObj->getTypoLink_URL($row['uid']);
$content .= '<li '.$activePage.'><a '.$accKey.' title="'.$title.'" href="'.$href.'" tabindex="'.$tabindex.'">'.$title.'</a></li>';
$tabindex++;
}
return $content;
}
/**
* Renders the main horizontal navigation.
* @param string $content String submitted into this UserFunc in order to be manipulated and returned.
* @param array $conf Collection containing the functions parameter / config.
* @return string A <li> wrapped <a>-tag list representing the navigation
*/
public function getMainNavi($content, $conf){
// get TypoScript configured data
$tabindex = intval($conf['TabIndex']);
if (empty($tabindex)){
$tabindex = 20;
}
$accesskey = $conf['AccessKey'];
if (empty($accesskey)){
$accesskey = 'm';
}
$zentraleNaviUid = $conf['ZentraleNaviUid'];
if (empty($zentraleNaviUid)){
$zentraleNaviUid = 0;
}
$maxItems = $conf['maxItems'];
if (empty($maxItems)){
$maxItems = 64;
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,title,target,(select p.title from pages_language_overlay p where p.pid=pages.uid) as translation',
'pages',
'pid='.$zentraleNaviUid.$GLOBALS['TSFE']->cObj->enableFields('pages'),
'',
'sorting',
$maxItems);
$counter = 0;
while(($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$accKey = '';
if ($counter == 0){
$accKey = 'accesskey="'.$accesskey.'" id="access-'.$accesskey.'"';
}
$activePage = '';
if ($row['uid'] == $GLOBALS['TSFE']->id){
$activePage = 'class="active"';
}
$title = $row['title'];
// not default language (de)
if ($GLOBALS['TSFE']->sys_language_uid > 0){
$title = $row['translation'];
}
// delete the linkVars in order not to append &MP params onto the URL
// error_log('mainnavi linkvar: '.$GLOBALS['TSFE']->linkVars.', sys lang:'.$GLOBALS['TSFE']->sys_language_uid."\n", 3, 'C:\xampp\apache\logs\error.log' );
$GLOBALS['TSFE']->linkVars = $this->removeMPparams($GLOBALS['TSFE']->linkVars);
$href = $GLOBALS['TSFE']->cObj->getTypoLink_URL($row['uid']);
$content .= '<li '.$activePage.'><a '.$accKey.' title="'.$title.'" href="'.$href.'" tabindex="'.$tabindex.'">'.$title.'</a></li>';
$counter++;
$tabindex++;
}
return $content;
}
/**
* Gets the main pages data to be worked with later on out of the database.
* @return array multidimesional array containing the most important pages records data
*/
private function getPagesRecordData() {
global $TSFE;
$cObj = $TSFE->cObj;
$pageSelect = t3lib_div::makeInstance('t3lib_pageSelect'); // object for later translation
$prepareEnableFields = $cObj->enableFields('pages');
$prepareEnableFields = str_replace('pages.', 'p1.', $prepareEnableFields); // prepare for self join statement
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('p1.uid, p1.pid, p1.title, p1.doktype, p1.mount_pid, p1.mount_pid_ol, p1.target, p1.url,
p2.uid as mpUid, p2.pid as mpPid, p2.title as mpTitle, p2.target as mpTarget',
'pages p1 left join pages as p2 on p1.mount_pid = p2.uid',
'p1.pid='.$TSFE->id.$prepareEnableFields);
$recordData = array();
while(($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$uid = $row['uid'];
$pid = $row['pid'];
$title = $row['title'];
$doktype = $row['doktype'];
$mount_pid = $row['mount_pid'];
$mount_pid_ol = $row['mount_pid_ol'];
$target = $row['target'];
$url = $row['url'];
// overlays for mountpoint
$mpUid = $row['mpUid'];
$mpPid = $row['mpPid'];
$mpTitle = $row['mpTitle'];
$mpTarget = $row['mpTarget'];
$titleTranslated = '';
$mountpointParams = null;
// not default language (de)
if ($GLOBALS['TSFE']->sys_language_uid > 0){
// if the current page is a mount point and "use content of mounted pages" is active overwrite the title / fallback if empty
// CAUTION! there should not be any other combination of mountpoints!
if (!empty($mount_pid) && $doktype == 7 && $mount_pid_ol == 1){
$mpTranslationrecord = $pageSelect->getPageOverlay($mpUid, $GLOBALS['TSFE']->sys_language_uid);
// if no record found it might be hidden or nor existent so do not provide a hyperlink
if (empty($mpTranslationrecord)){
continue;
}
// if not empty get the title of the mountpoint
$titleTranslated = $mpTranslationrecord['title'];
// add mountpoint params eg. 1116-19942 if no shortcut
if ($doktype != 4){
$mountpointParams = array('MP'=>$mount_pid.'-'.$uid);
}
}
// get translation of the current page / if it is not mountpoint
$translationRecord = $pageSelect->getPageOverlay($uid, $GLOBALS['TSFE']->sys_language_uid);
// if no record found it might be hidden or nor existent so do not provide a hyperlink
if (empty($translationRecord) && empty($mpTranslationrecord)){
continue;
}
// overwrite the title if supplied
if (!empty($translationRecord['title'])){
$titleTranslated = $translationRecord['title'];
}
$title = $titleTranslated;
// add language info
if (is_array($mountpointParams)){
$mountpointParams['L'] = $GLOBALS['TSFE']->sys_language_uid;
}
else {
$mountpointParams = array('L'=>$GLOBALS['TSFE']->sys_language_uid);
}
}
else { // default language (de)
// check if page is mountpoint and "use content of mounted pages" is active
$substituteTitle = $mpTitle; // title of mounted page
if (!empty($mount_pid) && $doktype == 7 && $mount_pid_ol == 1){
if (!empty($title)){ // overwrite title
$substituteTitle = $title;
}
$title = $substituteTitle;
// add mountpoint params eg. 1116-19942 if no shortcut
if ($doktype != 4){
$mountpointParams = array('MP'=>$mount_pid.'-'.$uid);
}
}
}
// save data in array to be returned
$recordData[] = array('uid'=>$uid, 'MP'=>$mountpointParams, 'title'=>$title, 'target'=>$target, 'doktype'=>$doktype, 'url'=>$url);
}
return $recordData;
}
/**
* TypoScript UserFunc to build the subnavigation in left column
*
* @param string content parameter.
* @param array Typoscript configuration array (containing assigned funtion parameters)
* @return string Returns a list of <a>hyperlinks wrapped by <li>.
*/
public function getSubNavi($content, $conf){
$tabindex = intval($conf['TabIndex']);
if (empty($tabindex)){
$tabindex = 30;
}
$accesskey = $conf['AccessKey'];
if (empty($accesskey)){
$accesskey = 'u';
}
$counter = 0;
$recordData = $this->getPagesRecordData();
foreach ($recordData as $pages) {
$linkType = '';
// check if external link
if ($pages['target'] == '_blank' && $pages['doktype'] == '3' && $pages['url'] != ''){
$linkType = 'class="ext"';
// check if document link
$pos = strripos($pages['url'], '.');
if ($pos != false){
$extension = substr($pages['url'], $pos+1, strlen($pages['url'])-$pos);
// if the realurl is installed every url might end with eg .html
if (t3lib_extMgm::isLoaded('realurl'))
{
if ($extension != 'html'){
$linkType = 'class="doc"';
}
}
else { // if no realurl is installed this is just a VERY simple work-arround for specifying a link to ba a document link
if ($extension != 'html' && $extension != 'php'){
$linkType = 'class="doc"';
}
}
}
}
$href = $GLOBALS['TSFE']->cObj->getTypoLink_URL($pages['uid'], $pages['MP'], $pages['target']);
//error_log('uid: '.$pages['uid'].', MP: '.$pages['MP'].', href: '.$href."\n", 3, 'C:\xampp\apache\logs\error.log' );
$target = '';
if (!empty($pages['target'])){
$target = 'target="'.$pages['target'].'"';
}
if ($counter == 0){
$content .= '<li '.$linkType.'><a id="access-'.$accesskey.'" accesskey="'.$accesskey.'" href="'.$href.'" title="'.$pages['title'].'" tabindex="'.$tabindex.'"'.$target.'>'.$pages['title'].'</a></li>';
}
else {
$content .= '<li '.$linkType.'><a href="'.$href.'" title="'.$pages['title'].'" tabindex="'.$tabindex.'"'.$target.'>'.$pages['title'].'</a></li>';
}
$counter++;
$tabindex++;
}
return $content;
}
/**
*
* Checks if the current page is one of the root pages clicked in the main navigation
* @param array $rootline Rootline of the current page
* @param int $rootNodeUid pages.uid of the rootnode
*/
private function isMainNavigationRoot($rootline, $rootNodeUid){
$isRoot = false;
if (count($rootline) === 3){
if ($rootline[0]['pid'] == 0 && $rootline[1]['pid'] == $rootNodeUid){
$isRoot = true;
}
}
return $isRoot;
}
/**
* TypoScript UserFunc to build the subnavigation in left column
*
* @param string content parameter.
* @param array Typoscript configuration array (containing assigned funtion parameters)
* @return string Returns a list of <a>hyperlinks wrapped by <li>.
*/
public function getBreadcrumbs($content, $conf){
// get TypoScript configured data
$tabindex = intval($conf['TabIndex']);
if (empty($tabindex)){
$tabindex = 200;
}
$accesskey = $conf['AccessKey'];
if (empty($accesskey)){
$accesskey = 'b';
}
$rootNodeUid = $conf['RootNodeUid'];
if (empty($rootNodeUid)){
$rootNodeUid = 0;
}
// get session data
$sessionData = array();
$sessionData = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_unisbghookconsumer_breadcrumb');
// iterate through the rootline and reverse the order to geht: home->subleve01->sublevel02 aso...
$rootline = $GLOBALS['TSFE']->rootLine;
// reset the session variable while the main navigation root has changed
if ($this->isMainNavigationRoot($rootline, $rootNodeUid) === true){
$GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_unisbghookconsumer_breadcrumb', NULL);
$sessionData = array();
}
$counter = 0;
$breadcrumbs = array();
foreach ($rootline as $page) {
// do not show the root-node an the node for the "zentrale navigation" is specified
if ($page['pid'] == '0' || $page['pid'] == $rootNodeUid){
$counter++;
continue;
}
$title = '';
if (isset($page['_MOUNT_OL'])){
// show content from mounted page has been chosen
if ($page['_MOUNT_OL'] == '1'){
// get the mount point referer
$mp = split('-',$page['_MP_PARAM']);
$mp = $mp[1];
// get the mount point's title - if not standard language the $page['title'] might allready contain a valid name as it comes from the subnavilink
if (!empty($page['_MOUNT_PAGE']) && $GLOBALS['TSFE']->sys_language_uid == 0) {
$title = $page['_MOUNT_PAGE']['title'];
}
}
}
// if no mount point's title was found takte title of the current page
if (empty($title)){
$title = $page['title'];
}
// get link
$mountPointRaw = '';
if (!empty($page['_MP_PARAM'])){
$mountPointRaw = $page['_MP_PARAM'];
}
// sometimes the MP param gets lost (if eg nested mountpoints are configured) get the MP out of the GET/POST params
$mpParam = t3lib_div::_GP('MP');
$currentPageId = t3lib_div::_GP('id');
if (!empty($mpParam) && empty($mountPointRaw)){
// only append to the current page
if ($page['uid'] == $currentPageId){
$mountPointRaw = $mpParam;
}
}
// store data into session
$linkData = array();
$linkData['id'] = $page['uid'];
$linkData['MP'] = $mountPointRaw;
$linkData['title'] = $title;
// somtetimes mountpoint data is getting lost use session to save it
$idExists = false;
for ($i = 0; $i < count($sessionData); $i++) {
if (intval($sessionData[$i]['id']) === intval($linkData['id'])){
// if at any point of time there is some additional mountpoint information save it in order to not get lost
if (!empty($linkData['MP'])){
if (count($linkData['MP']) > count($sessionData[$i]['MP'])){
$sessionData[$i]['MP'] = $linkData['MP'];
}
}
// overwrite title if it was substituted
if (empty($sessionData[$i]['isTitleSubstituted'])){
$sessionData[$i]['title'] = $linkData['title'];
}
// overwrite title if it was substituted and the language has changed
$hasChangedLanguage = false;
if (isset($sessionData[$i]['L'])){
if ($GLOBALS['TSFE']->sys_language_uid != $sessionData[$i]['L']){
$hasChangedLanguage = true;
}
}
if (!empty($sessionData[$i]['isTitleSubstituted']) && $hasChangedLanguage){
$sessionData[$i]['title'] = $linkData['title'];
unset($sessionData[$i]['isTitleSubstituted']);
}
$idExists = true;
break;
}
}
// append items which id does not exist allready in the session
if ($idExists === false){
$sessionData[] = $linkData;
}
// search for the link data in the session array in order to extract the whole link data needed
// this information may be saved before so synchronize the rootline with the session array
for ($i = 0; $i < count($sessionData); $i++) {
if ($sessionData[$i]['id'] == $linkData['id']){
$breadcrumbs[] = $sessionData[$i];
break;
}
}
$counter++;
}
// remove nested loops / entries
$breadcrumbs = $this->removeLoops($breadcrumbs);
// sync back the navigation to the session
$sessionData = $breadcrumbs;
// store session data
$GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_unisbghookconsumer_breadcrumb', $sessionData);
$content .= $this->renderBreadcrumbs($breadcrumbs, $tabindex, $accesskey);
return $content;
}
/**
* Checks for nested loops and removes the first occurency, tries to overwrite mountpoint title when specified, also cuts the internal used
* rootline ($GLOBALS['TSFE']->tmpl->rootLine) in order not to interfear with the realurl extension
* @param array $breadcrumbs Collection containing current navigation data stored in the session
*/
private function removeLoops($breadcrumbs){
// search first occurency of current page, cut other pages allready saved in the session
$indexFound = -1;
for ($i = count($breadcrumbs)-1; $i > 0; $i--) {
if ($breadcrumbs[$i]['id'] == $breadcrumbs[0]['id'] && $i < count($breadcrumbs)-1){
$indexFound = $i;
// check if language has changed
// $hasChangedLanguage = false;
// if (isset($breadcrumbs[$i]['L'])){
// if ($GLOBALS['TSFE']->sys_language_uid != $breadcrumbs[$i]['L']){
// $hasChangedLanguage = true;
// }
// }
// overwrite title with title from mountpoint if not allready overwritten
if (empty($breadcrumbs[$i]['isTitleSubstituted']) || $hasChangedLanguage){
$breadcrumbs[$i]['title'] = $breadcrumbs[0]['title'];
$breadcrumbs[$i]['isTitleSubstituted'] = 1;
$breadcrumbs[$i]['L'] = $GLOBALS['TSFE']->sys_language_uid; // save language for later comparision
}
// the $GLOBALS['TSFE']->tmpl->rootLine seems to be the internal memory for all pages navigated in the rootline before
// if we remove some page in order to avoid nested loops we also have to remove this entries from the $GLOBALS['TSFE']->tmpl->rootLine
for ($j = 0; $j < count($GLOBALS['TSFE']->tmpl->rootLine); $j++) {
// search for the first occurency in the array which is sorted like root->sublevels aso
if ($GLOBALS['TSFE']->tmpl->rootLine[$j]['uid'] == $breadcrumbs[$i]['id']){
// remove all items after the first occurency
$GLOBALS['TSFE']->tmpl->rootLine = array_slice($GLOBALS['TSFE']->tmpl->rootLine, 0, $j+1);
break;
}
}
// The $GLOBALS['TSFE']->MP seems to hold the latest mountpoint data navigated yet. If there are nested mounpoints eg. 5350-19947,19941-20722
// the mount-point pair at the end should be removed
if (!empty($GLOBALS['TSFE']->MP)){
$mountpoints = split(',', $GLOBALS['TSFE']->MP);
if (!empty($mountpoints)){
$mountpoints = array_slice($mountpoints, 0, (count($mountpoints)-1));
$GLOBALS['TSFE']->MP = join(',', $mountpoints);
}
}
break;
}
}
// copy element until the item search for into a new array, including the searched for item
$newBreadcumbs = array();
if ($indexFound > -1){
for ($i = count($breadcrumbs)-1; $i >= $indexFound; $i--) {
$newBreadcumbs[] = $breadcrumbs[$i];
}
}
else { // if not found return the old array
$newBreadcumbs = array_reverse($breadcrumbs);
}
return $newBreadcumbs;
}
/**
*
* Extracts the main information out of the rootline in order to debug it later on.
* @param array $rootline Rootline of the current page.
* @return string String containing the debug information (human readable)
*/
private function debugRootline($rootline){
$debugData = array();
foreach ($rootline as $page) {
$data = array();
$data['uid'] = $page['uid'];
$data['pid'] = $page['pid'];
$data['title'] = $page['title'];
$data['mount_pid'] = $page['mount_pid'];
$data['mount_pid_ol'] = $page['mount_pid_ol'];
$data['_MOUNT_OL'] = $page['_MOUNT_OL'];
$data['_MOUNT_PAGE'] = $page['_MOUNT_PAGE'];
$data['_MOUNTED_FROM'] = $page['_MOUNTED_FROM'];
$data['_MP_PARAM'] = $page['_MP_PARAM'];
$debugData[] = $data;
}
return print_r($debugData, true);
}
/**
* Removes the MP params from the specified string eg. &MP=123-456&test=123 -> &test=123
* @param string $linkVars String to be replaced.
* @return string Replaced string.
*/
private function removeMPparams($linkVars){
$cleanedParams = $linkVars;
$pos = stripos($linkVars, '&MP=');
if ($pos !== false){
$mpParams = substr($linkVars, $pos, strlen($linkVars)-$pos);
// check if it is not the last param
$end = stripos($mpParams, '&');
if ($end != false){
$mpParams = substr($mpParams, 0, $end);
}
$cleanedParams = str_ireplace($mpParams, '', $linkVars);
}
return $cleanedParams;
}
/**
* Renders the breadcrumb navigation HTML code.
* @param array $breadcrumbs Collection containing the latest navigation data.
* @param integer $tabindex Integer value to specify the links tabindex.
* @param string $accesskey The link's accesskey which will be assigned to the first link.
* @return string The HTML code <li> wrapped <a>-Tags
*/
private function renderBreadcrumbs($breadcrumbs, $tabindex, $accesskey) {
$navigation = '';
$counter = 0;
foreach ($breadcrumbs as $breadcrumb) {
// delete unwanted MP-data out of the $GLOBALS['TSFE']->linkVars representing the current URL
$GLOBALS['TSFE']->linkVars = $this->removeMPparams($GLOBALS['TSFE']->linkVars);
$href = $GLOBALS['TSFE']->cObj->getTypoLink_URL($breadcrumb['id'], $breadcrumb['MP']);
//error_log('MP:'.$GLOBALS['TSFE']->MP.', linkvars: '.$GLOBALS['TSFE']->linkVars.', uid: '.$breadcrumb['id'].', href: '.$href."\n", 3, 'C:\xampp\apache\logs\error.log' );
// extract & prepare data
$id = $breadcrumb['id'];
$mountpoint = $breadcrumb['MP'];
if (!empty($mountpoint)){
$mountpoint = '&MP='.$mountpoint;
}
$title = $breadcrumb['title'];
// add access-key to first link
if ($counter == 0){
$navigation .= '<li><a href="'.$href.'" title="'.$title.'" id="access-'.$accesskey.'" accesskey="'.$accesskey.'" tabindex="'.$tabindex.'">'.$title.'</a></li>';
}
elseif ($counter == count($breadcrumbs)-1){ // un-link the last element -> it is the current one
$navigation .= '<li><strong title="'.$title.'">'.$title.'</strong></li>';
}
else {
$navigation .= '<li><a href="'.$href.'" title="'.$title.'" tabindex="'.$tabindex.'">'.$title.'</a></li>';
}
$counter++;
$tabindex++;
}
return $navigation;
}
}
?>
vielleicht hilft's ja jemandem...