.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ======================= EXT: Static Info Tables ======================= :Author: Stanislas Rolland :Created: 2013-05-21T14:33:25.650000000 :Changed by: Stanislas Rolland :Changed: 2018-10-14T15:01:41.680000000 :Email: typo3(arobas)sjbr.ca :Info 2: Stanislas Rolland :Info 3: :Info 4: EXT: Static Info Tables .. _generated: ((generated)) ============= .. _Table-of-Contents: Table of Contents ----------------- **Copyright 2** **Credits 2** **Introduction 3** **What does it do? 3** **Requirements 3** **Support 3** **Static Tables 4** **General rules 4** Read only 4 UTF-8 encoding 4 Non-removal of deleted entries 4 Localization by language pack 4 **Standards 4** **Tables structure 4** Territory (static\_territories) 4 Country (static\_countries) 4 Country Zone (static\_country\_zones) 5 Currency (static\_currencies) 5 Language (static\_languages) 5 **Tables extension by language pack 6** **Extbase domain model 7** **Objects, properties and methods 7** Territory 7 Country 7 CountryZone 7 Currency 8 Language 8 **Domain model extension by language pack 8** Additional properties 8 Localization property nameLocalized 9 **Repositories and methods 9** Abstract repository 9 Territory 9 Country 9 CountryZone 9 Currency 10 Language 10 **Using the model 10** Adding a country select field to a form 10 Using the select View Helper 10 Further examples 11 **Configuration of backend forms 12** **Localization of entity selector 12** **Alternate value fields for entity selector 12** **Localization of suggest wizard 12** **Pre-Extbase API 14** **API class 14** Class initialization 14 Getting a localized name 14 Creating a localized drop-down selector 14 Formating an amount 14 Loading an alternate currency 14 Formating an address 15 Getting country info 15 **Creating/updating a language pack 16** **Creating a new language pack 16** **Updating an existing language pack 16** **Installation 17** **Installing the extension 17** **Upgrading to version 6.0+ from older versions 17** **Configuration 18** **Extension configuration 18** **TypoScript reference 18** **Address formats 18** **Change Log 20** .. _Copyright: Copyright ========= Extension Key: **static\_info\_tables** Copyright 2002-2018 Stanislas Rolland, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from **`www.typo3.org `_** .. _Credits: Credits ------- Thanks to René Fritz, Eckhard Zemp, David Brühlmeier, Franz Holzinger, Martin Kutschker and Carsten Biebricher for their contributions. .. _Introduction: Introduction ============ .. _What-does-it-do: What does it do? ---------------- Static Info Tables is a collection of database tables which provides data on: - territories, - countries, - country zones (states, provinces, local government areas), - languages, - and currencies. These tables are static. They should be used as reference only. The records can be found in the TYPO3 backend in the root level of the page tree. The extension provides - the tables definition and non-localized contents; - an extensible Extbase domain model and generic repository access methods; - an API for traditional pre-Extbase plugins and modules; - an Extbase backend module for creating language packs: extensions which provide localization of the tables contents. .. _Requirements: Requirements ------------ Version 6.6.0 requires TYPO3 8 LTS. Version 6.4.0 requires TYPO3 7 LTS. Version 6.0 requires TYPO3 6.0.6 and PHP 5.3.7. Version 2.3.2 is the last version that will work with TYPO3 4.3-4.7 and PHP 5.2. .. _Support: Support ------- Please report issues on TYPO3 Forge: `http://forge.typo3.org/projects/show/extension-static\_info\_tables `_ .. _Static-Tables: Static Tables ============= .. _General-rules: General rules ------------- .. _Read-only: Read only ^^^^^^^^^ The tables are static, i.e. they are not intended to be updated on a site using the extension. Therefore, the tables are normally configured as read-only. .. _UTF-8-encoding: UTF-8 encoding ^^^^^^^^^^^^^^ The tables are encoded with UTF-8. .. _Non-removal-of-deleted-entries: Non-removal of deleted entries ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ In order to ensure that the value of the uid field of an entry is never changed and that relationships established between tables on the basis of the uid fields, entries marked as deleted should never be removed from the tables. .. _Localization-by-language-pack: Localization by language pack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The tables provided by this extension do not include labels in any language other than English, except for some labels in the local language of the entity. Labels in other languages are provided by extra extensions, called language packs, that extend the basic strutures provided by this extension. .. _Standards: Standards --------- Standards relevant to the Static Info Tables are: - for territories or macro-geographical regions: UN geoscheme ( `http://unstats.un.org/unsd/methods/m49/m49regin.htm `_ ); - for country codes: ISO 3166-1 (see `http://www.iso.org/iso/country\_codes `_ ); - for country subdivisions: ISO 3166-2; - for currencies: ISO 4217; - for languages: ISO 639-1 and RFC 4646 (see `http://www.faqs.org/rfcs/rfc4646.html `_ ); - for postal address formats: UPU S42-1 (see `http://www.upu.int/en/activities/addressing/postal-addressing- systems-in-member-countries.html `_ ). A major source of reference data is provided by the Locale Data Repository (CLDR) Project `http://www.unicode.org/cldr/ `_ . .. _Tables-structure: Tables structure ---------------- .. _Territory-static-territories: Territory (static\_territories) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This table provide data about territories or macro-geographical regions as defined by the UN geoscheme ( `http://unstats.un.org/unsd/methods/m49/m49regin.htm `_ ). The data is hierarchical organized which means the fields tr\_parent\_iso\_nrand tr\_parent\_territory\_uid refer to the parent territory containing the territory defined by the current entry. A country has a reference to the territory in which the country is contained. :: CREATE TABLE static_territories ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', tr_iso_nr int(11) unsigned NOT NULL default '0', tr_parent_territory_uid int(11) NOT NULL default '0', tr_parent_iso_nr int(11) unsigned NOT NULL default '0', tr_name_en varchar(50) NOT NULL default '', PRIMARY KEY (uid) ); .. _Country-static-countries: Country (static\_countries) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ This table provides data about countries based on ISO 3166-1 (see http://www.iso.org/iso/country\_codes); :: CREATE TABLE static_countries ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', cn_iso_2 char(2) NOT NULL default '', cn_iso_3 char(3) NOT NULL default '', cn_iso_nr int(11) unsigned NOT NULL default '0', cn_parent_territory_uid int(11) NOT NULL default '0', cn_parent_tr_iso_nr int(11) unsigned NOT NULL default '0', cn_official_name_local varchar(128) NOT NULL default '', cn_official_name_en varchar(128) NOT NULL default '', cn_capital varchar(45) NOT NULL default '', cn_tldomain char(2) NOT NULL default '', cn_currency_uid int(11) NOT NULL default '0', cn_currency_iso_3 char(3) NOT NULL default '', cn_currency_iso_nr int(10) unsigned NOT NULL default '0', cn_phone int(10) unsigned NOT NULL default '0', cn_eu_member tinyint(3) unsigned NOT NULL default '0', cn_uno_member tinyint(3) unsigned NOT NULL default '0', cn_address_format tinyint(3) unsigned NOT NULL default '0', cn_zone_flag tinyint(4) NOT NULL default '0', cn_short_local varchar(70) NOT NULL default '', cn_short_en varchar(50) NOT NULL default '', cn_country_zones int(11) NOT NULL default '0', PRIMARY KEY (uid) ); Local names (cn\_official\_name\_local and cn\_short\_local) are in the official languages of the countries. Appropriate Unicode fonts are required to display all entries on a client computer. Address formats are described in the section Address Formats of the configuration section. .. _Country-Zone-static-country-zones: Country Zone (static\_country\_zones) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This table provides data about country subdivisions, provinces, departments or states based on ISO 3166-2. :: CREATE TABLE static_country_zones ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', zn_country_iso_2 char(2) NOT NULL default '', zn_country_iso_3 char(3) NOT NULL default '', zn_country_iso_nr int(11) unsigned NOT NULL default '0', zn_code varchar(45) NOT NULL default '', zn_name_local varchar(128) NOT NULL default '', zn_name_en varchar(50) NOT NULL default '', zn_country_uid int(11) NOT NULL default '0', zn_country_table tinytext, PRIMARY KEY (uid) ); .. _Currency-static-currencies: Currency (static\_currencies) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This table provides data about currencies based on standard ISO 4217. :: CREATE TABLE static_currencies ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', cu_iso_3 char(3) NOT NULL default '', cu_iso_nr int(11) unsigned NOT NULL default '0', cu_name_en varchar(50) NOT NULL default '', cu_symbol_left varchar(12) NOT NULL default '', cu_symbol_right varchar(12) NOT NULL default '', cu_thousands_point char(1) NOT NULL default '', cu_decimal_point char(1) NOT NULL default '', cu_decimal_digits tinyint(3) unsigned NOT NULL default '0', cu_sub_name_en varchar(20) NOT NULL default '', cu_sub_divisor int(11) NOT NULL default '1', cu_sub_symbol_left varchar(12) NOT NULL default '', cu_sub_symbol_right varchar(12) NOT NULL default '', PRIMARY KEY (uid), KEY parent (pid) ); .. _Language-static-languages: Language (static\_languages) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This table provides data about languages based on standards ISO 639-1 and RFC 4646 (see http://www.faqs.org/rfcs/rfc4646.html). :: CREATE TABLE static_languages ( uid int(11) unsigned NOT NULL auto_increment, pid int(11) unsigned NOT NULL default '0', deleted tinyint(4) NOT NULL default '0', lg_iso_2 char(2) NOT NULL default '', lg_name_local varchar(99) NOT NULL default '', lg_name_en varchar(50) NOT NULL default '', lg_typo3 char(2) NOT NULL default '', lg_country_iso_2 char(2) NOT NULL default '', lg_collate_locale varchar(5) NOT NULL default '', lg_sacred tinyint(3) unsigned NOT NULL default '0', lg_constructed tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (uid), KEY parent (pid) ); The local name ( lg\_name\_local) of a language is in the language itself. Appropriate Unicode fonts are required to display all entries on a client computer. .. _Tables-extension-by-language-pack: Tables extension by language pack --------------------------------- A language pack will add columns to these tables in the following way. A language pack is identified by a two-letter ISO language code (e.g. de), possibly followed by an underscore and a two-letter ISO country code (e.g. de\_AT). Let ## stand for the lower-cased identifier of the language pack (e.g. de or de\_at), then the following columns will be added to the tables: - static\_territories: tr\_name\_## - static\_countries: cn\_short\_## - static\_country\_zones: zn\_name\_## - static\_currencies: cu\_name\_## and cu\_sub\_name\_## - static\_languages: lg\_name\_## .. _Extbase-domain-model: Extbase domain model ==================== .. _Objects-properties-and-methods: Objects, properties and methods ------------------------------- The domain model provides the following objects onto which are mapped the corresponding static tables. The domain model uses the name space SJBR\StaticInfoTables\Domain\Model .. _Territory: Territory ^^^^^^^^^ The class is named: SJBR\StaticInfoTables\Domain\Model\Territory The following properties have a getter and a setter: - deleted (whether or not the terrritory was removed from the UN standard) - nameEn (English name) - nameLocalized (localized name of the territory, non-persistent) - parentTerritoryUnCodeNumber (UN code of containing territory) - unCodeNumber (UN code) .. _Country: Country ^^^^^^^ The class is named: SJBR\StaticInfoTables\Domain\Model\Country The following properties have a getter and a setter: - addressFormat - capitalCity (name of captital city) - countryZones (country subdivisions of the country) - currencyIsoCodeA3 - currencyIsoCodeNumber - deleted (whether or not the country was removed from the ISO standard) - euMember (whether or not the country is a member of the European Union) - additional method: isEuMember() - isoCodeA2 - isoCodeA3 - isoCodeNumber - nameLocalized (localized name of the country, non-persistent) - officialNameEn (official English name) - officialNameLocal (official name of the country in local language and local script) - parentTerritoryUnCodeNumber (UN number of the territory in which the country is located) - phonePrefix (international phone prefix for the country) - shortNameEn (short English name) - shortNameLocal (short name of the country in local language and local script) - topLevelDomain (Internet top level domain of the country) - unMember (whether or not the country is a member of the UNO) - additional method: isUnMember() - zoneFlag (whether or not the country has subdivisions) .. _CountryZone: CountryZone ^^^^^^^^^^^ The class is named: SJBR\StaticInfoTables\Domain\Model\CountryZone The following properties have a getter and a setter: - countryIsoCodeA2 - countryIsoCodeA3 - countryIsoCodeNumber - deleted (whether or not the country zone was removed from the ISO standard) - isoCode - localName (name of the country zone in local language and local script) - nameEn (English name of the country zone) - nameLocalized (localized name of the country zone, non-persistent) .. _Currency: Currency ^^^^^^^^ The class is named: SJBR\StaticInfoTables\Domain\Model\Currency The following properties have a getter and a setter: - decimalDigits (number of decimals to be shown when an amount is presented in this currency) - decimalPoint (character to be shown in front of the decimals when an amount is presented in this currency) - deleted (whether or not the currency was removed from the ISO standard) - divisor (divisor used to obtain the subdivision of the currency) - isoCodeA3 - isoCodeNumber - nameEn (English name of the currency) - nameLocalized (localized name of the currency, non-persistent) - subdivisionNameEn (English name of the subdivision of the currency) - subdivisionSymbolLeft (symbol to be shown to the left of an amount stated in units of the subdivision of the currency) - subdivisionSymbolRight (symbol to be shown to the right of an amount stated in units of the subdivision of the currency) - symbolLeft (symbol to be shown to the left of an amount stated in units of the currency) - symbolRight (symbol to be shown to the right of an amount stated in units of the currency) - thousandsPoint (Character to be used between every group of thousands of an amount stated in units of this currency) .. _Language: Language ^^^^^^^^ The class is named: SJBR\StaticInfoTables\Domain\Model\Language The following properties have a getter and a setter: - collatingLocale - constructedLanguage (whether or not the language is a constructed language) - additional method: isConstructedLanguage() - countryIsoCodeA2 (country code as two digit string that identifies this language as a variant of the language identified by property isoCodeA2) - deleted (whether or not the language was removed from the ISO standard) - isoCodeA2 - localName (name of the language in the language itself) - nameEn (English name of the language) - nameLocalized (localized name of the language, non-persistent) - typo3Code (deprecated) - sacredLanguage (whether or not the language is a sacred language) - additional method: isSacredLanguage() - typo3Code (deprecated) .. _Domain-model-extension-by-language-pack: Domain model extension by language pack --------------------------------------- .. _Additional-properties: Additional properties ^^^^^^^^^^^^^^^^^^^^^ Language packs will add properties and corresponding getters and setters to the domain model objects in the following way. A language pack is identified by a two-letter ISO language code (e.g. de), possibly followed by an underscore and a two-letter ISO country code (e.g. de\_AT). Let XX stand for the camelization of the identifier of the language pack (e.g. De or DeAt), the following properties will be added to the domain model objects: - SJBR\StaticInfoTables\Domain\Model\Territory: nameXX - SJBR\StaticInfoTables\Domain\Model\Country: shortNameXX - SJBR\StaticInfoTables\Domain\Model\CountryZone: nameXX - SJBR\StaticInfoTables\Domain\Model\Currency: nameXX and subdivisionNameXX - SJBR\StaticInfoTables\Domain\Model\Language: nameXX .. _Localization-property-nameLocalized: Localization property nameLocalized ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The property nameLocalized is available on each of the static entities of the domain model. The property is derived from the available naming properties and is non-persistent. This method getNameLocalized() applies the localization rules as specified by the current TYPO3 configuration, using any available localized names as provided by the installed language packs. .. _Repositories-and-methods: Repositories and methods ------------------------ .. _Abstract-repository: Abstract repository ^^^^^^^^^^^^^^^^^^^ The following methods are available on the repository of all static entities. .. _localizedSort-TYPO3-CMS-Extbase-Persistence-QueryResultInterface-entities: localizedSort(\TYPO3\CMS\Extbase\Persistence\QueryResultInterface $entities) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns an array of all input entities ordered by localizedname. .. _findAllOrderedBy-fieldName-orderDirection-asc: findAllOrderedBy($fieldName, $orderDirection = 'asc') """"""""""""""""""""""""""""""""""""""""""""""""""""" Returns all domain objects ordered by the given field name and the given order direction. .. _Territory: Territory ^^^^^^^^^ The repository class is named: SJBR\StaticInfoTables\Domain\Repository\Territory The following methods are available: .. _findByCountry-SJBR-StaticInfoTables-Domain-Model-Country-country: findByCountry(\SJBR\StaticInfoTables\Domain\Model\Country $country) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns the territory in which the country is located. .. _findByTerritory-SJBR-StaticInfoTables-Domain-Model-Territory-territory: findByTerritory(\SJBR\StaticInfoTables\Domain\Model\Territory $territory) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns the territory in which the territory is located. .. _findWithinTerritory-SJBR-StaticInfoTables-Domain-Model-Territory-territory: findWithinTerritory(\SJBR\StaticInfoTables\Domain\Model\Territory $territory) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns all territories within a territory recursively. .. _Country: Country ^^^^^^^ The repository class is named: SJBR\StaticInfoTables\Domain\Repository\Country The following methods are available: .. _findByTerritory-SJBR-StaticInfoTables-Domain-Model-Territory-territory: findByTerritory(\SJBR\StaticInfoTables\Domain\Model\Territory $territory) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns all countries located in the giventerritory .. _findByTerritoryOrderedByLocalizedName-SJBR-StaticInfoTables-Domain-Model-Territory-territory: findByTerritoryOrderedByLocalizedName(\SJBR\StaticInfoTables\Domain\Model\Territory $territory) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns all countries located in the given territoryordered by localized name. .. _CountryZone: CountryZone ^^^^^^^^^^^ The repository class is named:SJBR\StaticInfoTables\Domain\Repository\CountryZone The following methods are available: .. _findByCountry-SJBR-StaticInfoTables-Domain-Model-Country-country: findByCountry(\SJBR\StaticInfoTables\Domain\Model\Country $country) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns all country zones of the country. .. _findByCountryOrderedByLocalizedName-SJBR-StaticInfoTables-Domain-Model-Country-country: findByCountryOrderedByLocalizedName(\SJBR\StaticInfoTables\Domain\Model\Country $country) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns all country zones of the country ordered by localizedname. .. _Currency: Currency ^^^^^^^^ The repository class is named: SJBR\StaticInfoTables\Domain\Repository\Currency The following method is available: .. _findByCountry-SJBR-StaticInfoTables-Domain-Model-Country-country: findByCountry(\SJBR\StaticInfoTables\Domain\Model\Country $country) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns the currency in use in the country. .. _Language: Language ^^^^^^^^ The repository class is named: SJBR\StaticInfoTables\Domain\Repository\Language The following methods are available: .. _findAllNonConstructedNonSacred: findAllNonConstructedNonSacred() """""""""""""""""""""""""""""""" Returns all language objects of non-contructed and non-sacred languages. .. _findOneByIsoCodes-languageIsoCodeA2-countryIsoCodeA2: findOneByIsoCodes($languageIsoCodeA2, $countryIsoCodeA2 = '') """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Returns the language object with the specified language and, optionally, country ISO codes. .. _Using-the-model: Using the model --------------- .. _Adding-a-country-select-field-to-a-form: Adding a country select field to a form ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you want to insert a country select box into a form, you first have to add a Fluid select view helper to your Fluid template: :: Using property “nameLocalized” as label will display the country names is the language of the current page. In the script of the controller class, you then need to inject the Country repository: :: /** * @var \SJBR\StaticInfoTables\Domain\Repository\CountryRepository */ protected $countryRepository; /** * Dependency injection of the Country Repository * * @param \SJBR\StaticInfoTables\Domain\Repository\CountryRepository $countryRepository * @return void */ public function injectCountryRepository(\SJBR\StaticInfoTables\Domain\Repository\CountryRepository $countryRepository) { $this->countryRepository = $countryRepository; } Finally, your action method needs to fill in the countries: :: public function myNewAction() { $countries = $this->countryRepository->findAll(); $this->view->assign('countries', $countries); } .. _Using-the-select-View-Helper: Using the select View Helper ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Alternatively, the extension provides a viewHelper to insert a select field on a form. Default usage: :: {namespace s=SJBR\StaticInfoTables\ViewHelpers} Optional usage: :: Subselect usage: (only CountryZones of Germany) :: .. _Further-examples: Further examples ^^^^^^^^^^^^^^^^ You may find further examples in the source code of the test form included in the backend module of this extension. .. _Configuration-of-backend-forms: Configuration of backend forms ============================== .. _Localization-of-entity-selector: Localization of entity selector ------------------------------- When configuring an entity selector, it is possible to render a localized selector using the following class in the TCA itemsProcFunc configuration property: SJBR\StaticInfoTables\Hook\Backend\Form\FormDa taProvider\TcaSelectItemsProcessor. For example, the following will render a localized countries selector: :: $GLOBALS['TCA'][tablename]['columns'][fieldname]['config'] = array( 'type' => 'select', 'items' => array( array('', 0), ), 'foreign_table' => 'static_countries', 'foreign_table_where' => 'ORDER BY static_countries.cn_short_en', 'itemsProcFunc' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor->translateCountriesSelector', 'size' => 1, 'minitems' => 0, 'maxitems' => 1 ); Note: SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSele ctItemsProcessor applies to TYPO3 CMS 7.For TYPO3 CMS 6.2, use SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper. .. _Alternate-value-fields-for-entity-selector: Alternate value fields for entity selector ------------------------------------------ When configuring an entity selector as a localized selector, it is also possible to use fields other than the uid for the selector values. This is done by adding the itemsProcFunc\_config array and the indexField property. For example, the following will render a localized languages selector. The value of each language will be the value of the language ISO Code A2. If the language has a country ISO Code A2, it is concatenated, the two codes being separated by an underscore (such as in PT\_BR for Brazilian Protuguese). :: $GLOBALS['TCA'][tablename]['columns'][fieldname]['config'] = array( 'type' => 'select', 'items' => array( array('', 0), ), 'foreign_table' => 'static_languages', 'allowNonIdValues' => TRUE, 'foreign_table_where' => 'AND static_languages.lg_sacred = 0 ORDER BY static_languages.lg_name_en', 'itemsProcFunc' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor->translateLanguagesSelector', 'itemsProcFunc_config' => array( 'indexField' => 'lg_iso_2,lg_country_iso_2', ), 'size' => 1, 'minitems' => 0, 'maxitems' => 1 ); Note: SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSele ctItemsProcessor applies to TYPO3 CMS 7.For TYPO3 CMS 6.2, use SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper. .. _Localization-of-suggest-wizard: Localization of suggest wizard ------------------------------ It is also possible to provide a localized suggest wizard for the selector: For example, the following will add a localized suggest wizard to a localized countries selector: :: $GLOBALS['TCA'][tablename]['columns'][fieldname]['config'] = [ 'type' => 'group', 'internal_type' => 'db', 'allowed' => 'static_countries', 'foreign_table' => 'static_countries', 'foreign_table_where' => 'ORDER BY static_countries.cn_short_en', 'suggestOptions' => [ 'default' => [ 'pidList' => '0' ] ], 'fieldWizard' => [ 'recordsOverview' => [ 'disabled' => true ], 'tableList' => [ 'disabled' => true ] ], 'size' => 1, 'minitems' => 0, 'maxitems' => 1 ]; With TYPO3 6 and 7 LTS, this was: :: $GLOBALS['TCA'][tablename]['columns'][fieldname]['config'] = array( 'type' => 'select', 'items' => array( array('', 0), ), 'foreign_table' => 'static_countries', 'foreign_table_where' => 'ORDER BY static_countries.cn_short_en', 'itemsProcFunc' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor->translateCountriesSelector', 'size' => 1, 'minitems' => 0, 'maxitems' => 1, 'wizards' => array( 'suggest' => array( 'type' => 'suggest', 'default' => array( 'receiverClass' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\Wizard\\SuggestReceiver' ) ) ) ); Note: SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSele ctItemsProcessor and SJBR\StaticInfoTables\Hook\Backend\Form\Wizard\SuggestReceiver apply to TYPO3 CMS 7.For TYPO3 CMS 6.2, use SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper and SJBR\StaticInfoTables\Hook\Backend\Form\SuggestReceiver respectively. .. _Pre-Extbase-API: Pre-Extbase API =============== .. _API-class: API class --------- Class SJBR\StaticInfoTables\PiBaseApi (previously known as tx\_staticinfotables\_pi1) may be used in any TYPO3 frontend plugin or backend module. When used in the frontend, some default values may be configured using the TS template constant editor. See the Configuration section. .. _Class-initialization: Class initialization ^^^^^^^^^^^^^^^^^^^^ The following example statements will instantiate and initialize the class: :: $this->staticInfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('SJBR\\StaticInfoTables\\PiBaseApi'); if ($this->staticInfo->needsInit()) { $this->staticInfo->init(); } Method init() will initialize: - the language of display: using the TypoScript template config.language property; - the default currency used to format amounts: using the configured currencyCode; - defaults for selected values in drop-down lists: using the configured countryCode, countryZoneCode, currencyCode and languageCode. .. _Getting-a-localized-name: Getting a localized name ^^^^^^^^^^^^^^^^^^^^^^^^ Each of the following example statements will return the name of some entity given its code. The name will be in the language specified by the TypoScript config.language property. :: $this->staticInfo->getStaticInfoName('COUNTRIES', $countryCode); $this->staticInfo->getStaticInfoName('SUBDIVISIONS', $zoneCode, $countryCode); $this->staticInfo->getStaticInfoName('CURRENCIES', $currencyCode); $this->staticInfo->getStaticInfoName('LANGUAGES', $languageCode, '', '', $self); In the case of LANGUAGES, if $self is set to 1, the name of the language will be returned in the language itself. See the source code for a description of the parameters. .. _Creating-a-localized-drop-down-selector: Creating a localized drop-down selector ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Each of the following example statements will return a string of