public function languageOverlay(array $rows, $table)
    {

        // see https://github.com/teaminmedias-pluswerk/ke_search/issues/128
        $LanguageMode = $GLOBALS['TSFE']->sys_language_content;
        if (\TYPO3\CMS\Core\Utility\GeneralUtility::hideIfNotTranslated($GLOBALS['TSFE']->page['l18n_cfg'])) {
            $LanguageMode = 'hideNonTranslated';
        }
        if (is_array($rows) && count($rows)) {
            foreach ($rows as $key => $row) {
                if (is_array($row) && $GLOBALS['TSFE']->sys_language_content) {
                    $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(
                        $table,
                        $row,
                        $GLOBALS['TSFE']->sys_language_content,
                        $LanguageMode
                    );

                    if (is_array($row)) {
                        if ($table == "tx_kesearch_filters") {
                            $row['rendertype'] = $rows[$key]['rendertype'];
                        }
                        $rows[$key] = $row;
                    } else {
                        unset($rows[$key]);
                    }
                }
            }
            return $rows;
        } else {
            return array();
        }
    }
public function languageOverlay(array $rows, $table)
    {

        // see https://github.com/teaminmedias-pluswerk/ke_search/issues/128
        $LanguageMode = $GLOBALS['TSFE']->sys_language_content;
        if (\TYPO3\CMS\Core\Utility\GeneralUtility::hideIfNotTranslated($GLOBALS['TSFE']->page['l18n_cfg'])) {
            $LanguageMode = 'hideNonTranslated';
        }
        if (is_array($rows) && count($rows)) {
            foreach ($rows as $key => $row) {
                if (is_array($row) && $GLOBALS['TSFE']->sys_language_content) {
                    $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(
                        $table,
                        $row,
                        $GLOBALS['TSFE']->sys_language_content,
                        $LanguageMode
                    );

                    if (is_array($row)) {
                        if ($table == "tx_kesearch_filters") {
                            $row['rendertype'] = $rows[$key]['rendertype'];
                        }
                        $rows[$key] = $row;
                    } else {
                        unset($rows[$key]);
                    }
                }
            }
            return $rows;
        } else {
            return array();
        }
    }
public function languageOverlay ( array $ rows , $ table ) { // see https://github.com/teaminmedias-pluswerk/ke_search/issues/128 $ LanguageMode = $ GLOBALS [ 'TSFE' ] -> sys_language_content ; if ( \ TYPO3 \ CMS \ Core \ Utility \ GeneralUtility :: hideIfNotTranslated ( $ GLOBALS [ 'TSFE' ] -> page [ 'l18n_cfg' ] ) ) { $ LanguageMode = 'hideNonTranslated' ; } if ( is_array ( $ rows ) && count ( $ rows ) ) { foreach ( $ rows as $ key => $ row ) { if ( is_array ( $ row ) && $ GLOBALS [ 'TSFE' ] -> sys_language_content ) { $ row = $ GLOBALS [ 'TSFE' ] -> sys_page -> getRecordOverlay ( $ table , $ row , $ GLOBALS [ 'TSFE' ] -> sys_language_content , $ LanguageMode ) ; if ( is_array ( $ row ) ) { if ( $ table == "tx_kesearch_filters" ) { $ row [ 'rendertype' ] = $ rows [ $ key ] [ 'rendertype' ] ; } $ rows [ $ key ] = $ row ; } else { unset ( $ rows [ $ key ] ) ; } } } return $ rows ; } else { return array ( ) ; } }
Translate the given records
@param array $rows The records which have to be translated
@param string $table Define the table from where the records come from
@return array The localized records
Translate the given records