Index: t3lib/stddb/tbl_be.php =================================================================== --- t3lib/stddb/tbl_be.php (Revision 9358) +++ t3lib/stddb/tbl_be.php (Arbeitskopie) @@ -804,11 +804,8 @@ 'config' => array( 'type' => 'select', 'items' => array( - array('', 0), + array('', 0, ''), ), - 'fileFolder' => 'typo3/gfx/flags/', // Only shows if "t3lib/" is in the PATH_site... - 'fileFolder_extList' => 'png,jpg,jpeg,gif', - 'fileFolder_recursions' => 0, 'selicon_cols' => 8, 'size' => 1, 'minitems' => 0, Index: typo3/sysext/t3skin/ext_tables.php =================================================================== --- typo3/sysext/t3skin/ext_tables.php (Revision 9358) +++ typo3/sysext/t3skin/ext_tables.php (Arbeitskopie) @@ -99,6 +99,35 @@ // Changing icon for filemounts, needs to be done here as overwriting the original icon would also change the filelist tree's root icon $TCA['sys_filemounts']['ctrl']['iconfile'] = '_icon_ftp_2.gif'; + // Adding flags to sys_language + t3lib_div::loadTCA('sys_language'); + $TCA['sys_language']['ctrl']['typeicon_column'] = 'flag'; + $TCA['sys_language']['ctrl']['typeicon_classes'] = array( + 'default' => 'mimetypes-x-sys_language', + 'mask' => 'flags-###TYPE###' + ); + $languageKeys = array( + 'ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'ar', 'as', 'at', + 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', 'bg', 'bh', 'bi', + 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', 'bw', 'by', 'bz', 'ca', + 'catalonia', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', 'ck', 'cl', 'cm', 'cn', + 'co', 'cr', 'cs', 'cu', 'cv', 'cx', 'cy', 'cz', 'de', 'dj', 'dk', 'dm', + 'do', 'dz', 'ec', 'ee', 'eg', 'eh', 'england', 'er', 'es', 'et', + 'europeanunion', 'fam', 'fi', 'fj', 'fk', 'fm', 'fo', 'fr', 'ga', + 'gb', 'gd', 'ge', 'gf', 'gh', 'gi', 'gl', 'gm', 'gn', 'gp', 'gq', 'gr', + 'gs', 'gt', 'gu', 'gw', 'gy', 'hk', 'hm', 'hn', 'hr', 'ht', 'hu', 'id', + 'ie', 'il', 'in', 'io', 'iq', 'ir', 'is', 'it', 'jm', 'jo', 'jp', 'ke', + 'kg', 'kh', 'ki', 'km', 'kn', 'kp', 'kr', 'kw', 'ky', 'kz', 'la', 'lb', + 'lc', 'li', 'lk', 'lr', 'ls', 'lt', 'lu', 'lv', 'ly', 'ma', 'mc', 'md', + 'me', 'mg', 'mh', 'mk', 'ml', 'mm', 'mn', 'mo', 'mp', 'mq', 'mr', 'ms', + 'mt', 'mu', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nc', 'ne', 'nf', 'ng', + 'ni', 'nl', 'no', 'np', 'nr', 'nu', 'nz', 'om', 'pa', 'pe', 'pf', 'pg', + ); + foreach ($languageKeys as $languageKey) { + $TCA['sys_language']['columns']['flag']['config']['items'][] = array($languageKey, $languageKey, ''); + } + unset($languageKeys, $languageKey); + // Manual setting up of alternative icons. This is mainly for module icons which has a special prefix: $TBE_STYLES['skinImg'] = array_merge($presetSkinImgs, array ( 'gfx/ol/blank.gif' => array('clear.gif','width="18" height="16"'), Index: typo3/sysext/install/mod/class.tx_install.php =================================================================== --- typo3/sysext/install/mod/class.tx_install.php (Revision 9358) +++ typo3/sysext/install/mod/class.tx_install.php (Arbeitskopie) @@ -156,6 +156,7 @@ require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_t3skin.php'); require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_compressionlevel.php'); require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_migrateworkspaces.php'); +require_once(t3lib_extMgm::extPath('install') . 'updates/class.tx_coreupdates_flagsfromsprite.php'); /** * Install Tool module Index: typo3/sysext/install/updates/class.tx_coreupdates_flagsfromsprite.php =================================================================== --- typo3/sysext/install/updates/class.tx_coreupdates_flagsfromsprite.php (Revision 0) +++ typo3/sysext/install/updates/class.tx_coreupdates_flagsfromsprite.php (Revision 0) @@ -0,0 +1,81 @@ + +* All rights reserved +* +* This script is part of the TYPO3 project. The TYPO3 project is +* free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* A copy is found in the textfile GPL.txt and important notices to the license +* from the author is found in LICENSE.txt distributed with these scripts. +* +* +* This script is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + +/** + * Contains the update class for transitioning from ".gif" flags to sprites + * + * @author Ernesto Baschny + * @version $Id$ + */ +class tx_coreupdates_flagsfromsprite { + public $versionNumber; // version number coming from t3lib_div::int_from_ver() + + /** + * Checks if an update is needed + * + * @param string &$description: The description for the update + * @return boolean whether an update is needed (true) or not (false) + */ + public function checkForUpdate(&$description) { + $result = FALSE; + $description = 'Removes the ".gif" suffix from entries in sys_language, because flags now come from a sprite provided by t3skin and not individual .gif files.'; + + if ($this->versionNumber >= 4005000) { + $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'sys_language', 'flag LIKE \'%.gif\'', '', '', '1'); + if($GLOBALS['TYPO3_DB']->sql_num_rows($res)) { + $result = TRUE; + } + $GLOBALS['TYPO3_DB']->sql_free_result($res); + } + return $result; + } + + + /** + * Performs the database update. Changes the flags from ".gif" to flag without suffix + * + * @param array &$dbQueries: queries done in this update + * @param mixed &$customMessages: custom messages + * @return boolean whether it worked (true) or not (false) + */ + public function performUpdate(&$dbQueries, &$customMessages) { + $result = FALSE; + if ($this->versionNumber >= 4005000) { + $sql = 'UPDATE sys_language SET flag=REPLACE(flag, \'.gif\', \'\') WHERE flag LIKE \'%.gif\''; + $res = $GLOBALS['TYPO3_DB']->sql_query($sql); + $dbQueries[] = $sql; + + if ($GLOBALS['TYPO3_DB']->sql_error()) { + $customMessages = 'SQL-ERROR: ' . htmlspecialchars($GLOBALS['TYPO3_DB']->sql_error()); + } else { + $result = TRUE; + } + } + return $result; + } +} +?> \ No newline at end of file Index: typo3/sysext/install/ext_localconf.php =================================================================== --- typo3/sysext/install/ext_localconf.php (Revision 9358) +++ typo3/sysext/install/ext_localconf.php (Arbeitskopie) @@ -42,4 +42,7 @@ // Version 4.5: migrate workspaces to use custom stages and install the required extensions $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['migrateWorkspaces'] = 'tx_coreupdates_migrateworkspaces'; + // Version 4.5: Removes the ".gif" suffix from entries in sys_language +$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['flagsFromSprites'] = 'tx_coreupdates_flagsfromsprite'; + ?> \ No newline at end of file