function _hasOverlayRecordForLanguage($id) { $languageRep = tx_languagevisibility_languagerepository::makeInstance(); $language = $languageRep->getLanguageById($id); $this->langIsoCodeForFlexFormCallback = strtoupper($language->getIsoCode()); $this->_callBackFoundOverlay = FALSE; // Get data structure: if ($this->langDisabled == 1 && !$this->langDatabaseOverlay) { //the FCE has langDisabled: this means there is no overlay if ($this->disabledIsVisible == 1) { return true; } else { return false; } } if ($GLOBALS['TSFE']) { @$GLOBALS['TSFE']->includeTCA(); } if ($this->langChildren == 1) { //the FCE has real overlay record $flexObj = t3lib_div::makeInstance('t3lib_flexformtools'); if ($this->row['tx_templavoila_flex']) { $return = $flexObj->traverseFlexFormXMLData('tt_content', 'tx_templavoila_flex', $this->row, $this, '_hasOverlayRecordForLanguage_Inheritance_flexFormCallBack'); if ($return !== TRUE && strlen($return) > 0) { debug('FCE: _hasOverlayRecordForLanguage has error:' . $return); } return $this->_callBackFoundOverlay; } else { //in case no xml yet (new created?) return false; } } else { //the FCE has no real overlay record $flexObj = t3lib_div::makeInstance('t3lib_flexformtools'); $flexObj->traverseFlexFormXMLData('tt_content', 'tx_templavoila_flex', $this->row, $this, '_hasOverlayRecordForLanguage_Seperate_flexFormCallBack'); return $this->_callBackFoundOverlay; } }
/** * Helper function to check i an element with a given uid and tablename is visible for a languageid. * * @param int $uid * @param string $table * @param int $languageUid * @return boolean */ public static function isVisible($uid, $table, $languageUid, $omitLocal = false) { $cacheKey = sprintf('%s:%d:%d:%d', $table, $uid, $languageUid, $omitLocal); if (!isset(self::$cache_isVisible[$cacheKey])) { $rep = tx_languagevisibility_languagerepository::makeInstance(); $language = $rep->getLanguageById($languageUid); $dao = t3lib_div::makeInstance('tx_languagevisibility_daocommon'); if (version_compare(TYPO3_version, '4.3.0', '<')) { $elementfactoryName = t3lib_div::makeInstanceClassName('tx_languagevisibility_elementFactory'); $elementfactory = new $elementfactoryName($dao); } else { $elementfactory = t3lib_div::makeInstance('tx_languagevisibility_elementFactory', $dao); } try { $element = $elementfactory->getElementForTable($table, $uid); } catch (Exception $e) { return false; } $visibility = t3lib_div::makeInstance('tx_languagevisibility_visibilityService'); self::$cache_isVisible[$cacheKey] = $visibility->isVisible($language, $element, $omitLocal); } return self::$cache_isVisible[$cacheKey]; }