Index: t3lib/class.t3lib_recordlist.php
===================================================================
--- t3lib/class.t3lib_recordlist.php (Revision 9392)
+++ t3lib/class.t3lib_recordlist.php (Arbeitskopie)
@@ -374,8 +374,13 @@
* @return string Language icon
*/
function languageFlag($sys_language_uid) {
- return ($this->languageIconTitles[$sys_language_uid]['flagIcon'] ? '
' : '').
- htmlspecialchars($this->languageIconTitles[$sys_language_uid]['title']);
+ $out = '';
+ if ($this->languageIconTitles[$sys_language_uid]['flagIcon']) {
+ $out .= t3lib_iconWorks::getSpriteIcon($this->languageIconTitles[$sys_language_uid]['flagIcon']);
+ $out .= ' ';
+ }
+ $out .= htmlspecialchars($this->languageIconTitles[$sys_language_uid]['title']);
+ return $out;
}
/**
Index: t3lib/class.t3lib_transl8tools.php
===================================================================
--- t3lib/class.t3lib_transl8tools.php (Revision 9392)
+++ t3lib/class.t3lib_transl8tools.php (Arbeitskopie)
@@ -75,20 +75,19 @@
function getSystemLanguages($page_id=0,$backPath='') {
global $TCA,$LANG;
- // Icons and language titles:
- t3lib_div::loadTCA('sys_language');
- $flagAbsPath = t3lib_div::getFileAbsFileName($TCA['sys_language']['columns']['flag']['config']['fileFolder']);
- $flagIconPath = $backPath.'../'.substr($flagAbsPath, strlen(PATH_site));
-
$modSharedTSconfig = t3lib_BEfunc::getModTSconfig($page_id, 'mod.SHARED');
$languageIconTitles = array();
- // Set default:
+ // fallback "old iconstyles"
+ if (preg_match('/\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) {
+ $modSharedTSconfig['properties']['defaultLanguageFlag'] = str_replace('.gif', '', $modSharedTSconfig['properties']['defaultLanguageFlag']);
+ }
+
$languageIconTitles[0] = array(
'uid' => 0,
- 'title' => strlen ($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'].' ('.$LANG->getLL('defaultLanguage').')' : $LANG->getLL('defaultLanguage'),
+ 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'].' ('.$GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage').')' : $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage'),
'ISOcode' => 'DEF',
- 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) && @is_file($flagAbsPath.$modSharedTSconfig['properties']['defaultLanguageFlag']) ? $flagIconPath.$modSharedTSconfig['properties']['defaultLanguageFlag'] : null,
+ 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) ? 'flags-' . $modSharedTSconfig['properties']['defaultLanguageFlag'] : 'empty-empty',
);
// Set "All" language:
@@ -96,7 +95,7 @@
'uid' => -1,
'title' => $LANG->getLL('multipleLanguages'),
'ISOcode' => 'DEF',
- 'flagIcon' => $flagIconPath.'multi-language.gif',
+ 'flagIcon' => 'flags-multiple',
);
// Find all system languages:
@@ -115,7 +114,7 @@
}
}
if (strlen ($row['flag'])) {
- $languageIconTitles[$row['uid']]['flagIcon'] = @is_file($flagAbsPath.$row['flag']) ? $flagIconPath.$row['flag'] : '';
+ $languageIconTitles[$row['uid']]['flagIcon'] = t3lib_iconWorks::mapRecordTypeToSpriteIconName('sys_language', $row);
}
}
Index: t3lib/class.t3lib_befunc.php
===================================================================
--- t3lib/class.t3lib_befunc.php (Revision 9392)
+++ t3lib/class.t3lib_befunc.php (Arbeitskopie)
@@ -857,24 +857,25 @@
/**
* Returns an array with system languages:
*
- * @return array Array with languages
+ * Since TYPO3 4.5 the flagIcon is not returned as a filename in "gfx/flags/*" anymore,
+ * but as a string . The calling party should call
+ * t3lib_iconWorks::getSpriteIcon() to get an HTML which will represent
+ * the flag of this language.
+ *
+ * @return array Array with languages (title, uid, flagIcon)
*/
public static function getSystemLanguages() {
-
- // Initialize, add default language:
+ $languages = t3lib_div::makeInstance('t3lib_transl8tools')->getSystemLanguages();
$sysLanguages = array();
- $sysLanguages[] = array('Default language', 0);
-
- // Traverse languages
- $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,title,flag', 'sys_language', 'pid=0' . self::deleteClause('sys_language'));
- while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
- $sysLanguages[] = array(
- htmlspecialchars($row['title']) . ' [' . $row['uid'] . ']',
- $row['uid'],
- ($row['flag'] ? 'flags/' . $row['flag'] : '')
- );
+ foreach ($languages as $language) {
+ if($language['uid'] !== -1) {
+ $sysLanguages[] = array(
+ 0 => htmlspecialchars($language['title']) . ' [' . $language['uid'] . ']',
+ 1 => $language['uid'],
+ 2 => $language['flagIcon']
+ );
+ }
}
- $GLOBALS['TYPO3_DB']->sql_free_result($res);
return $sysLanguages;
}
Index: typo3/alt_doc.php
===================================================================
--- typo3/alt_doc.php (Revision 9392)
+++ typo3/alt_doc.php (Arbeitskopie)
@@ -1209,6 +1209,11 @@
global $LANG;
$modSharedTSconfig = t3lib_BEfunc::getModTSconfig($id, 'mod.SHARED');
+
+ // fallback non sprite-configuration
+ if (preg_match('/\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) {
+ $modSharedTSconfig['properties']['defaultLanguageFlag'] = str_replace('.gif', '', $modSharedTSconfig['properties']['defaultLanguageFlag']);
+ }
$languages = array(
0 => array(
Index: typo3/sysext/beuser/mod/index.php
===================================================================
--- typo3/sysext/beuser/mod/index.php (Revision 9392)
+++ typo3/sysext/beuser/mod/index.php (Arbeitskopie)
@@ -774,7 +774,9 @@
foreach ($items as $iCfg) {
if (isset($nef[$iCfg[1]])) {
unset($nef[$iCfg[1]]);
- if (strlen($iCfg[2])) {
+ if (strpos($iCfg[2], '.gif') === FALSE) {
+ $icon = t3lib_iconWorks::getSpriteIcon($iCfg[2]) . ' ';
+ } elseif (strlen($iCfg[2])) {
$icon = '
';
} else {
$icon = '';