* fix bug 7930: return the resulting selected array in the methods buildStaticInfoSel...
[TYPO3CMS/Extensions/static_info_tables.git] / ext_localconf.php
index c86282d..09d35ec 100644 (file)
@@ -1,9 +1,36 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['charset'] = 'utf-8';
 
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['tables'] = array(
+if (!defined ('STATIC_INFO_TABLES_EXTkey')) {
+       define('STATIC_INFO_TABLES_EXTkey',$_EXTKEY);
+}
+
+if (!defined ('PATH_BE_staticinfotables')) {
+       define('PATH_BE_staticinfotables', t3lib_extMgm::extPath(STATIC_INFO_TABLES_EXTkey));
+}
+
+if (!defined ('PATH_BE_staticinfotables_rel')) {
+       define('PATH_BE_staticinfotables_rel', t3lib_extMgm::extRelPath(STATIC_INFO_TABLES_EXTkey));
+}
+
+if (!defined ('DIV_EXTkey')) {
+       define('DIV_EXTkey','div');
+}
+
+if (t3lib_extMgm::isLoaded(DIV_EXTkey)) {
+       if (!defined ('PATH_BE_div')) {
+               define('PATH_BE_div', t3lib_extMgm::extPath(DIV_EXTkey));
+       }
+}
+
+$_EXTCONF = unserialize($_EXTCONF);    // unserializing the configuration so we can use it here:
+
+if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['charset']))      {
+       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['charset'] = $_EXTCONF['charset'] ? $_EXTCONF['charset'] : 'utf-8';
+}
+
+$labelTable = array(
        'static_territories' => array(
                'label_fields' => array(        // possible label fields for different languages. Default as last.
                        'tr_name_##', 'tr_name_en',
@@ -44,16 +71,24 @@ $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['tables'] = array(
                        'cu_iso_##',
                ),
        ),
-       'static_taxes' => array(
+       'static_markets' => array(
                'label_fields' => array(
-                       'tx_name_##', 'tx_name_en',
+                       'institution_description',
                ),
                'isocode_field' => array(
-                       'tx_code', 'tx_country_iso_##', 'tx_zn_code',
+                       'institution_description',
                ),
        ),
 );
 
-require_once(t3lib_extMgm::extPath($_EXTKEY).'class.tx_staticinfotables_div.php');
+
+if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables']))       {
+
+       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables'] = array_merge ($labelTable, $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables']);
+} else {
+       $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables'] = $labelTable;
+}
+
+require_once(t3lib_extMgm::extPath(STATIC_INFO_TABLES_EXTkey).'class.tx_staticinfotables_div.php');
 
 ?>
\ No newline at end of file