public function user_fieldvisibility($PA, $fobj)
 {
     $this->init();
     //init some class attributes
     $this->pageId = $PA['row']['pid'];
     $uid = $PA['row']['uid'];
     if (substr($uid, 0, 3) == 'NEW') {
         $this->isNewElement = TRUE;
     }
     if ($PA['table'] == 'pages' && !$this->isNewElement) {
         $this->pageId = $PA['row']['uid'];
     }
     $_modTSconfig = $GLOBALS["BE_USER"]->getTSConfig('mod.languagevisibility', t3lib_BEfunc::getPagesTSconfig($this->pageId));
     $this->modTSconfig = $_modTSconfig['properties'];
     ###
     $languageRep = t3lib_div::makeInstance('tx_languagevisibility_languagerepository');
     $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);
     }
     $value = $PA['row'][$PA['field']];
     $table = $PA['table'];
     $isOverlay = tx_languagevisibility_beservices::isOverlayRecord($PA['row'], $table);
     $visivilitySetting = @unserialize($value);
     if (!is_array($visivilitySetting) && $value != '') {
         $content .= 'Visibility Settings seems to be corrupt:' . $value;
     }
     if ($isOverlay) {
         $uid = tx_languagevisibility_beservices::getOriginalUidOfTranslation($PA['row'], $table);
         $table = tx_languagevisibility_beservices::getOriginalTableOfTranslation($table);
         //This element is an overlay therefore we need to render the visibility field just for the language of the overlay
         $overlayRecordsLanguage = $languageRep->getLanguageById($PA['row']['sys_language_uid']);
         try {
             $originalElement = $elementfactory->getElementForTable($table, $uid);
         } catch (Exception $e) {
             return '';
         }
         $infosStruct = $this->_getLanguageInfoStructurListForElementAndLanguageList($originalElement, array($overlayRecordsLanguage), $PA['itemFormElName'], true);
     } else {
         //This element is an original element (no overlay)
         try {
             $originalElement = $elementfactory->getElementForTable($table, $uid);
         } catch (Exception $e) {
             return 'sorry this element supports no visibility settings';
         }
         $content .= $originalElement->getInformativeDescription();
         if ($originalElement->isMonolithicTranslated()) {
             return $content;
         }
         $languageList = $languageRep->getLanguages();
         $infosStruct = $this->_getLanguageInfoStructurListForElementAndLanguageList($originalElement, $languageList, $PA['itemFormElName'], false);
     }
     $content .= $this->_renderLanguageInfos($infosStruct);
     return '<div id="fieldvisibility">' . $content . '<a href="#" onclick="resetSelectboxes()">reset</a></div>' . $this->_javascript();
 }