Index: lib/class.tx_commerce_db_list_extra.inc
===================================================================
--- lib/class.tx_commerce_db_list_extra.inc	(Revision 53709)
+++ lib/class.tx_commerce_db_list_extra.inc	(Arbeitskopie)
@@ -891,67 +891,55 @@
 											<div class="typo3-clipCtrl">'.implode('',$cells).'</div>';
 	}
 
+    
+    /**
+     * Creates the localization panel
+     *
+     * @param   string      The table
+     * @param   array       The record for which to make the localization panel.
+     * @return  array       Array with key 0/1 with content for column 1 and 2
+     */
+    function makeLocalizationPanel($table,$row) {
+        global $TCA,$LANG;
 
-	/**
-	 * Creates the localization panel
-	 *
-	 * @param	string		The table
-	 * @param	array		The record for which to make the localization panel.
-	 * @return	array		Array with key 0/1 with content for column 1 and 2
-	 */
-	function makeLocalizationPanel($table,$row)	{
-		global $TCA,$LANG;
+        $out = array(
+            0 => '',
+            1 => '',
+        );
+        $translations = $this->translateTools->translationInfo($table, $row['uid'], 0, $row, $this->selFieldList);
+        $this->translations = $translations['translations'];
 
-		$out = array(
-			0 => '',
-			1 => '',
-		);
-		if ($TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'])	{
+            // Language title and icon:
+        $out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);
 
-				// Language title and icon:
-			$out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);
+        if (is_array($translations))    {
 
-				// Create new localizations links:
-			if ($row[$TCA[$table]['ctrl']['languageField']] <=0)	{
+            // Traverse page translations and add icon for each language that does NOT yet exist:
+            $lNew = '';
+            foreach($this->pageOverlays as $lUid_OnPage => $lsysRec)    {
+                if (!isset($translations['translations'][$lUid_OnPage]) && $GLOBALS['BE_USER']->checkLanguageAccess($lUid_OnPage))  {
+                    $href = $GLOBALS['TBE_TEMPLATE']->issueCommand('&cmd['.$table.']['.$row['uid'].'][localize]='.$lUid_OnPage,$rUrl='');
+					$href = $this->backPath . $href; // Korr. Graytree
+                    $language = t3lib_BEfunc::getRecord('sys_language', $lUid_OnPage, 'title');
+                    if ($this->languageIconTitles[$lUid_OnPage]['flagIcon']) {
+                        $lC = t3lib_iconWorks::getSpriteIcon($this->languageIconTitles[$lUid_OnPage]['flagIcon']);;
+                    } else {
+                        $lC = $this->languageIconTitles[$lUid_OnPage]['title'];
+                    }
+                    $lC = '<a href="' . htmlspecialchars($href) . '" title="' . htmlspecialchars($language['title']) . '">' . $lC . '</a> ';
 
-					// Look for translations of this record, index by language field value:
-				$translations = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-					'uid,'.$TCA[$table]['ctrl']['languageField'],
-					$table,
-					'pid='.intval($this->id).
-						' AND '.$TCA[$table]['ctrl']['languageField'].'>0'.
-						' AND '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).
-						t3lib_BEfunc::deleteClause($table),
-					'',
-					'',
-					'',
-					$TCA[$table]['ctrl']['languageField']
-				);
-				
-					// Traverse page translations and add icon for each language that does NOT yet exist:
-				$lNew = '';
-				foreach($this->pageOverlays as $lUid_OnPage => $lsysRec)	{
-					if (!isset($translations[$lUid_OnPage]))	{
-						$href = $GLOBALS['TBE_TEMPLATE']->issueCommand('&cmd['.$table.']['.$row['uid'].'][localize]='.$lUid_OnPage,$rUrl='');
-						$href = $this->backPath . $href; // Korr. Graytree
+                    $lNew.=$lC;
+                }
+            }
 
-						$lC = ($this->languageIconTitles[$lUid_OnPage]['flagIcon'] ? '<img src="'.$this->languageIconTitles[$lUid_OnPage]['flagIcon'].'" class="absmiddle" alt="" />' : $this->languageIconTitles[$lUid_OnPage]['title']);
-						$lC = '<a href="'.htmlspecialchars($href).'">'.$lC.'</a> ';
+            if ($lNew)  $out[1].= $lNew;
+        } else if ($row['l18n_parent']) {
+            $out[0] = '&nbsp;&nbsp;&nbsp;&nbsp;'.$out[0];
+        }
+        return $out;
+    }
 
-						$lNew.=$lC;
-					}
-				}
 
-				if ($lNew)	$out[1].= $lNew;
-			} else {
-				$out[0] = '&nbsp;&nbsp;&nbsp;&nbsp;'.$out[0];
-			}
-		}
-
-		return $out;
-	}
-
-
 	/**
 	 * Creates the URL to this script, including all relevant GPvars
 	 * Fixed GPvars are id, table, imagemode, returlUrl, search_field, search_levels and showLimit