0006087_post_cleanup.patch

Administrator Admin, 2008-03-31 14:42

Download (4.77 KB)

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
3193 3193
			$fCfg = $GLOBALS['TCA'][$table]['columns'][$field];
3194 3194

  
3195 3195
				// Don't show content if it's for IRRE child records:
3196
			if (isset($fCfg['config']['type']) && $fCfg['config']['type']!='inline') {
3196
			if ($fCfg['config']['type']!='inline') {
3197 3197
				if (strcmp($dLVal,''))	{
3198 3198
					$item.='<div class="typo3-TCEforms-originalLanguageValue">'.$this->getLanguageIcon($table,$row,0).$this->previewFieldValue($dLVal,$fCfg).'&nbsp;</div>';
3199 3199
				}
t3lib/class.t3lib_befunc.php (Arbeitskopie)
451 451
	 * @return	mixed		Multidimensional array with selected records; if none exist, false is returned
452 452
	 */
453 453
	public function getRecordLocalization($table, $uid, $language, $andWhereClause = '') {
454
		$recordLocalization = false; 
455
		if (isset($GLOBALS['TCA'][$table]['ctrl'])) {
456
			$tcaCtrl =& $GLOBALS['TCA'][$table]['ctrl'];
457
			if (isset($tcaCtrl['transOrigPointerField']) && isset($tcaCtrl['languageField'])) {
458
				$recordLocalization = t3lib_BEfunc::getRecordsByField(
459
					$table,
460
					$tcaCtrl['transOrigPointerField'],
461
					$uid,
462
					'AND '.$tcaCtrl['languageField'].'='.intval($language).($andWhereClause ? ' '.$andWhereClause : ''),
463
					'',
464
					'',
465
					'1'
466
				);
467
			}
454
		$recordLocalization = false;
455
		if (self::isTableLocalizable($table)) {
456
			$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
457
			$recordLocalization = t3lib_BEfunc::getRecordsByField(
458
				$table,
459
				$tcaCtrl['transOrigPointerField'],
460
				$uid,
461
				'AND '.$tcaCtrl['languageField'].'='.intval($language).($andWhereClause ? ' '.$andWhereClause : ''),
462
				'',
463
				'',
464
				'1'
465
			);
468 466
		}
469
		return $recordLocalization;		
467
		return $recordLocalization;
470 468
	}
471 469

  
472 470

  
......
849 847
	public function isTableLocalizable($table) {
850 848
		$isLocalizable = false;
851 849
		if (isset($GLOBALS['TCA'][$table]['ctrl']) && is_array($GLOBALS['TCA'][$table]['ctrl'])) {
852
			$tcaCtrl =& $GLOBALS['TCA'][$table]['ctrl'];
850
			$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
853 851
			$isLocalizable = (isset($tcaCtrl['languageField']) && $tcaCtrl['languageField'] && isset($tcaCtrl['transOrigPointerField']) && $tcaCtrl['transOrigPointerField']);
854 852
		}
855 853
		return $isLocalizable;
......
861 859
	 * If the table is not prepared for localization or not defined at all in $TCA, false is returned.
862 860
	 *
863 861
	 * @param	string		$table: The name of the table to lookup in TCA
864
	 * @param	mixed		$fieldOrConfig: The fieldname (string) or the configuration of the field to check (array) 
865
	 * @return	mixed		If table is localizable, the set localizationMode is returned (if property is not set, 'select' is returned by default); if table is not localizable, false is returned 
862
	 * @param	mixed		$fieldOrConfig: The fieldname (string) or the configuration of the field to check (array)
863
	 * @return	mixed		If table is localizable, the set localizationMode is returned (if property is not set, 'select' is returned by default); if table is not localizable, false is returned
866 864
	 */
867 865
	public function getInlineLocalizationMode($table, $fieldOrConfig) {
868 866
		$localizationMode = false;
869
		if (is_array($fieldOrConfig) && count($fieldOrConfig)) {	
867
		if (is_array($fieldOrConfig) && count($fieldOrConfig)) {
870 868
			$config = $fieldOrConfig;
871 869
		} elseif (is_string($fieldOrConfig) && isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
872 870
			$config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
......
875 873
			$localizationMode = (isset($config['behaviour']['localizationMode']) && $config['behaviour']['localizationMode'] ? $config['behaviour']['localizationMode'] : 'select');
876 874
				// The mode 'select' is not possible when child table is not localizable at all:
877 875
			if ($localizationMode=='select' && !self::isTableLocalizable($config['foreign_table'])) {
878
				$localizationMode = false; 
876
				$localizationMode = false;
879 877
			}
880 878
		}
881 879
		return $localizationMode;
t3lib/class.t3lib_tcemain.php (Arbeitskopie)
2946 2946
	 * @param	array		Record array
2947 2947
	 * @param	array		TCA field configuration
2948 2948
	 * @param	integer		Real page id (pid) the record is copied to
2949
	 * @param	integer		Language ID (from sys_language table)
2949
	 * @param	integer		Language ID (from sys_language table) used in the duplicated record
2950 2950
	 * @return	mixed		Processed value. Normally a string/integer, but can be an array for flexforms!
2951 2951
	 * @access private
2952 2952
	 * @see copyRecord()