*/ /** * Usage in Typoscript: * * includeLibs.tablabels = fileadmin/tabslabel.php * lib.tabLabels = USER_INT * lib.tabLabels.userFunc = user_tablabels->GetTabLabels */ class user_tablabels { var $cObj; // Reference to the parent (calling) cObj set from TypoScript var $cObjOrg; // Reference to the parent (calling) cObj set from TypoScript function GetTabLabels( $content, $conf ){ // Step 1 : Retrieve the ID of Main FCE Container(s) $flexFormXML = $GLOBALS['TSFE']->page['tx_templavoila_flex']; $dataArray = t3lib_div::xml2array($flexFormXML); $uids = $dataArray['data']['sDEF']['lDEF']['field_content']['vDEF']; // Step 2 : Retrieve from the Database Main FCE Container(s) $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( "*", "tt_content", "uid IN(".$uids.") AND CType='templavoila_pi1' " . $this->cObj->enableFields("tt_content") ); while ( $result && $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc( $result ) ){ // Step 3 : Retrieve ID of the Sub FCE Containers $XML = $row['tx_templavoila_flex']; $contentArray = t3lib_div::xml2array($XML); $panels = $contentArray['data']['sDEF']['lDEF']['field_content']['vDEF']; // Step 4 : Retrieve from the Database the Sub FCE Containers $result_panels = $GLOBALS['TYPO3_DB']->exec_SELECTquery( "*", "tt_content", "uid IN(".$panels.") AND CType='templavoila_pi1' " . $this->cObj->enableFields("tt_content") ); while ( $result_panels && $row_panel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result_panels)){ $panelrows[ $row_panel["uid"] ] = $row_panel; } $panelsa = explode( ",", $panels ); foreach ( $panelsa as $value ){ if ( is_array($panelrows[$value] ) ){ // Step 5 :Read the header of the Sub FCE Containers. $header = htmlentities($panelrows[$value]["header"]); if ( $GLOBALS['TSFE']->sys_language_content > 0 ){ $flex = t3lib_div::xml2array($panelrows[$value]['tx_templavoila_flex']); if (is_array($flex['data']) && is_array($flex['data']['sDEF']) && is_array($flex['data']['sDEF']['lDEF']) && is_array($flex['data']['sDEF']['lDEF']['field_title_language_overlays']) ){ $languages = $flex['data']['sDEF']['lDEF']['field_title_language_overlays']['vDEF']; if ($languages ){ $langs = explode('|',$languages); if ($GLOBALS['TSFE']->sys_language_content <= count($langs) ){ //echo $GLOBALS['TSFE']->sys_language_content ."-". count($langs); if ( strlen($langs[$GLOBALS['TSFE']->sys_language_content-1])>3){ $header = $langs[$GLOBALS['TSFE']->sys_language_content-1]; } } } } } // Step 6 :Add header of the Sub FCE Containers to the content array $content[] = '"'.$header.'"'; } } } // Step 7 :Make the list return implode(',',$content); } } ?>