diff -ur trunk/t3lib/class.t3lib_befunc.php trunk.v3/t3lib/class.t3lib_befunc.php --- trunk/t3lib/class.t3lib_befunc.php 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/t3lib/class.t3lib_befunc.php 2010-11-14 02:31:21.000000000 +0100 @@ -857,7 +857,12 @@ /** * 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 SPRITE:. 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() { $languages = t3lib_div::makeInstance('t3lib_transl8tools')->getSystemLanguages(); @@ -865,9 +870,9 @@ foreach ($languages as $language) { if($language['uid'] !== -1) { $sysLanguages[] = array( - 0 => $language['title'], + 0 => htmlspecialchars($language['title']) . ' [' . $language['uid'] . ']', 1 => $language['uid'], - 2 => $language['flagIcon'] + 2 => 'SPRITE:'.$language['flagIcon'] ); } } diff -ur trunk/t3lib/class.t3lib_recordlist.php trunk.v3/t3lib/class.t3lib_recordlist.php --- trunk/t3lib/class.t3lib_recordlist.php 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/t3lib/class.t3lib_recordlist.php 2010-11-14 00:54:12.000000000 +0100 @@ -374,8 +374,13 @@ * @return string Language icon */ function languageFlag($sys_language_uid) { - return ($this->languageIconTitles[$sys_language_uid]['flagIcon'] ? t3lib_iconWorks::getSpriteIcon($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; } /** diff -ur trunk/t3lib/class.t3lib_tceforms.php trunk.v3/t3lib/class.t3lib_tceforms.php --- trunk/t3lib/class.t3lib_tceforms.php 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/t3lib/class.t3lib_tceforms.php 2010-11-14 02:21:52.000000000 +0100 @@ -1813,8 +1813,13 @@ // Icon: $selIconFile = ''; + $selIconSprite = ''; if ($p[2]) { list($selIconFile,$selIconInfo) = $this->getIcon($p[2]); + if ($selIconInfo === 'SPRITE') { + $selIconSprite = $selIconFile; + $selIconFile = ''; + } } // Compile row: @@ -1848,6 +1853,7 @@ insertDefStyle('check').' name="'.htmlspecialchars($PA['itemFormElName'].'['.$c.']').'" value="'.htmlspecialchars($p[1]).'"'.$sM.' onclick="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].' /> '. ($selIconFile ? '' : ''). + ($selIconSprite ? $selIconSprite . ' ' : ''). $label . ' ' . (strcmp($p[3],'') ? $help : '') . ' @@ -4067,8 +4073,8 @@ /** * Get icon (for example for selector boxes) * - * @param string Icon reference - * @return array Array with two values; the icon file reference (relative to PATH_typo3 minus backPath), the icon file information array (getimagesize()) + * @param string Icon reference (filename). Or "SPRITE:" + * @return array Array with two values; the icon file reference (relative to PATH_typo3 minus backPath), the icon file information array (getimagesize()). If $icon is a sprite, the full HTML will be returned in value 1, the second value will be "SPRITE" */ function getIcon($icon) { if (substr($icon,0,4)=='EXT:') { @@ -4084,6 +4090,9 @@ } elseif (substr($icon,0,4)=='ext/' || substr($icon,0,7)=='sysext/') { $selIconFile = $this->backPath.$icon; $selIconInfo = @getimagesize(PATH_typo3.$icon); + } elseif (preg_match('/^SPRITE:(.*)/', $icon, $matches)) { + $selIconFile = t3lib_iconWorks::getSpriteIcon($matches[1]); + $selIconInfo = 'SPRITE'; } else { $selIconFile = t3lib_iconWorks::skinImg($this->backPath,'gfx/'.$icon,'',1); $iconPath = substr($selIconFile, strlen($this->backPath)); @@ -6241,7 +6250,15 @@ } } - return ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon'] ? '' : ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['title'] ? '['.$this->cachedLanguageFlag[$mainKey][$sys_language_uid]['title'].']' : '')).' '; + $out = ''; + if ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon']) { + $out .= t3lib_iconWorks::getSpriteIcon($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['flagIcon']); + $out .= ' '; + } else if ($this->cachedLanguageFlag[$mainKey][$sys_language_uid]['title']) { + $out .= '['.$this->cachedLanguageFlag[$mainKey][$sys_language_uid]['title'].']'; + $out .= ' '; + } + return $out; } /** diff -ur trunk/t3lib/class.t3lib_transl8tools.php trunk.v3/t3lib/class.t3lib_transl8tools.php --- trunk/t3lib/class.t3lib_transl8tools.php 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/t3lib/class.t3lib_transl8tools.php 2010-11-14 02:44:23.000000000 +0100 @@ -78,16 +78,16 @@ $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($page_id, 'mod.SHARED'); $languageIconTitles = array(); - // falback "old iconstyles" - if (($pos = strrpos($modSharedTSconfig['properties']['defaultLanguageFlag'], '.')) !== FALSE) { - $modSharedTSconfig['properties']['defaultLanguageFlag'] = substr($modSharedTSconfig['properties']['defaultLanguageFlag'], 0, - $pos); + // 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->sL('LLL:EXT:lang/locallang_general.xml:defaultLanguage').')' : $LANG->sL('LLL:EXT:lang/locallang_general.xml: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']) ? $modSharedTSconfig['properties']['defaultLanguageFlag'] : 'empty-empty', + 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) ? 'flags-' . $modSharedTSconfig['properties']['defaultLanguageFlag'] : 'empty-empty', ); // Set "All" language: diff -ur trunk/typo3/alt_doc.php trunk.v3/typo3/alt_doc.php --- trunk/typo3/alt_doc.php 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/typo3/alt_doc.php 2010-11-14 00:57:29.000000000 +0100 @@ -1211,9 +1211,9 @@ $modSharedTSconfig = t3lib_BEfunc::getModTSconfig($id, 'mod.SHARED'); // fallback non sprite-configuration - if (($pos = strrpos($modSharedTSconfig['properties']['defaultLanguageFlag'], '.')) !== FALSE) { - $modSharedTSconfig['properties']['defaultLanguageFlag'] = substr($modSharedTSconfig['properties']['defaultLanguageFlag'], 0, - $pos); - } + if (preg_match('/\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) { + $modSharedTSconfig['properties']['defaultLanguageFlag'] = str_replace('.gif', '', $modSharedTSconfig['properties']['defaultLanguageFlag']); + } $languages = array( 0 => array( diff -ur trunk/typo3/sysext/beuser/mod/index.php trunk.v3/typo3/sysext/beuser/mod/index.php --- trunk/typo3/sysext/beuser/mod/index.php 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/typo3/sysext/beuser/mod/index.php 2010-11-14 02:28:35.000000000 +0100 @@ -774,7 +774,9 @@ foreach ($items as $iCfg) { if (isset($nef[$iCfg[1]])) { unset($nef[$iCfg[1]]); - if (strlen($iCfg[2])) { + if (preg_match('/^SPRITE:(.*)/', $iCfg[2], $match)) { + $icon = t3lib_iconWorks::getSpriteIcon($match[1]) . ' '; + } elseif (strlen($iCfg[2])) { $icon = ''; } else { $icon = ''; diff -ur trunk/typo3/sysext/lang/locallang_general.xml trunk.v3/typo3/sysext/lang/locallang_general.xml --- trunk/typo3/sysext/lang/locallang_general.xml 2010-11-14 02:36:40.000000000 +0100 +++ trunk.v3/typo3/sysext/lang/locallang_general.xml 2010-11-14 01:04:47.000000000 +0100 @@ -10,7 +10,6 @@ -