Apply TCA userFuncs to Static Info Tables Manager tables
[TYPO3CMS/Extensions/static_info_tables.git] / class.tx_staticinfotables_div.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2004-2010 René Fritz (r.fritz@colorcube.de)
6 * All rights reserved
7 *
8 * This script is part of the Typo3 project. The Typo3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24 /**
25 * Misc functions to access the static info tables
26 *
27 * $Id$
28 *
29 * @author René Fritz <r.fritz@colorcube.de>
30 * @package TYPO3
31 */
32 /**
33 * [CLASS/FUNCTION INDEX of SCRIPT]
34 *
35 *
36 *
37 * 57: class tx_staticinfotables_div
38 * 69: function getTCAlabelField ($table, $loadTCA=TRUE, $lang='', $local=FALSE)
39 * 119: function isoCodeType ($isoCode)
40 * 143: function getIsoCodeField ($table, $isoCode, $bLoadTCA=TRUE, $index=0)
41 * 169: function getTCAsortField ($table, $loadTCA=TRUE)
42 * 181: function getCurrentLanguage ()
43 * 215: function getCurrentSystemLanguage ($where='')
44 * 249: function getCollateLocale ()
45 * 282: function getTitleFromIsoCode ($table, $isoCode, $lang='', $local=FALSE)
46 * 341: function replaceMarkersInSQL ($sql, $table, $row)
47 * 383: function selectItemsTCA ($params)
48 * 480: function updateHotlist ($table, $indexValue, $indexField='', $app='')
49 * 542: function &fetchCountries ($country, $iso2='', $iso3='', $isonr='')
50 * 587: function quoteJSvalue ($value, $inScriptTags=FALSE)
51 * 609: function loadTcaAdditions ($ext_keys)
52 *
53 * TOTAL FUNCTIONS: 14
54 * (This index is automatically created/updated by the extension "extdeveval")
55 *
56 */
57 class tx_staticinfotables_div {
58
59 private static $cache = array();
60
61 /**
62 * Returns a label field for the current language
63 *
64 * @param string table name
65 * @param boolean If set (default) the TCA definition of the table should be loaded with t3lib_div::loadTCA(). It will be needed to set it to false if you call this function from inside of tca.php
66 * @param string language to be used
67 * @param boolean If set, we are looking for the "local" title field
68 * @return string field name
69 */
70 function getTCAlabelField ($table, $loadTCA=TRUE, $lang='', $local=FALSE) {
71 global $TCA, $LANG, $TSFE;
72
73 if (is_object($LANG)) {
74 $csConvObj = $LANG->csConvObj;
75 } elseif (is_object($TSFE)) {
76 $csConvObj = $TSFE->csConvObj;
77 }
78
79 if (!is_object($csConvObj)) {
80 include_once(PATH_t3lib.'class.t3lib_cs.php');
81 // The object may not exist yet, so we need to create it now.
82 $csConvObj = &t3lib_div::makeInstance('t3lib_cs');
83 }
84
85 $labelFields = array();
86 if($table && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables'][$table]['label_fields'])) {
87 if ($loadTCA) {
88 t3lib_div::loadTCA($table);
89
90 // get all extending TCAs
91 if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['extendingTCA'])) {
92 tx_staticinfotables_div::loadTcaAdditions($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['extendingTCA']);
93 }
94 }
95
96 $lang = $lang ? $lang : tx_staticinfotables_div::getCurrentLanguage();
97 $lang = isset($csConvObj->isoArray[$lang]) ? $csConvObj->isoArray[$lang] : $lang;
98
99 foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables'][$table]['label_fields'] as $field) {
100 if ($local) {
101 $labelField = str_replace ('##', 'local', $field);
102 } else {
103 $labelField = str_replace ('##', $csConvObj->conv_case('utf-8',$lang,'toLower'), $field);
104 }
105 if (is_array($TCA[$table]['columns'][$labelField])) {
106 $labelFields[] = $labelField;
107 }
108 }
109 }
110 return $labelFields;
111 }
112
113
114 /**
115 * Returns the type of an iso code: nr, 2, 3
116 *
117 * @param string iso code
118 * @return string iso code type
119 */
120 function isoCodeType ($isoCode) {
121 $type = '';
122 // t3lib_utility_Math was introduced in TYPO3 4.6
123 $isoCodeAsInteger = class_exists('t3lib_utility_Math')
124 ? t3lib_utility_Math::canBeInterpretedAsInteger($isoCode)
125 : t3lib_div::testInt($isoCode);
126 if ($isoCodeAsInteger) {
127 $type = 'nr';
128 } elseif (strlen($isoCode) == 2) {
129 $type = '2';
130 } elseif (strlen($isoCode) == 3) {
131 $type = '3';
132 }
133 return $type;
134 }
135
136
137 /**
138 * Returns a iso code field for the passed table and iso code
139 *
140 * $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables']
141 *
142 * @param string table name
143 * @param string iso code
144 * @param boolean If set (default) the TCA definition of the table should be loaded with t3lib_div::loadTCA(). It will be needed to set it to FALSE if you call this function from inside of tca.php
145 * @param integer index in the table's isocode_field array in the global variable
146 * @return string field name
147 */
148 function getIsoCodeField ($table, $isoCode, $bLoadTCA=TRUE, $index=0) {
149 global $TCA;
150 $rc = FALSE;
151
152 if ($isoCode && $table && (($isoCodeField = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables'][$table]['isocode_field'][$index]) != '')) {
153 if ($bLoadTCA) {
154 t3lib_div::loadTCA($table);
155 }
156 $type = tx_staticinfotables_div::isoCodeType($isoCode);
157 $isoCodeField = str_replace ('##', $type, $isoCodeField);
158
159 if (is_array($TCA[$table]['columns'][$isoCodeField])) {
160 $rc = $isoCodeField;
161 }
162 }
163 return $rc;
164 }
165
166
167 /**
168 * Returns a sort field for the current language
169 *
170 * @param string table name
171 * @param boolean If set (default) the TCA definition of the table should be loaded
172 * @return string field name
173 */
174 function getTCAsortField ($table, $loadTCA=TRUE) {
175 $labelFields = tx_staticinfotables_div::getTCAlabelField($table, $loadTCA);
176
177 return $labelFields[0];
178 }
179
180
181 /**
182 * Returns the current language as iso-2-alpha code
183 *
184 * @return string 'DE', 'EN', 'DK', ...
185 */
186 function getCurrentLanguage () {
187
188 if (is_object($GLOBALS['TSFE'])) {
189 $langCodeT3 = $GLOBALS['TSFE']->lang;
190 $csConvObj = $GLOBALS['TSFE']->csConvObj;
191 } elseif (is_object($GLOBALS['LANG'])) {
192 $langCodeT3 = $GLOBALS['LANG']->lang;
193 $csConvObj = $GLOBALS['LANG']->csConvObj;
194 } else {
195 return 'EN';
196 }
197 if ($langCodeT3 === 'default') {
198 return 'EN';
199 }
200 // Return cached value if any
201 if (isset(self::$cache['getCurrentLanguage'][$langCodeT3])) {
202 return self::$cache['getCurrentLanguage'][$langCodeT3];
203 }
204
205 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
206 'lg_iso_2,lg_country_iso_2',
207 'static_languages',
208 'lg_typo3=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($langCodeT3, 'static_languages')
209 );
210 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
211 $lang = $row['lg_iso_2'] . ($row['lg_country_iso_2'] ? '_' . $row['lg_country_iso_2'] : '');
212 }
213 $GLOBALS['TYPO3_DB']->sql_free_result($res);
214
215 $lang = $lang ? $lang : $csConvObj->conv_case('utf-8', $langCodeT3, 'toUpper');
216
217 // Initialize cache array
218 if (!is_array(self::$cache['getCurrentLanguage'])) {
219 self::$cache['getCurrentLanguage'] = array();
220 }
221 // Cache retrieved value
222 self::$cache['getCurrentLanguage'][$langCodeT3] = $lang;
223
224 return $lang;
225 }
226
227
228 /**
229 * Returns the row of the current system language
230 *
231 * @param [type] $where: ...
232 * @return array row in the sys_language table
233 */
234 function getCurrentSystemLanguage ($where='') {
235 global $LANG, $TSFE, $TYPO3_DB;
236
237 $rc = array();
238
239 if (is_object($LANG)) {
240 $langCodeT3 = $LANG->lang;
241 } elseif (is_object($TSFE)) {
242 $langCodeT3 = $TSFE->lang;
243 } else {
244 return $rc;
245 }
246
247 $res = $TYPO3_DB->exec_SELECTquery(
248 'sys_language.uid',
249 'sys_language LEFT JOIN static_languages ON sys_language.static_lang_isocode=static_languages.uid',
250 'static_languages.lg_typo3='.$TYPO3_DB->fullQuoteStr($langCodeT3,'static_languages').
251 $where
252 );
253 while($row = $TYPO3_DB->sql_fetch_assoc($res)) {
254 $rc[$row['uid']] = $row;
255 }
256
257 $TYPO3_DB->sql_free_result($res);
258 return $rc;
259 }
260
261
262 /*
263 *
264 * Returns the locale to used when sorting labels
265 *
266 * @return string locale
267 */
268 function getCollateLocale () {
269 global $LANG, $TSFE, $TYPO3_DB;
270
271 if (is_object($LANG)) {
272 $langCodeT3 = $LANG->lang;
273 } elseif (is_object($TSFE)) {
274 $langCodeT3 = $TSFE->lang;
275 } else {
276 return 'C';
277 }
278
279 $res = $TYPO3_DB->exec_SELECTquery(
280 'lg_collate_locale',
281 'static_languages',
282 'lg_typo3='.$TYPO3_DB->fullQuoteStr($langCodeT3,'static_languages')
283 );
284 while ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
285 $locale = $row['lg_collate_locale'];
286 }
287 $TYPO3_DB->sql_free_result($res);
288 return $locale ? $locale : 'C';
289 }
290
291
292 /**
293 * Fetches short title from an iso code
294 *
295 * @param string table name
296 * @param string iso code
297 * @param string language code - if not set current default language is used
298 * @param boolean local name only - if set local title is returned
299 * @return string short title
300 */
301 function getTitleFromIsoCode ($table, $isoCode, $lang='', $local=FALSE) {
302 global $TSFE, $TYPO3_DB;
303
304 $title = '';
305 $titleFields = tx_staticinfotables_div::getTCAlabelField($table, TRUE, $lang, $local);
306 if (count ($titleFields)) {
307 $prefixedTitleFields = array();
308 foreach ($titleFields as $titleField) {
309 $prefixedTitleFields[] = $table.'.'.$titleField;
310 }
311 $fields = implode(',', $prefixedTitleFields);
312 $whereClause = '1=1';
313 if (!is_array($isoCode)) {
314 $isoCode = array($isoCode);
315 }
316 $index = 0;
317 foreach ($isoCode as $index => $code) {
318 if ($code != '') {
319 $tmpField = tx_staticinfotables_div::getIsoCodeField($table, $code, TRUE, $index);
320 $tmpValue = $TYPO3_DB->fullQuoteStr($code,$table);
321 if ($tmpField && $tmpValue) {
322 $whereClause .= ' AND ' . $table . '.' . $tmpField . ' = ' . $tmpValue;
323 }
324 }
325 }
326 if (is_object($TSFE)) {
327 $enableFields = $TSFE->sys_page->enableFields($table);
328 } else {
329 $enableFields = t3lib_BEfunc::deleteClause($table);
330 }
331
332 $res = $TYPO3_DB->exec_SELECTquery(
333 $fields,
334 $table,
335 $whereClause.$enableFields
336 );
337 if ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
338 foreach ($titleFields as $titleField) {
339 if ($row[$titleField]) {
340 $title = $row[$titleField];
341 break;
342 }
343 }
344 }
345 $TYPO3_DB->sql_free_result($res);
346 }
347
348 return $title;
349 }
350
351
352 /**
353 * Replaces any dynamic markers in a SQL statement.
354 *
355 * @param string The SQL statement with dynamic markers.
356 * @param string Name of the table.
357 * @param array row from table.
358 * @return string SQL query with dynamic markers subsituted.
359 */
360 function replaceMarkersInSQL ($sql, $table, $row) {
361
362 $TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig($table, $row);
363
364 /* Replace references to specific fields with value of that field */
365 if (strstr($sql,'###REC_FIELD_')) {
366 $sql_parts = explode('###REC_FIELD_',$sql);
367 while(list($kk,$vv)=each($sql_parts)) {
368 if ($kk) {
369 $sql_subpart = explode('###',$vv,2);
370 $sql_parts[$kk]=$TSconfig['_THIS_ROW'][$sql_subpart[0]].$sql_subpart[1];
371 }
372 }
373 $sql = implode('',$sql_parts);
374 }
375
376 /* Replace markers with TSConfig values */
377 $sql = str_replace('###THIS_UID###',intval($TSconfig['_THIS_UID']),$sql);
378 $sql = str_replace('###THIS_CID###',intval($TSconfig['_THIS_CID']),$sql);
379 $sql = str_replace('###SITEROOT###',intval($TSconfig['_SITEROOT']),$sql);
380 $sql = str_replace('###PAGE_TSCONFIG_ID###',intval($TSconfig[$field]['PAGE_TSCONFIG_ID']),$sql);
381 $sql = str_replace('###PAGE_TSCONFIG_IDLIST###',$GLOBALS['TYPO3_DB']->cleanIntList($TSconfig[$field]['PAGE_TSCONFIG_IDLIST']),$sql);
382 $sql = str_replace('###PAGE_TSCONFIG_STR###',$GLOBALS['TYPO3_DB']->quoteStr($TSconfig[$field]['PAGE_TSCONFIG_STR'], $table),$sql);
383
384 return $sql;
385 }
386
387
388 /**
389 * Function to use in own TCA definitions
390 * Adds additional select items
391 *
392 * items reference to the array of items (label,value,icon)
393 * config The config array for the field.
394 * TSconfig The "itemsProcFunc." from fieldTSconfig of the field.
395 * table Table name
396 * row Record row
397 * field Field name
398 *
399 * @param array itemsProcFunc data array:
400 * @return void The $items array may have been modified
401 */
402 function selectItemsTCA ($params) {
403 global $TCA;
404
405 $where = '';
406 $config = &$params['config'];
407 $table = $config['itemsProcFunc_config']['table'];
408 $tcaWhere = $config['itemsProcFunc_config']['where'];
409 if ($tcaWhere) {
410 $where = tx_staticinfotables_div::replaceMarkersInSQL($tcaWhere, $params['table'], $params['row']);
411 }
412
413 if ($table) {
414 $indexField = $config['itemsProcFunc_config']['indexField'];
415 $indexField = $indexField ? $indexField : 'uid';
416
417 $lang = strtolower(tx_staticinfotables_div::getCurrentLanguage());
418 $titleFields = tx_staticinfotables_div::getTCAlabelField($table, TRUE, $lang);
419 $prefixedTitleFields = array();
420 foreach ($titleFields as $titleField) {
421 $prefixedTitleFields[] = $table.'.'.$titleField;
422 }
423 $fields = $table.'.'.$indexField.','.implode(',', $prefixedTitleFields);
424
425 if ($config['itemsProcFunc_config']['prependHotlist']) {
426
427 $limit = $config['itemsProcFunc_config']['hotlistLimit'];
428 $limit = $limit ? $limit : '8';
429 $app = $config['itemsProcFunc_config']['hotlistApp'];
430 $app = $app ? $app : TYPO3_MODE;
431
432 $res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
433 $fields,
434 $table,
435 'tx_staticinfotables_hotlist',
436 '', // $foreign_table
437 'AND tx_staticinfotables_hotlist.tablenames='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'tx_staticinfotables_hotlist').' AND tx_staticinfotables_hotlist.application='.$GLOBALS['TYPO3_DB']->fullQuoteStr($app,'tx_staticinfotables_hotlist'),
438 '',
439 'tx_staticinfotables_hotlist.sorting DESC', // $orderBy
440 $limit
441 );
442
443 $cnt = 0;
444 $rows = array();
445 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
446
447 foreach ($titleFields as $titleField) {
448 if ($row[$titleField]) {
449 $rows[$row[$indexField]] = $row[$titleField];
450 break;
451 }
452 }
453 $cnt++;
454 }
455 $GLOBALS['TYPO3_DB']->sql_free_result($res);
456
457 if (!isset($config['itemsProcFunc_config']['hotlistSort']) || $config['itemsProcFunc_config']['hotlistSort']) {
458 asort ($rows);
459 }
460
461 foreach ($rows as $index => $title) {
462 $params['items'][] = array($title, $index, '');
463 $cnt++;
464 }
465 if($cnt && !$config['itemsProcFunc_config']['hotlistOnly']) {
466 $params['items'][] = array('--------------', '', '');
467 }
468 }
469
470 // Set ORDER BY:
471 $orderBy = $titleFields[0];
472
473 if(!$config['itemsProcFunc_config']['hotlistOnly']) {
474 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $table, '1=1'.$where.t3lib_BEfunc::deleteClause($table), '', $orderBy);
475 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
476 foreach ($titleFields as $titleField) {
477 if ($row[$titleField]) {
478 $params['items'][] = array($row[$titleField], $row[$indexField], '');
479 break;
480 }
481 }
482 }
483 $GLOBALS['TYPO3_DB']->sql_free_result($res);
484 }
485 }
486 }
487
488
489 /**
490 * Updates the hotlist table.
491 * This means that a hotlist entry will be created or the counter of an existing entry will be increased
492 *
493 * @param string table name: static_countries, ...
494 * @param string value of the following index field
495 * @param string the field which holds the value and is an index field: uid (default) or one of the iso code fields which are also unique
496 * @param string This indicates a counter group. Default is TYPO3_MOD (BE or FE). If you want a unique hotlist for your application you can provide here a name (e.g. extension key)
497 * @return void
498 */
499 function updateHotlist ($table, $indexValue, $indexField='', $app='') {
500
501 if ($table && $indexValue) {
502 $indexField = $indexField ? $indexField : 'uid';
503 $app = $app ? $app : TYPO3_MODE;
504
505 if ($indexField=='uid') {
506 $uid = $indexValue;
507
508 } else {
509 // fetch original record
510 $fields = array();
511 $fields[$indexField] = $indexField;
512 $fields['uid'] = 'uid';
513
514 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(implode(',',$fields), $table, $indexField.'='.$GLOBALS['TYPO3_DB']->fullQuoteStr($indexValue,$table).t3lib_BEfunc::deleteClause($table));
515 if ($res !== FALSE) {
516 if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
517 $uid = $row['uid'];
518 }
519 $GLOBALS['TYPO3_DB']->sql_free_result($res);
520 }
521 }
522
523 if ($uid) {
524 // update record from hotlist table
525 $newRow = array('sorting' => 'sorting+1');
526 // the dumb update function does not allow to use sorting+1 - that's why this trick is necessary
527
528 $GLOBALS['TYPO3_DB']->sql_query(str_replace('"sorting+1"', 'sorting+1', $GLOBALS['TYPO3_DB']->UPDATEquery(
529 'tx_staticinfotables_hotlist',
530 'uid_local='.$uid.
531 ' AND application='.$GLOBALS['TYPO3_DB']->fullQuoteStr($app,'tx_staticinfotables_hotlist').
532 ' AND tablenames='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'tx_staticinfotables_hotlist').
533 t3lib_BEfunc::deleteClause('tx_staticinfotables_hotlist'),
534 $newRow)));
535
536 if (!$GLOBALS['TYPO3_DB']->sql_affected_rows()) {
537 // insert new hotlist entry
538 $row = array(
539 'uid_local' => $uid,
540 'tablenames' => $table,
541 'application' => $app,
542 'sorting' => 1,
543 );
544 $res = $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_staticinfotables_hotlist', $row);
545 }
546 }
547 }
548 }
549
550
551 /**
552 * Get a list of countries by specific parameters or parts of names of countries
553 * in different languages. Parameters might be left empty.
554 *
555 * @param string a name of the country or a part of it in any language
556 * @param string ISO alpha-2 code of the country
557 * @param string ISO alpha-3 code of the country
558 * @param array Database row.
559 * @return array Array of rows of country records
560 */
561 function &fetchCountries ($country, $iso2='', $iso3='', $isonr='') {
562 global $TYPO3_DB;
563
564 $rcArray = array();
565 $where = '';
566
567 $table = 'static_countries';
568 if ($country != '') {
569 $value = $TYPO3_DB->fullQuoteStr(trim('%'.$country.'%'),$table);
570 $where = 'cn_official_name_local LIKE '.$value.' OR cn_official_name_en LIKE '.$value.' OR cn_short_local LIKE '.$value;
571 }
572
573 if ($isonr != '') {
574 $where = 'cn_iso_nr='.$TYPO3_DB->fullQuoteStr(trim($isonr),$table);
575 }
576
577 if ($iso2 != '') {
578 $where = 'cn_iso_2='.$TYPO3_DB->fullQuoteStr(trim($iso2),$table);
579 }
580
581 if ($iso3 !='') {
582 $where = 'cn_iso_3='.$TYPO3_DB->fullQuoteStr(trim($iso3),$table);
583 }
584
585 if ($where != '') {
586 $res = $TYPO3_DB->exec_SELECTquery('*', $table, $where);
587
588 if ($res) {
589 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
590 $rcArray[] = $row;
591 }
592 }
593 $GLOBALS['TYPO3_DB']->sql_free_result($res);
594 }
595 return $rcArray;
596 }
597
598
599 /**
600 * Quotes a string for usage as JS parameter. Depends wheter the value is used in script tags (it must not get `htmlspecialchar'ed in this case because this is done in this function)
601 *
602 * @param string The string to encode.
603 * @param boolean If the values are used inside of <script> tags.
604 * @return string The encoded value already quoted
605 */
606 function quoteJSvalue ($value, $inScriptTags=FALSE) {
607 $value = addcslashes($value, '"'.chr(10).chr(13));
608 if (!$inScriptTags) {
609 $value = htmlspecialchars($value, ENT_COMPAT, $GLOBALS['TSFE']->renderCharset);
610 }
611 return '"'.$value.'"';
612 }
613
614
615 /**
616 * loadTcaAdditions($ext_keys)
617 *
618 * It has been copied here in order not to depend on the div extension only for this function.
619 *
620 * @param array extension keys which have TCA additions to load
621 * @return void
622 * @see div extension
623 */
624 function loadTcaAdditions ($ext_keys){
625 global $_EXTKEY, $TCA;
626
627 //Merge all ext_keys
628 if (is_array($ext_keys)) {
629 foreach ($ext_keys as $_EXTKEY) {
630 if (t3lib_extMgm::isLoaded($_EXTKEY)) {
631 //Include the ext_table
632 include(t3lib_extMgm::extPath($_EXTKEY).'ext_tables.php');
633 }
634 }
635 }
636 }
637 }
638
639
640 if (defined('TYPO3_MODE') && $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/static_info_tables/class.tx_staticinfotables_div.php']) {
641 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/static_info_tables/class.tx_staticinfotables_div.php']);
642 }
643 ?>