Initial commit - Typo3 11.5.41
53
typo3conf/ext/static_info_tables/.editorconfig
Normal file
@@ -0,0 +1,53 @@
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# JS files
|
||||
[*.js]
|
||||
indent_size = 2
|
||||
|
||||
# JSON files
|
||||
[*.json]
|
||||
indent_style = tab
|
||||
|
||||
# package.json
|
||||
[package.json]
|
||||
indent_size = 2
|
||||
|
||||
# ReST files
|
||||
[*.rst]
|
||||
indent_size = 3
|
||||
max_line_length = 80
|
||||
|
||||
# SQL files
|
||||
[*.sql]
|
||||
indent_style = tab
|
||||
indent_size = 2
|
||||
|
||||
# TypoScript files
|
||||
[*.{typoscript,tsconfig}]
|
||||
indent_size = 2
|
||||
|
||||
# YAML files
|
||||
[{*.yml,*.yaml}]
|
||||
indent_size = 2
|
||||
|
||||
# XLF files
|
||||
[*.xlf]
|
||||
indent_style = tab
|
||||
|
||||
# .htaccess
|
||||
[.htaccess]
|
||||
indent_style = tab
|
||||
|
||||
# Markdown files
|
||||
[*.md]
|
||||
max_line_length = 80
|
||||
4
typo3conf/ext/static_info_tables/.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Please keep the lines in this file sorted.
|
||||
/.editorconfig export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/Tests/ export-ignore
|
||||
803
typo3conf/ext/static_info_tables/ChangeLog
Normal file
@@ -0,0 +1,803 @@
|
||||
2021-03-03 Stanislas Rolland <typo32021(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #93570: Typo in name of country zone Newfoundland
|
||||
* Resolves #93265: Deprecated language file references
|
||||
|
||||
2020-10-24 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #92615: Missing language label in TCA
|
||||
* Update version to 6.9.5
|
||||
|
||||
2020-11-21 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.9.4
|
||||
|
||||
2020-10-23 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #92615: Missing language label in TCA
|
||||
|
||||
2020-10-19 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.9.3
|
||||
|
||||
2020-06-09 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #91626: Remove any code related to TYPO3 prior to 9 LTS
|
||||
* Require TYPO3 9 LTS
|
||||
* Update version to 6.8.0
|
||||
|
||||
2020-06-04 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #91587: Streamline some redundant code in language pack
|
||||
* Resolves #91590: Fix ordering of record lists in current language in backend
|
||||
* Resolves #88684: Only run update script when extensions have changed
|
||||
|
||||
2020-06-03 Stanislas Rolland <typo32020(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #91250: Add php configuration file for Extbase persistence mapping
|
||||
* Resolves #90274: Add support for PHP 7.4
|
||||
* Resolves #91251: Add Symfony dependency injection configuration
|
||||
* Resolves #91567: Add php configuration file for Extbase persistence mapping to generated language pack
|
||||
* Resolves #91575: Use Symfony expression language for TypoScript conditions
|
||||
* Resolves #91252: Adapt to changed arguments of Extensionmanager\Utility\EmConfUtility\includeEmConf in TYPO3 10
|
||||
* Resolves #91577: Delete @lazy annotation removed in TYPO3 10
|
||||
* Resolves #90741: Enable in TYPO3 LTS 10
|
||||
* Update version to 6.8.0
|
||||
|
||||
2020-01-05 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #88867: Raise PHP dependency to < 7.4
|
||||
|
||||
2019-10-17 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #88683: Updater uses default columns in TYPO3 9
|
||||
* Resolves #88780: Undefined variable usage in the DatabaseUpdateUtility.php
|
||||
* Resolves #89443: Update subdivisions of Italy
|
||||
* Update version to 6.7.5
|
||||
|
||||
2019-05-28 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #82132: Composer install fails with additional languages required at the same time
|
||||
|
||||
2019-05-21 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #87983: The name of capital of Ukraine should be 'Kyiv'
|
||||
* Resolves #87943: Change Country Name Macedonia to North Macedonia
|
||||
* Resolves #87877: LocalizationUtility missing import for TYPO3\CMS\Core\Site\Entity\SiteLanguage in TYPO3 9 LTS
|
||||
|
||||
2019-01-04 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #87243: Constant editor fails with class not found exception
|
||||
* Resolves #87329: Fix non-UTF-8 character in ext_emconf
|
||||
* Resolves #87330: Fix wrong array access to $emConf['version']
|
||||
* Update version to 6.7.4
|
||||
|
||||
2018-12-19 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86991: Language pack generation fails with fatal error
|
||||
* Resolves #87225: Add Kosovo user-defined country code
|
||||
|
||||
2018-10-25 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86710: Crash in PHP 7.0 due to nullable return type
|
||||
* Resolves #86723: Autoformat the code
|
||||
* Update version to 6.7.2
|
||||
|
||||
2018-10-20 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86706: Avoid reference to PHP constant TAB
|
||||
* Resolves #86707: Use @TYPO3\CMS\Extbase\Annotation\ORM\Lazy annotation
|
||||
|
||||
2018-10-18 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86694: Avoid constant TYPO3_site with TYPO3 9 LTS
|
||||
* Resolves #86695: In frontend, localize using current site language when it exists
|
||||
* Update version to 6.7.1
|
||||
|
||||
2018-10-14 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86610: Add schema migration service and dumping utility
|
||||
* Resolves #86654: Migrate extension update script to TYPO3 LTS 9
|
||||
* Resolves #84258: Call to a member function getTreeList() on null
|
||||
* Update version to 6.6.0
|
||||
* Resolves #83722: Installation via Composer does not work correctly
|
||||
* Resolves #86656: Change name of Swaziland to Eswatini
|
||||
* Update version to 6.7.0
|
||||
|
||||
2018-10-11 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86633: Migrate Recordlist hook to TYPO3 9 LTS
|
||||
* Resolves #86634: Remove @inject annotation
|
||||
|
||||
2018-10-9 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #86608: Remove support for TYPO3 7 LTS - Thanks to Tomas Norre Mikkelsen
|
||||
* Resolves #86609: Remove references to TYPO3_DB object - Thanks to Tomas Norre Mikkelsen
|
||||
|
||||
2017-12-19 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #83060: Wrong table name in Configuration/TCA/Overrides/static_countries.php - Thanks to Simon Schaufelberger
|
||||
* Update manual
|
||||
* Update version to 6.5.1
|
||||
|
||||
2017-11-19 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #83033: Adapt suggest options to 8 LTS
|
||||
* Resolves #82808: Critical Invalid Cache Bug - Thanks to Tim Lochmüller
|
||||
* Update version to 6.5.0
|
||||
|
||||
2017-10-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #82779: Corrections to official and English names of Swiss cantons - Thanks to Urs Bräm
|
||||
* Resolves #80408: Error in composer replace statement
|
||||
|
||||
2017-04-11 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.4.3
|
||||
|
||||
2017-02-21 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79648: Call to undefined method SJBR\StaticInfoTables\Domain\Model\Country::getAddessFormat()
|
||||
* Resolves #79944: Croatia is not marked as EU country
|
||||
* Resolves #77144: Table 'typo3.tx_staticinfotables_domain_model_language' doesn't exist
|
||||
|
||||
2017-01-24 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.4.2
|
||||
|
||||
2017-01-20 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79396: class.tx_staticinfotables_encoding.php, failed to open stream: No such file or directory
|
||||
|
||||
2017-01-18 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79384: Issues in TYPO3 CMS 7 after migration to Doctrine
|
||||
* Resolves #79385: Update extension icon to svg
|
||||
* Update version to 6.4.1
|
||||
|
||||
2017-01-17 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79359: Migrate PiBaseApi to Doctrine
|
||||
* Follow-up to Resolves #79229: Migrate suggest receiver to Doctrine
|
||||
* Follow-up to Resolves #79207: Cleanup extension configuration
|
||||
* Update version to 6.4.0
|
||||
|
||||
2017-01-10 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79255: Migrate Localization Utility to Doctrine
|
||||
|
||||
2017-01-09 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79223: Standardize SQL table definitions
|
||||
* Resolves #79035: Update currency of Baltic states
|
||||
* Resolves #77245: Add languages "Swiss" and "Austrian"
|
||||
* Resolves #77246: Missing extbase declaration for field "static_lang_isocode" in sys_language
|
||||
* Follow-up to Resolves #79209: Migrate update script to Doctrine
|
||||
* Resolves #79229: Migrate suggest receiver to Doctrine
|
||||
* Follow-up to Resolves #79209: Migrate update script to Doctrine
|
||||
* Resolves #79230: Migrate ProcessDataMap hook to Doctrine
|
||||
* Resolves #79231: Drop character set conversions
|
||||
|
||||
2017-01-08 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79207: Cleanup extension configuration
|
||||
* Resolves #79209: Migrate update script to Doctrine
|
||||
* Resolves #79210: Migrate AbstractEntityRepository to Doctrine
|
||||
|
||||
2017-01-07 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Cleanup ManagerController.php
|
||||
* Cleanup SelectViewHelper.php
|
||||
* Migrate DatabaseUpdateUtility to Doctrine
|
||||
|
||||
2017-01-06 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79192: Remove constant PATH_BE_staticinfotables_rel
|
||||
* Require TYPO3 CMS 7.6.0
|
||||
* Follow-up to #79174: Let the SelectViewHelper accept correct values
|
||||
* Resolves #79193: Drop renderMode argument from flash message view helper
|
||||
|
||||
2017-01-05 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #79174: Let the SelectViewHelper accept correct values
|
||||
* Resolves #79172: Database updates not working for translations with TYPO3 8.0
|
||||
|
||||
2016-07-14 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.3.10
|
||||
|
||||
2016-06-29 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #76640: Fix removed TCA icon options
|
||||
|
||||
2016-02-19 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.3.9
|
||||
|
||||
2016-02-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #73462: Update of static_info_tables breaks TYPO3 6.2 installation
|
||||
* Resolves #72828: Follow-up to Avoid exceptions in backend list
|
||||
* Update version to 6.3.8
|
||||
* Resolves #73497: Composer name sjbr/static_info_tables vs sjbr/static-info-tables
|
||||
|
||||
2016-02-15 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #72260: SelectViewHelper should honour TypoScript settings
|
||||
* Update the manual
|
||||
* Resolves #72828: Avoid exceptions in backend list, if there are elements with wrong uids (Thanks to Tim Lochm<68>ller)
|
||||
|
||||
2016-02-14 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #72257: Repository Tags should be in a form recongized by composer
|
||||
|
||||
2015-12-02 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #72009: composer.json wrong replace
|
||||
* Resolves #71910: Field name conversion uses upperCamelCase instead of lowerCamelCase
|
||||
* Update version to 6.3.6
|
||||
|
||||
2015-11-23 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #71310: composer.json contains invalid version range for core
|
||||
* Update version to 6.3.5
|
||||
|
||||
2015-11-03 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #71263: Fatal error in tx_rtehtmlarea_acronym with PHP 5.3
|
||||
* Resolves #66194: 500 error in access log
|
||||
* Update version to 6.3.4
|
||||
|
||||
2015-11-02 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #71108: some broken icon paths
|
||||
* Resolves #71005: Add static_lang_isocode of RTE acronym table
|
||||
* Update version to 6.3.3
|
||||
|
||||
2015-10-11 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #70592: Fix deprecated TCA specification for select fields
|
||||
* Resolves #70593: Cleanup ext_emconf.php
|
||||
* Update version to 6.3.2
|
||||
|
||||
2015-10-09 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #70541: Warning: Ambiguous class resolution, because of two ext_update definitions
|
||||
* Update version to 6.3.1
|
||||
|
||||
2015-10-01 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #59834: Always run the extension update script except on first install of base extension
|
||||
* Resolves #59834: Follow-up to Always run the extension update script
|
||||
* Update version to 6.3.0
|
||||
|
||||
2015-09-30 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #70224: Import SQL parser for Dbal-free parsing with TYPO3 CMS 7.5+
|
||||
* Resolves #70225: Add composer.json to extension and language pack template
|
||||
* Resolves #70228: Delete old language files
|
||||
* Resolves #70231: Delete translation files from extension
|
||||
* Resolves #70235: Move static template registration to TCA/Overrides
|
||||
* Resolves #70239: Adapt to new TCA configuration and backend Form Engine API of TYPO3 CMS 7
|
||||
* Resolves #70240: !!! Remove class tx_staticinfotables_div
|
||||
* Resolves #70241: Remove reference to removed method
|
||||
* Update the manual
|
||||
* Resolves #70240: Follow-up to Remove class tx_staticinfotables_div
|
||||
* Resolves #66011: Fatal error when executing update script
|
||||
* Resolves #70224: Follow-up to Import SQL parser for Dbal-free parsing with TYPO3 CMS 7.5+
|
||||
* Resolves #69133: Avoid exception if a class is loaded early
|
||||
|
||||
2015-09-14 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #67998: Increase maxitems for cn_country_zones in TCA
|
||||
* Resolves #67677: Problems in Typo3 CMS 7.3
|
||||
* Resolves #67161: Incorrect mapping for field 'deleted'
|
||||
* Resolves #66484: Missing TCA option in manual example
|
||||
|
||||
2015-02-10 Oliver Klee <typo3-coding@oliverklee.de>
|
||||
|
||||
* Resolves #64135: Block any write access to the static models
|
||||
|
||||
2015-02-10 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Escape some backslashes in class names
|
||||
* Resolves #64945: Error when installing on 7.1
|
||||
* Enable in TYPO3 CMS 7.1
|
||||
|
||||
2014-12-09 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fix for TYPO3 CMS 7.0
|
||||
* Enable in TYPO3 CMS 7.0
|
||||
* Update version to 6.2.1
|
||||
|
||||
2014-12-08 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.2.0
|
||||
|
||||
2014-11-07 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Require TYPO3 CMS 6.2.0
|
||||
* Resolves #62770: Replace deprecated calls to ObjectManager ->create() with ->get()
|
||||
* Resolves #61296: Move TCA configuration from ext_tables.php to Configuration/TCA
|
||||
* Remove method TcaUtility::loadTCA
|
||||
|
||||
2014-10-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Remove file Resources/Private/Language/pl.locallang_db.xlf
|
||||
* Update version to 6.1.2
|
||||
|
||||
2014-10-10 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #62153: Open country or territory for editing in backend leads to fatal error (Thanks to Daniel Minder)
|
||||
|
||||
2014-10-08 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.1.1
|
||||
|
||||
2014-09-29 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Add getters for abstract entity properties tableName and columnsMapping
|
||||
|
||||
2014-09-22 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #59586: Add Subterritory "419 Latin America and the Caribbean"
|
||||
* Resolves #61769: Polish zones should be written beginning from lower letter
|
||||
* Rename directory Configuration/Tca to Configuration/TCA
|
||||
* Resolves #60725: Reduce used memory of the Domain Models (Thanks to Tim Lochmüller)
|
||||
* Resolves #59896: TCA Selection of countries with different key
|
||||
|
||||
2014-07-29 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #60666: Outdated data for Turkish lira
|
||||
* Resolves #59459: SelectViewHelper: DefaultOptionValue and Label with no effect (Thanks to Thomas Löffler)
|
||||
* Resolves #59451: SelectViewHelper returns no items (Thanks to Thomas Löffler)
|
||||
|
||||
2014-06-03 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #59300: Missing namespace for InvalidArgumentException
|
||||
* Resolves #59301: Missing "searchFields" configuration in ext_tables.php
|
||||
* Add localized fields as searchFields next time language pack is (re-)generated
|
||||
* Usage of $GLOBALS['typo3CacheManager'] and $GLOBALS['typo3CacheFactory'] are deprecated since 6.2
|
||||
|
||||
2014-04-29 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.1.0
|
||||
|
||||
2014-04-23 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update the manual
|
||||
|
||||
2014-04-22 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #58100: Incorrect annotation for tableName on AbstractEntity
|
||||
* Resolves #58101: Make extension incompatible with extension "uncache"
|
||||
* Resolves #56327: Add select viewHelper with values from tables (Thanks to Carsten Biebricher)
|
||||
* Resolves #58100: Incorrect annotation for tableName on AbstractEntity
|
||||
* Resolves #58107: Add countryZones to country domain model
|
||||
* Use select viewHelper in test form
|
||||
|
||||
2014-03-26 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.0.10
|
||||
|
||||
2014-03-17 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #56389: Fatal error: Call to a member function getCollatingLocale() on a non-object in LocalizationUtility.php
|
||||
|
||||
2014-03-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #56954: getIsoCodeField() is protected but needed from outside
|
||||
|
||||
2014-02-27 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #52431: Localization of nameLocalized not working in preview of attribute
|
||||
|
||||
2014-02-21 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.0.9
|
||||
|
||||
2014-02-17 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #56038: Language Pack Generator crashes in TYPO3 6.0
|
||||
|
||||
2014-02-15 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #56001: Language packs not re-applied by update script of Static Info Tables
|
||||
|
||||
2014-02-13 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #55952: Wrong phone code for Liechtenstein in static_countries table
|
||||
* Update version to 6.0.8
|
||||
|
||||
2014-02-06 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #55476: Deprecated CSS inclusion
|
||||
* Resolves #55744: Class TYPO3\CMS\Install\Sql\SchemaMigrator was renamed
|
||||
|
||||
2014-01-20 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #55183: Deprecation message - remove parameter
|
||||
|
||||
2014-01-18 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Re-create the tables whenever the extension update script in run
|
||||
|
||||
2014-01-17 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Follow-up to #54160: List module broken on root page
|
||||
* Follow-up to #54160: Throw exception when current language is not found in Language repository
|
||||
|
||||
2014-01-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #55081: Fatal error in Static Info Tables Manager module in TYPO3 6.2
|
||||
* Follow-up to #55081: Fatal error in Static Info Tables Manager module in TYPO3 6.2
|
||||
* Clean-up in class SJBR\StaticInfoTables\Hook\Backend\Form\SuggestReceiver
|
||||
* Clean-up in class SJBR\StaticInfoTables\Hook\Backend\Form\ElementRenderingHelper
|
||||
* Add TYPO3 version range dependency to generated language pack extension
|
||||
* Follow-up to #50804: Entities not sorted according to locale collation
|
||||
* Adjust country BE form
|
||||
|
||||
2013-12-03 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #54160: List module broken on root page
|
||||
|
||||
2013-11-27 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #54008: CachedClassLoader not loaded in ext_localconf in TYPO3 6.2
|
||||
* Enable in TYPO3 6.2
|
||||
* Update version to 6.0.7
|
||||
|
||||
2013-11-26 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #52103: PHP Warning in ElementRenderingHelper
|
||||
* Update version to 6.0.6
|
||||
* Resolves #53987: Incorrectly named Brazilian locallang file
|
||||
|
||||
2013-11-25 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #52415: Caching issue while using static country repository
|
||||
|
||||
2013-11-21 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #53840: Could not determine the child object type.
|
||||
* Resolves #51532: cn_currency_iso_3 in some african countries are wrong in table static_countries
|
||||
* Resolves #52572: countryRepository->findByTerritory does not respect territory hierarchy
|
||||
|
||||
2013-11-20 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #51754: PHP Warning in ClassCacheManager
|
||||
|
||||
2013-08-12 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Follow-up to #50804: Entities not sorted according to locale collation
|
||||
* Resolves #50742: Translation handling fails in multi select fields (TCA)
|
||||
|
||||
2013-08-07 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #50804: Entities not sorted according to locale collation
|
||||
|
||||
2013-07-24 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.0.5
|
||||
|
||||
2013-07-18 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Follow-up to #50050: Use TYPO3 caching framework for extended domain model classes
|
||||
* Resolves #50164: Autoload cached extended domain model classes
|
||||
|
||||
2013-07-15 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #50034: Re-introduce tx_staticinfotables_div::getTitleFromIsoCode as deprecated method
|
||||
* Resolves #50036: Clarify message from ext_update script
|
||||
* Resolves #49878: clearCachePostProc should clear proxy classes only when cacheCmd=all
|
||||
* Resolves #50050: Use TYPO3 caching framework for extended domain model classes
|
||||
* Resolves #49590: Montenegrin language is missing in the static_info_tables
|
||||
|
||||
2013-07-02 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #49397: No method name 'selectItemsTCA' in class tx_staticinfotables_div
|
||||
* Follow-up to #49397: Correction to the manual
|
||||
* Cleanup unescaped backslashes
|
||||
* Correction to the manual
|
||||
|
||||
2013-06-26 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #49462: Class tx_staticinfotables_pi1 not always available
|
||||
* Resolves #49463: Make extension version available to other extensions
|
||||
|
||||
2013-06-17 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 6.0.4
|
||||
|
||||
2013-06-14 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #49124: Automated PHP Syntax check on LanguagePackTemplates fails
|
||||
* Resolves #49142: Add a method to Language Repository
|
||||
|
||||
2013-06-06 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Follow-up to #48814: Records labels missing in list view using PHP 5.4 (Thanks to Visay Keo)
|
||||
|
||||
2013-06-04 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #48814: Records labels missing in list view using PHP 5.4 (Thanks to Visay Keo)
|
||||
|
||||
2013-05-31 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #48659: Superfluous closing ">" in pi1/class.tx_staticinfotables_pi1.php
|
||||
* Update version to 6.0.3
|
||||
|
||||
2013-05-25 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #48524: Missing file Classes/Domain/Model/LanguageExtensible.php
|
||||
* Resolves #48528: Error in update script on TYPO3 6.1.1
|
||||
* Update version to 6.0.1
|
||||
|
||||
2013-05-23 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fix extended domain model classes loading after class loader cache is cleared
|
||||
* Improve class cache handling
|
||||
* Relax extension conflicts
|
||||
* Update manual
|
||||
* GeneralUtility::loadTCA is deprecated in TYPO3 6.1
|
||||
* Follow-up to GeneralUtility::loadTCA is deprecated in TYPO3 6.1
|
||||
|
||||
2013-05-22 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #48473: Add action to test localization after installation of language pack
|
||||
* Fix language pack update
|
||||
|
||||
2013-05-21 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Log usage of deprecated functions
|
||||
* Set TYPO3 version constraint to 6.0.6-6.1.99
|
||||
* Delete unused partials
|
||||
* Fix domain model inconsistencies
|
||||
* Refactor findAllOrderedByLocalizedName
|
||||
|
||||
2013-05-20 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fix for backward compatibility of class tx_staticinfotables_div
|
||||
* Update some copyright notices
|
||||
* Follow-up fix for backward compatibility of class tx_staticinfotables_div
|
||||
|
||||
2013-05-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Re-introduce class tx_staticinfotables_div for backward compatibility
|
||||
|
||||
2013-05-15 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Follow-up to #12683: Make TS template constants selectable
|
||||
* Follow-up to #45862: Enable domain model extension: rebuild class cache when updating extensions
|
||||
* Remove unnecessary entries from ext_autoload.php
|
||||
* Fix layout of code generated by class cache builder
|
||||
|
||||
2013-05-14 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #12683: Make TS template constants selectable
|
||||
* Resolves #48197: Incorrect extension of the language domain model by language packs
|
||||
* Resolves #48198: Add methods to retrieve entities ordered by localized names
|
||||
|
||||
2013-05-13 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #48156: Add backend module to generate language packs
|
||||
* Resolves #48161: Localization should honour alternative languages
|
||||
* Resolves #48162: Make pibase-style api usable in backend
|
||||
* Resolves #48163: Add repository method to retrieve all non-constructed and non-sacred languages
|
||||
* Resolves #48164: Add repository method to retrieve all entities including deleted ones
|
||||
* Update version to 6.0.0
|
||||
* Simplify EM configuration template
|
||||
|
||||
2013-03-05 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #46051: Make the extension version and constraints available when creating language packs
|
||||
|
||||
2013-03-03 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #45986: Add domain repositories classes
|
||||
|
||||
2013-02-27 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #45901: Add extbase persistence configuration and field mapping
|
||||
* Follow-up to #45901: Add extbase persistence configuration and field mapping
|
||||
|
||||
2013-02-26 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #45862: Enable domain model extension
|
||||
* Resolves #45874: Move domain model extension configuration to Configuration directory
|
||||
* Follow-up to #45848: Add domain model
|
||||
|
||||
2013-02-25 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #45823: Remove hotlist feature
|
||||
* Resolves #45847: Move TCA arrays to Configuration directory
|
||||
* Resolves #45848: Add domain model
|
||||
|
||||
2013-02-24 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #45809: Refactor code and introduce namespacing
|
||||
|
||||
2013-02-22 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #45738: Connect static_country_zones to static_countries
|
||||
* Apply TCA userFuncs to Static Info Tables Manager tables
|
||||
|
||||
2013-02-21 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Resolves #10037: Connect static_territories with static_countries
|
||||
* Resolves #45733: Move icons to Resources directory
|
||||
* Resolves #45734: Connect static_countries to static_currencies
|
||||
|
||||
2013-02-20 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fixed issue #39552: Default TS constants contain superfluous dot
|
||||
* Added feature #45626: Update countries to level of ISO 3166-1:2006 - Newsletter VI-12 (2012-02-15)
|
||||
* Added feature #45626: Update countries to level of ISO 3166-1:2006 - Newsletter VI-14 (2013-02-06)
|
||||
* Added feature #43009: Add federal states of croatia to static_country_zones
|
||||
* Fixed issue #45372: Update Åland Islands tdl
|
||||
* Added feature #45630: Update currencies in accordance with ISO 4217 Amendment Number 154
|
||||
* Fixed issue #35775: Remove redundant indexes
|
||||
* Fixed issue #40509: Wrong ISO codes for currency Serbian Dinar
|
||||
* Follow up to feature #45630: Update currencies in accordance with ISO 4217 Amendment Number 154
|
||||
* Update version to 2.3.2
|
||||
* Resolves #45681: Require TYPO3 4.7
|
||||
* Update version to 2.4
|
||||
* Resolves #45684: Add autoloading
|
||||
* Follow up to #45684: Add autoloading
|
||||
* Fixed issue #45686: Remove reference to static_info_tables_markets
|
||||
* Resolves #45688: Always keep tables utf-8-encoded
|
||||
* Resolves #45692: Move static template to Configuration directory
|
||||
* Resolves #45689: Convert locallang files to XLIFF
|
||||
|
||||
2013-02-19 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Update version to 2.3.1
|
||||
|
||||
2012-05-29 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fixed security issue [Ticket#2011101510000057] XSS in static_info_tables 2.3.0
|
||||
|
||||
2011-12-16 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fixed issue #32614: Errors in names of two provinces of Italy
|
||||
* Fixed issue #32094: Usage of deprecated testInt method (Thanks to Stefan Galinski)
|
||||
* Fixed issue #29241: NZ static currencies thousands decimal
|
||||
* Fixed issue #28830: cn_short_local for Czech Republic misses an accent mark
|
||||
* Added feature #32635: Update countries to level of ISO 3166-1:2006 - Newsletter VI-9 (2011-06-12)
|
||||
* Added feature #32636: Update countries to level of ISO 3166-1:2006 - Newsletter VI-10 (2011-08-09)
|
||||
* Added feature #32637: Update countries to level of ISO 3166-1:2006 - Newsletter VI-11 (2011-11-08)
|
||||
* Added feature #28104: Polish country zones (Thanks to Tomasz Krawczyk)
|
||||
* Fixed issue #27646: Territory of United Arab Emirates
|
||||
* Follow-up to feature #28104: Polish country zones
|
||||
* Fixed issue #13284: tx_staticinfotables_div::getCurrentLanguage should return 'EN' if language is 'default' (Thanks to Robert Heel)
|
||||
* Fixed issue #28483: tx_staticinfotables_div::getCurrentLanguage issues repetitive SQL queries (Thanks to Raphaël Riel)
|
||||
* Updated version to 2.3.0
|
||||
|
||||
2011-01-25 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Added feature #9423: Add country zones for the regions and departments of France
|
||||
* Fixed issue #12530: Erroneous country zone codes for Austria
|
||||
* Follow-up to issue #12530: Erroneous country zone codes for Austria (remove country code)
|
||||
* Follow-up to feature #9423: Add country zones for the regions and departments of France (remove country code)
|
||||
* Fixed bugtracker issue #6901: Remove DEFAULT '0' from uid fields sql definition
|
||||
* Fixed issue #12531: Remove reference to extension patch1822
|
||||
* Updated Manual
|
||||
* Added missing files in SVN
|
||||
* Fixed issue #12555: Removed db_layout configuration not supported on page 0
|
||||
* Updated version to 2.2
|
||||
|
||||
2011-01-24 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
|
||||
* Fixed issue #12506: Add missing languages and/or missing TYPO3 language codes (Albanian, Canadian French, Filipino, Georgian, Khmer, Serbian)
|
||||
* Fixed issue #12508: Update countries to level of ISO 3166-1:2006 - Newsletter VI-8 (2010-12-15)
|
||||
* Fixed issue #10897: Missing (non-existent) territory for some countries
|
||||
* Fixed bugtracker issue #8739: Swiss Currency Symbols are wrong
|
||||
|
||||
2010-04-29 Franz Holzinger <franz@ttproducts.de>
|
||||
|
||||
* new feature: countriesAllowed gives the ordered ISO-3 codes of the countries which are allowed in the select box.
|
||||
|
||||
2010-01-31 Franz Holzinger <franz@ttproducts.de>
|
||||
* fix bug in getTitleFromIsoCode: SQL error due to wrong starting AND in where statement
|
||||
* remove static_markets: New extension static_info_tables_markets
|
||||
* fix bug 10037: add Albacete to Spain
|
||||
* fix bug 10038: use TYPO3 internal language code if this exists instead of ISO code
|
||||
* fix bug 12854: getCurrentLanguage doesn't use FE language
|
||||
* fix bug 12145: static_info_tables, syntax errors in "ext_tables_static+adt.sql"
|
||||
* fix bug 0011739: Wrong abbreviations for german federal states
|
||||
* add Italian provinces
|
||||
* make Stanlislas Rolland <stanislas.rolland@sjbr.ca> the new maintainer of static_info_tables
|
||||
|
||||
2009-06-20 Franz Holzinger <franz@ttproducts.de>
|
||||
* Fix bug 2397: loadTcaAdditions
|
||||
* Add the field 'deleted' to static_countries because some countries like 'Serbia and Montenegro' have been divided.
|
||||
* This makes it possible to keep lost countries for historical reasons.
|
||||
* Add the new countries Serbia and Montenegro
|
||||
* Add Dutch country zones
|
||||
* fix the telephone precall number for some countries
|
||||
* make Romania and Bulgaria to EU countries
|
||||
|
||||
2008-11-03 Franz Holzinger <contact@fholzinger.com>
|
||||
* Fix bug 9351: Tennessee
|
||||
* fix getTitleFromIsoCode: empty where clause must be '1=1' to allow AND combinations
|
||||
* support for page module
|
||||
* fix bug 7930: return the resulting selected array in the methods buildStaticInfoSelector and optionsConstructor
|
||||
|
||||
2008-07-15 Franz Holzinger <contact@fholzinger.com>
|
||||
* Add the form tags to the UPDATE! function in EM for TYPO3 4.2.1
|
||||
* The versions 2.0.x are the last ones which will work under PHP 4.
|
||||
* Fix bug with PHP4: http://www.jambage.com/index.php?id=215&tt_board_uid=1621
|
||||
Remove the parameter $outSelectedArray again for PHP4. This will be back again in version 2.1.0.
|
||||
|
||||
2008-06-07 Franz Holzinger <contact@fholzinger.com>
|
||||
* fix bug 7930: return the resulting selected array in the methods buildStaticInfoSelector and optionsConstructor
|
||||
* new method needsInit which tells if the object has already been initialised
|
||||
* fix bug 8347: Vorarlberg is correct for VB in Austria
|
||||
* fix bug 8594: no default zone must be used if it does not fit to the default country
|
||||
|
||||
2008-04-26 Franz Holzinger <contact@fholzinger.com>
|
||||
* fix bug 7930: default values for country zones and currencies have been wrong
|
||||
* move static_taxes into a separate extension static_info_tables_taxes
|
||||
|
||||
2008-03-15 Franz Holzinger <contact@fholzinger.com>
|
||||
* fix bug 6059: Static_country_zones Canada wrong ISO-Nr
|
||||
* set default country to DEU and contry zone to NRW because most persons using TYPO3 live here
|
||||
* set default language to EN because most persons using TYPO3 understand English
|
||||
* add a $conf parameter to the init routine. Other extensions may override the setup now.
|
||||
* fix bug with not set default country
|
||||
* fix bug with not getting rid of the div extension
|
||||
* replace $TYPO3_CONF_VARS by $GLOBALS['TYPO3_CONF_VARS'] because some PHP5 versions loose its value
|
||||
|
||||
2007-12-16 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* remove dependancy from div extension
|
||||
* new feature charset: extension setup for the character set of the tables
|
||||
* fix bug with wrong '1 AND ...' SQL query with itemsProcFunc_config.hotlistOnly
|
||||
* change Galician language
|
||||
* fix bug 4589 with wrong SQL when no country code is available
|
||||
* new feature: mutliple countries and languages can be selected at once
|
||||
|
||||
2007-08-03 David Bruehlmeier <typo3@bruehlmeier.com>
|
||||
* Updated static_markets
|
||||
|
||||
2007-07-17 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* new function fetchCountries to get a list of countries which match the parameters
|
||||
|
||||
2007-06-19 David Bruehlmeier <typo3@bruehlmeier.com>
|
||||
* Updated static_markets
|
||||
|
||||
2007-06-16 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* support for custom where clauses with static_info_tables by Jeff Segars
|
||||
* fix bug #5616: hook function processDatamap_postProcessFieldArray must not use $this as parameter name
|
||||
|
||||
2007-05-22 David Bruehlmeier <typo3@bruehlmeier.com>
|
||||
* Updated static_markets
|
||||
|
||||
2007-05-16 David Bruehlmeier <typo3@bruehlmeier.com>
|
||||
* Added static_markets to $TYPO3_CONF_VARS['EXTCONF'][STATIC_INFO_TABLES_EXTkey]['tables']
|
||||
|
||||
2007-04-24 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* adapt manual for market places
|
||||
|
||||
2007-04-14 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* small modifications using constants
|
||||
|
||||
2007-04-03 David Bruehlmeier <typo3@bruehlmeier.com>
|
||||
* Fixed small bug in selectItemsTCA()
|
||||
* Added new table 'static_markets' (regulated by ISO 10383)
|
||||
|
||||
2007-01-13 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* fix bug with wrong SQL query with "SELECT static_countries.cn_iso_3, FROM ..."
|
||||
|
||||
2006-11-23 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* fix bug with wrong SQL query with "... AND static_country_zones.=''"
|
||||
|
||||
2006-10-31 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* change the param into an addWhere parameter where it is a WHERE clause
|
||||
|
||||
2006-10-11 Franz Holzinger <kontakt@fholzinger.com>
|
||||
* additional WHERE clauses to many functions in order to filter the lists
|
||||
* call function to load additional TCA to allow fields added from the language specific static_info_tables derivates
|
||||
|
||||
2006-09-09 Michael Stucki <michael@typo3.org>
|
||||
* Added a ChangeLog file
|
||||
* Initial SVN import, based on static_info_tables 2.0.0
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Cache;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Cache\CacheManager;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Cached classes autoloader
|
||||
*/
|
||||
class CachedClassLoader
|
||||
{
|
||||
/**
|
||||
* Extension key
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $extensionKey = 'static_info_tables';
|
||||
|
||||
/**
|
||||
* Cached class loader class name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $className = __CLASS__;
|
||||
|
||||
/**
|
||||
* Name space of the Domain Model of StaticInfoTables
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $namespace = 'SJBR\\StaticInfoTables\\Domain\\Model\\';
|
||||
|
||||
/**
|
||||
* The class loader is static, thus we do not allow instances of this class.
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the cached class loader
|
||||
*
|
||||
* @return bool TRUE in case of success
|
||||
*/
|
||||
public static function registerAutoloader()
|
||||
{
|
||||
return spl_autoload_register(static::$className . '::autoload', true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Autoload function for cached classes
|
||||
*
|
||||
* @param string $className Class name
|
||||
* @return void
|
||||
*/
|
||||
public static function autoload($className)
|
||||
{
|
||||
$className = ltrim($className, '\\');
|
||||
if (strpos($className, static::$namespace) !== false) {
|
||||
// Lookup the class in the array of static info entities and check its presence in the class cache
|
||||
$entities = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][static::$extensionKey]['entities'] ?? [];
|
||||
// ClassCacheManager instantiation creates the class cache if not already available
|
||||
$classCacheManager = GeneralUtility::makeInstance(ClassCacheManager::class);
|
||||
$cacheManager = GeneralUtility::makeInstance(CacheManager::class);
|
||||
$classCache = $cacheManager->getCache(static::$extensionKey);
|
||||
foreach ($entities as $entity) {
|
||||
if ($className === static::$namespace . $entity) {
|
||||
$entryIdentifier = 'DomainModel' . $entity;
|
||||
if (!$classCache->has($entryIdentifier)) {
|
||||
// The class cache needs to be rebuilt
|
||||
$classCacheManager->reBuild();
|
||||
}
|
||||
$classCache->requireOnce($entryIdentifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Cache;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
* (c) 2012 Georg Ringer <typo3@ringerge.org>
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Cache\Backend\FileBackend;
|
||||
use TYPO3\CMS\Core\Cache\CacheManager;
|
||||
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
|
||||
use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend;
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\ArrayUtility;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Class Cache Manager
|
||||
*/
|
||||
class ClassCacheManager implements SingletonInterface
|
||||
{
|
||||
/**
|
||||
* Extension key
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $extensionKey = 'static_info_tables';
|
||||
|
||||
/**
|
||||
* @var array Cache configurations
|
||||
*/
|
||||
protected $cacheConfiguration = [
|
||||
'static_info_tables' => [
|
||||
'frontend' => PhpFrontend::class,
|
||||
'backend' => FileBackend::class,
|
||||
'options' => [],
|
||||
'groups' => ['all'],
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Cache manager
|
||||
*
|
||||
* @var CacheManager
|
||||
*/
|
||||
private $cacheManager;
|
||||
|
||||
/**
|
||||
* @var FrontendInterface
|
||||
*/
|
||||
protected $cacheInstance;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct(CacheManager $cacheManager)
|
||||
{
|
||||
$this->cacheManager = $cacheManager;
|
||||
$this->initializeCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize cache instance to be ready to use
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function initializeCache()
|
||||
{
|
||||
if (!$this->cacheManager->hasCache($this->extensionKey)) {
|
||||
if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$this->extensionKey]) &&
|
||||
is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$this->extensionKey])) {
|
||||
ArrayUtility::mergeRecursiveWithOverrule($this->cacheConfiguration[$this->extensionKey], $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$this->extensionKey]);
|
||||
}
|
||||
$this->cacheManager->setCacheConfigurations($this->cacheConfiguration);
|
||||
}
|
||||
$this->cacheInstance = $this->cacheManager->getCache($this->extensionKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds and caches the proxy files
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
$extensibleExtensions = $this->getExtensibleExtensions();
|
||||
$entities = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$this->extensionKey]['entities'] ?? [];
|
||||
foreach ($entities as $entity) {
|
||||
$key = 'Domain/Model/' . $entity;
|
||||
|
||||
// Get the file from static_info_tables itself, this needs to be loaded as first
|
||||
$path = ExtensionManagementUtility::extPath($this->extensionKey) . 'Classes/' . $key . '.php';
|
||||
if (!is_file($path)) {
|
||||
throw new \Exception('given file "' . $path . '" does not exist');
|
||||
}
|
||||
$code = $this->parseSingleFile($path, false);
|
||||
|
||||
// Get the files from all other extensions that are extending this domain model class
|
||||
if (isset($extensibleExtensions[$key]) && is_array($extensibleExtensions[$key]) && count($extensibleExtensions[$key]) > 0) {
|
||||
$extensionsWithThisClass = array_keys($extensibleExtensions[$key]);
|
||||
foreach ($extensionsWithThisClass as $extension) {
|
||||
$path = ExtensionManagementUtility::extPath($extension) . 'Classes/' . $key . '.php';
|
||||
if (is_file($path)) {
|
||||
$code .= $this->parseSingleFile($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close the class definition and the php tag
|
||||
$code = $this->closeClassDefinition($code);
|
||||
|
||||
// The file is added to the class cache
|
||||
$entryIdentifier = str_replace('/', '', $key);
|
||||
try {
|
||||
$this->cacheInstance->set($entryIdentifier, $code);
|
||||
} catch (\Exception $e) {
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all loaded extensions which try to extend EXT:static_info_tables
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getExtensibleExtensions()
|
||||
{
|
||||
$loadedExtensions = array_unique(ExtensionManagementUtility::getLoadedExtensionListArray());
|
||||
|
||||
// Get the extensions which want to extend static_info_tables
|
||||
$extensibleExtensions = [];
|
||||
foreach ($loadedExtensions as $extensionKey) {
|
||||
$extensionInfoFile = ExtensionManagementUtility::extPath($extensionKey) . 'Configuration/DomainModelExtension/StaticInfoTables.txt';
|
||||
if (file_exists($extensionInfoFile)) {
|
||||
$info = GeneralUtility::getUrl($extensionInfoFile);
|
||||
$classes = GeneralUtility::trimExplode(LF, $info, true);
|
||||
foreach ($classes as $class) {
|
||||
$extensibleExtensions[$class][$extensionKey] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $extensibleExtensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a single file and does some magic
|
||||
* - Remove the php tags
|
||||
* - Remove the class definition (if set)
|
||||
*
|
||||
* @param string $filePath path of the file
|
||||
* @param bool $removeClassDefinition If class definition should be removed
|
||||
* @return string path of the saved file
|
||||
* @throws \Exception
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function parseSingleFile($filePath, $removeClassDefinition = true)
|
||||
{
|
||||
if (!is_file($filePath)) {
|
||||
throw new \InvalidArgumentException(sprintf('File "%s" could not be found', $filePath));
|
||||
}
|
||||
$code = GeneralUtility::getUrl($filePath);
|
||||
return $this->changeCode($code, $filePath, $removeClassDefinition);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @param string $filePath
|
||||
* @param bool $removeClassDefinition
|
||||
* @param bool $renderPartialInfo
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function changeCode($code, $filePath, $removeClassDefinition = true, $renderPartialInfo = true)
|
||||
{
|
||||
if (empty($code)) {
|
||||
throw new \InvalidArgumentException(sprintf('File "%s" could not be fetched or is empty', $filePath));
|
||||
}
|
||||
$code = trim($code);
|
||||
$code = str_replace(['<?php', '?>'], '', $code);
|
||||
$code = trim($code);
|
||||
|
||||
// Remove everything before 'class ', including namespaces,
|
||||
// comments and require-statements.
|
||||
if ($removeClassDefinition) {
|
||||
$pos = strpos($code, 'class ');
|
||||
$pos2 = strpos($code, '{', $pos);
|
||||
|
||||
$code = substr($code, $pos2 + 1);
|
||||
}
|
||||
|
||||
$code = trim($code);
|
||||
|
||||
// Add some information for each partial
|
||||
if ($renderPartialInfo) {
|
||||
$code = $this->getPartialInfo($filePath) . $code;
|
||||
}
|
||||
|
||||
// Remove last }
|
||||
$pos = strrpos($code, '}');
|
||||
$code = substr($code, 0, $pos);
|
||||
$code = trim($code);
|
||||
return $code . LF . LF;
|
||||
}
|
||||
|
||||
protected function getPartialInfo($filePath)
|
||||
{
|
||||
return '/*' . str_repeat('*', 70) . LF .
|
||||
' * this is partial from: ' . $filePath . LF . str_repeat('*', 70) . '*/' . LF . chr(9);
|
||||
}
|
||||
|
||||
protected function closeClassDefinition($code)
|
||||
{
|
||||
return $code . LF . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the class cache
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->cacheInstance->flush();
|
||||
if (isset($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->user)) {
|
||||
$GLOBALS['BE_USER']->writelog(3, 1, 0, 0, '[StaticInfoTables]: User %s has cleared the class cache', [$GLOBALS['BE_USER']->user['username']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild the class cache
|
||||
*
|
||||
* @param array $parameters
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function reBuild(array $parameters = [])
|
||||
{
|
||||
$isValidCall = (
|
||||
empty($parameters)
|
||||
|| (
|
||||
!empty($parameters['cacheCmd'])
|
||||
&& GeneralUtility::inList('all,temp_cached', $parameters['cacheCmd'])
|
||||
&& isset($GLOBALS['BE_USER'])
|
||||
)
|
||||
);
|
||||
if ($isValidCall) {
|
||||
$this->clear();
|
||||
$this->clearReflectionCache();
|
||||
$this->build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop the reflection cache
|
||||
*/
|
||||
protected function clearReflectionCache()
|
||||
{
|
||||
if ($this->cacheManager->hasCache('extbase_reflection')) {
|
||||
$this->cacheManager->getCache('extbase_reflection')->flush();
|
||||
}
|
||||
if ($this->cacheManager->hasCache('extbase_datamapfactory_datamap')) {
|
||||
$this->cacheManager->getCache('extbase_datamapfactory_datamap')->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace SJBR\StaticInfoTables\Configuration\Tca;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Manuel Selbach <manuel_selbach@yahoo.de>
|
||||
* (c) 2020-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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 text file 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
|
||||
class Provider
|
||||
{
|
||||
/**
|
||||
* @var string Path to language file of labels in the backend
|
||||
*/
|
||||
protected static $LL = 'LLL:EXT:%s/Resources/Private/Language/locallang_db.xlf:%s_item.%s';
|
||||
|
||||
/**
|
||||
* @param $additionalFields
|
||||
* @param $tableName
|
||||
* @return void
|
||||
*/
|
||||
public static function addTcaColumnConfiguration($extensionKey, $tableName, $additionalFields)
|
||||
{
|
||||
foreach ($additionalFields as $sourceField => $destField) {
|
||||
$additionalColumns = [];
|
||||
$additionalColumns[$destField] = $GLOBALS['TCA'][$tableName]['columns'][$sourceField] ?? [];
|
||||
$additionalColumns[$destField]['label'] = sprintf(
|
||||
static::$LL,
|
||||
$extensionKey,
|
||||
$tableName,
|
||||
$destField
|
||||
);
|
||||
ExtensionManagementUtility::addTCAcolumns($tableName, $additionalColumns);
|
||||
ExtensionManagementUtility::addToAllTCAtypes(
|
||||
$tableName,
|
||||
$destField,
|
||||
'',
|
||||
'after:' . $sourceField
|
||||
);
|
||||
// Add as search field
|
||||
$GLOBALS['TCA'][$tableName]['ctrl']['searchFields'] .= ',' . $destField;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Configuration\TypoScript;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use SJBR\StaticInfoTables\Utility\HtmlElementUtility;
|
||||
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
|
||||
/**
|
||||
* Class providing TypoScript configuration help for Static Info Tables
|
||||
*/
|
||||
class ConfigurationHelper
|
||||
{
|
||||
/**
|
||||
* Renders a select element to select an entity
|
||||
*
|
||||
* @param array $params: Field information to be rendered
|
||||
* @param \TYPO3\CMS\Core\TypoScript\ExtendedTemplateService $pObj: The calling parent object.
|
||||
* @param mixed $arg
|
||||
*
|
||||
* @return string The HTML input field
|
||||
*/
|
||||
public function buildEntitySelector(array $params, ExtendedTemplateService $pObj, $arg = '')
|
||||
{
|
||||
$field = '';
|
||||
switch ($params['fieldName'] ?? '') {
|
||||
case 'data[plugin.tx_staticinfotables_pi1.countryCode]':
|
||||
case 'data[plugin.tx_staticinfotables_pi1.countriesAllowed]':
|
||||
$repository = GeneralUtility::makeInstance(CountryRepository::class);
|
||||
$entities = $repository->findAllOrderedBy('nameLocalized');
|
||||
break;
|
||||
case 'data[plugin.tx_staticinfotables_pi1.countryZoneCode]':
|
||||
$repository = GeneralUtility::makeInstance(CountryZoneRepository::class);
|
||||
$countryCode = $this->getConfiguredCountryCode();
|
||||
if ($countryCode) {
|
||||
$countryRepository = GeneralUtility::makeInstance(CountryRepository::class);
|
||||
$country = $countryRepository->findOneByIsoCodeA3($countryCode);
|
||||
if (is_object($country)) {
|
||||
$entities = $repository->findByCountryOrderedByLocalizedName($country);
|
||||
}
|
||||
}
|
||||
if (!$countryCode || (empty($entities) && $params['fieldValue'])) {
|
||||
$entities = $repository->findAllOrderedBy('nameLocalized');
|
||||
}
|
||||
break;
|
||||
case 'data[plugin.tx_staticinfotables_pi1.currencyCode]':
|
||||
$repository = GeneralUtility::makeInstance(CurrencyRepository::class);
|
||||
$entities = $repository->findAllOrderedBy('nameLocalized');
|
||||
break;
|
||||
case 'data[plugin.tx_staticinfotables_pi1.languageCode]':
|
||||
$repository = GeneralUtility::makeInstance(LanguageRepository::class);
|
||||
$entities = $repository->findAllNonConstructedNonSacred();
|
||||
$entities = $repository->localizedSort($entities);
|
||||
break;
|
||||
}
|
||||
if (is_array($entities) && count($entities)) {
|
||||
$options = [];
|
||||
foreach ($entities as $entity) {
|
||||
switch ($params['fieldName'] ?? '') {
|
||||
case 'data[plugin.tx_staticinfotables_pi1.countryZoneCode]':
|
||||
$value = $entity->getIsoCode();
|
||||
$options[] = ['name' => $entity->getNameLocalized() . ' (' . $value . ')', 'value' => $value];
|
||||
break;
|
||||
case 'data[plugin.tx_staticinfotables_pi1.countryCode]':
|
||||
case 'data[plugin.tx_staticinfotables_pi1.countriesAllowed]':
|
||||
case 'data[plugin.tx_staticinfotables_pi1.currencyCode]':
|
||||
$value = $entity->getIsoCodeA3();
|
||||
$options[] = ['name' => $entity->getNameLocalized() . ' (' . $value . ')', 'value' => $value];
|
||||
break;
|
||||
case 'data[plugin.tx_staticinfotables_pi1.languageCode]':
|
||||
$countryCode = $entity->getCountryIsoCodeA2();
|
||||
$value = $entity->getIsoCodeA2() . ($countryCode ? '_' . $countryCode : '');
|
||||
$options[] = ['name' => $entity->getNameLocalized() . ' (' . $value . ')', 'value' => $value];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$outSelected = [];
|
||||
$size = $params['fieldName'] == 'data[plugin.tx_staticinfotables_pi1.countriesAllowed]' ? 5 : 1;
|
||||
$field = HtmlElementUtility::selectConstructor($options, [$params['fieldValue']], $outSelected, $params['fieldName'], '', '', '', '', $size);
|
||||
}
|
||||
return $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the configured default country code
|
||||
*
|
||||
* @return string The configured default country code
|
||||
*/
|
||||
protected function getConfiguredCountryCode()
|
||||
{
|
||||
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
|
||||
$settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
|
||||
return $settings['plugin.']['tx_staticinfotables_pi1.']['countryCode'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Controller;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Country;
|
||||
use SJBR\StaticInfoTables\Domain\Model\CountryZone;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Language;
|
||||
use SJBR\StaticInfoTables\Domain\Model\LanguagePack;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguagePackRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository;
|
||||
use SJBR\StaticInfoTables\Utility\LocaleUtility;
|
||||
use TYPO3\CMS\Core\Localization\Locales;
|
||||
use TYPO3\CMS\Core\Messaging\AbstractMessage;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
/**
|
||||
* Static Info Tables Manager controller
|
||||
*/
|
||||
class ManagerController extends ActionController
|
||||
{
|
||||
/**
|
||||
* @var string Name of the extension this controller belongs to
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* @var CountryRepository
|
||||
*/
|
||||
protected $countryRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Country Repository
|
||||
*
|
||||
* @param CountryRepository $countryRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectCountryRepository(CountryRepository $countryRepository)
|
||||
{
|
||||
$this->countryRepository = $countryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var CountryZoneRepository
|
||||
*/
|
||||
protected $countryZoneRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Country Zone Repository
|
||||
*
|
||||
* @param CountryZoneRepository $countryZoneRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectCountryZoneRepository(CountryZoneRepository $countryZoneRepository)
|
||||
{
|
||||
$this->countryZoneRepository = $countryZoneRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var CurrencyRepository
|
||||
*/
|
||||
protected $currencyRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Currency Repository
|
||||
*
|
||||
* @param CurrencyRepository $currencyRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectCurrencyRepository(CurrencyRepository $currencyRepository)
|
||||
{
|
||||
$this->currencyRepository = $currencyRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var LanguageRepository
|
||||
*/
|
||||
protected $languageRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Language Repository
|
||||
*
|
||||
* @param LanguageRepository $languageRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectLanguageRepository(LanguageRepository $languageRepository)
|
||||
{
|
||||
$this->languageRepository = $languageRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TerritoryRepository
|
||||
*/
|
||||
protected $territoryRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Territory Repository
|
||||
*
|
||||
* @param TerritoryRepository $territoryRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectTerritoryRepository(TerritoryRepository $territoryRepository)
|
||||
{
|
||||
$this->territoryRepository = $territoryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display general information
|
||||
*/
|
||||
public function informationAction()
|
||||
{
|
||||
$this->view->assign(
|
||||
'actions',
|
||||
[
|
||||
[
|
||||
'code' => 'newLanguagePack',
|
||||
'title' => 'createLanguagePackTitle',
|
||||
'description' => 'createLanguagePackDescription',
|
||||
],
|
||||
[
|
||||
'code' => 'testForm',
|
||||
'title' => 'testFormTitle',
|
||||
'description' => 'testFormDescription',
|
||||
],
|
||||
[
|
||||
'code' => 'sqlDumpNonLocalizedData',
|
||||
'title' => 'sqlDumpNonLocalizedDataTitle',
|
||||
'description' => 'sqlDumpNonLocalizedDataDescription',
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the language pack creation form
|
||||
*
|
||||
* @param LanguagePack $languagePack
|
||||
*/
|
||||
public function newLanguagePackAction(LanguagePack $languagePack = null)
|
||||
{
|
||||
if (!is_object($languagePack)) {
|
||||
$languagePack = new LanguagePack();
|
||||
}
|
||||
$languagePack->setVersion($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName)]['version']);
|
||||
$languagePack->setAuthor($GLOBALS['BE_USER']->user['realName']);
|
||||
$languagePack->setAuthorEmail($GLOBALS['BE_USER']->user['email']);
|
||||
$localeUtility = GeneralUtility::makeInstance(LocaleUtility::class);
|
||||
$this->view->assign('locales', $localeUtility->getLocales());
|
||||
$this->view->assign('languagePack', $languagePack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation/update a language pack for the Static Info Tables
|
||||
*
|
||||
* @param LanguagePack $languagePack
|
||||
*/
|
||||
public function createLanguagePackAction(LanguagePack $languagePack)
|
||||
{
|
||||
// Add the localization columns
|
||||
$locale = $languagePack->getLocale();
|
||||
// Get the English name of the locale
|
||||
$localeUtility = new LocaleUtility();
|
||||
$language = $localeUtility->getLanguageFromLocale($locale);
|
||||
$languagePack->setLanguage($language);
|
||||
$languagePack->setTypo3VersionRange($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName)]['constraints']['depends']['typo3']);
|
||||
// If version is not set, use the version of the base extension
|
||||
if (!$languagePack->getVersion()) {
|
||||
$languagePack->setVersion($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName)]['version']);
|
||||
}
|
||||
$this->countryRepository->addLocalizationColumns($locale);
|
||||
$this->countryZoneRepository->addLocalizationColumns($locale);
|
||||
$this->currencyRepository->addLocalizationColumns($locale);
|
||||
$this->languageRepository->addLocalizationColumns($locale);
|
||||
$this->territoryRepository->addLocalizationColumns($locale);
|
||||
// Store the Language Pack
|
||||
$languagePackRepository = GeneralUtility::makeInstance(LanguagePackRepository::class);
|
||||
$messages = $languagePackRepository->writeLanguagePack($languagePack);
|
||||
if (count($messages)) {
|
||||
foreach ($messages as $message) {
|
||||
$this->addFlashMessage($message, '', AbstractMessage::OK);
|
||||
}
|
||||
}
|
||||
$this->forward('information');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a test form
|
||||
*
|
||||
* @param Country $country
|
||||
* @param CountryZone $countryZone
|
||||
* @param Language $language
|
||||
*/
|
||||
public function testFormAction(Country $country = null, CountryZone $countryZone = null, Language $language = null)
|
||||
{
|
||||
if (is_object($country) && (is_object($countryZone) || !$country->getCountryZones()->count())) {
|
||||
$this->forward('testFormResult', 'Manager', $this->extensionName, ['country' => $country, 'countryZone' => $countryZone, 'language' => $language]);
|
||||
}
|
||||
if (is_object($country)) {
|
||||
$this->view->assign('selectedCountry', $country);
|
||||
}
|
||||
if (is_object($countryZone)) {
|
||||
$this->view->assign('selectedCountryZone', $countryZone);
|
||||
}
|
||||
if (is_object($language)) {
|
||||
$this->view->assign('selectedLanguage', $language);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the test form result
|
||||
*
|
||||
* @param Country $country
|
||||
* @param CountryZone $countryZone
|
||||
* @param Language $language
|
||||
*/
|
||||
public function testFormResultAction(Country $country = null, CountryZone $countryZone = null, Language $language = null)
|
||||
{
|
||||
$this->view->assign('country', $country);
|
||||
$currencies = $this->currencyRepository->findByCountry($country);
|
||||
if ($currencies->count()) {
|
||||
$this->view->assign('currency', $currencies[0]);
|
||||
}
|
||||
if (is_object($countryZone)) {
|
||||
$this->view->assign('countryZone', $countryZone);
|
||||
}
|
||||
$this->view->assign('language', $language);
|
||||
$territories = $this->territoryRepository->findByCountry($country);
|
||||
if ($territories->count()) {
|
||||
$this->view->assign('territory', $territories[0]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation/update a language pack for the Static Info Tables
|
||||
*/
|
||||
public function sqlDumpNonLocalizedDataAction()
|
||||
{
|
||||
// Create a SQL dump of non-localized data
|
||||
$dumpContent = [];
|
||||
$dumpContent[] = $this->countryRepository->sqlDumpNonLocalizedData();
|
||||
$dumpContent[] = $this->countryZoneRepository->sqlDumpNonLocalizedData();
|
||||
$dumpContent[] = $this->currencyRepository->sqlDumpNonLocalizedData();
|
||||
$dumpContent[] = $this->languageRepository->sqlDumpNonLocalizedData();
|
||||
$dumpContent[] = $this->territoryRepository->sqlDumpNonLocalizedData();
|
||||
// Write the SQL dump file
|
||||
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName);
|
||||
$extensionPath = ExtensionManagementUtility::extPath($extensionKey);
|
||||
$filename = 'export-ext_tables_static+adt.sql';
|
||||
GeneralUtility::writeFile($extensionPath . $filename, implode(LF, $dumpContent));
|
||||
$message = LocalizationUtility::translate('sqlDumpCreated', $this->extensionName) . ' ' . $extensionPath . $filename;
|
||||
$this->addFlashMessage($message, '', AbstractMessage::OK);
|
||||
$this->forward('information');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the typo3-supported locale options for the language pack creation
|
||||
*
|
||||
* @return array An array of language objects
|
||||
*/
|
||||
protected function getLocales()
|
||||
{
|
||||
$localeArray = [];
|
||||
$locales = GeneralUtility::makeInstance(Locales::class);
|
||||
$languages = $locales->getLanguages();
|
||||
foreach ($languages as $locale => $language) {
|
||||
// No language pack for English
|
||||
if ($locale != 'default') {
|
||||
$languageObject = new Language();
|
||||
$languageObject->setCollatingLocale($locale);
|
||||
$localizedLanguage = LocalizationUtility::translate('lang_' . $locale, 'Lang');
|
||||
$label = ($localizedLanguage ? $localizedLanguage : $language) . ' (' . $locale . ')';
|
||||
$languageObject->setNameEn($label);
|
||||
$localeArray[$label] = $languageObject;
|
||||
}
|
||||
}
|
||||
ksort($localeArray);
|
||||
return $localeArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get language name from locale
|
||||
*
|
||||
* @param string $locale
|
||||
* @return string Language name
|
||||
*/
|
||||
protected function getLanguageFromLocale($locale)
|
||||
{
|
||||
$locales = GeneralUtility::makeInstance(Locales::class);
|
||||
$languages = $locales->getLanguages();
|
||||
$language = $languages[$locale];
|
||||
return $language . ' (' . $locale . ')';
|
||||
}
|
||||
|
||||
protected function getErrorFlashMessage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap;
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
|
||||
|
||||
/**
|
||||
* Abstract model for static entities
|
||||
*/
|
||||
class AbstractEntity extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var DataMapper
|
||||
*/
|
||||
protected $dataMapper;
|
||||
|
||||
/**
|
||||
* Name of the table from persistence mapping of this model
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tableName = '';
|
||||
|
||||
/**
|
||||
* On initialization, get the columns mapping configuration
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
$this->dataMapper = GeneralUtility::makeInstance(DataMapper::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Localized name of the entity
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameLocalized = '';
|
||||
|
||||
/**
|
||||
* Sets the localized name of the entity
|
||||
*
|
||||
* @param string $nameLocalized
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNameLocalized($nameLocalized)
|
||||
{
|
||||
$this->nameLocalized = $nameLocalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the localized name of the entity
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameLocalized()
|
||||
{
|
||||
$language = LocalizationUtility::getCurrentLanguage();
|
||||
$labelFields = LocalizationUtility::getLabelFields($this->tableName, $language);
|
||||
foreach ($labelFields as $labelField => $map) {
|
||||
if ($this->_hasProperty($map['mapOnProperty'] ?? '')) {
|
||||
$value = $this->_getProperty($map['mapOnProperty'] ?? '');
|
||||
if ($value) {
|
||||
$this->nameLocalized = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->nameLocalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTableName()
|
||||
{
|
||||
return $this->tableName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,617 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\CountryZone;
|
||||
use TYPO3\CMS\Extbase\Annotation\ORM\Lazy;
|
||||
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
||||
|
||||
/**
|
||||
* The Country model
|
||||
*/
|
||||
class Country extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $addressFormat = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $capitalCity = '';
|
||||
|
||||
/**
|
||||
* Country zones of this country
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SJBR\StaticInfoTables\Domain\Model\CountryZone>
|
||||
* @Lazy
|
||||
*/
|
||||
protected $countryZones;
|
||||
|
||||
/**
|
||||
* Currency code as number (i.e. 978)
|
||||
* ISO 4217 Nr Currency code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $currencyIsoCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* Currency code as three digit string (i.e. EUR)
|
||||
* ISO 4217 A3 Currency code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $currencyIsoCodeA3 = '';
|
||||
|
||||
/**
|
||||
* Deletion status of the object
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $deleted = false;
|
||||
|
||||
/**
|
||||
* Whether or not the country is a member of the European Union
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $euMember = false;
|
||||
|
||||
/**
|
||||
* Country code as two digit string (i.e. AT)
|
||||
* ISO 3166-1 A2 Country code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $isoCodeA2 = '';
|
||||
|
||||
/**
|
||||
* Country code as three digit string (i.e. AUT)
|
||||
* ISO 3166-1 A3 Country code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $isoCodeA3 = '';
|
||||
|
||||
/**
|
||||
* Country code as number (i.e. 40)
|
||||
* ISO 3166-1 Nr Country code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $isoCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* The official name of the country in English
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $officialNameEn = '';
|
||||
|
||||
/**
|
||||
* The official name of the country in local language and local script
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $officialNameLocal = '';
|
||||
|
||||
/**
|
||||
* UN number of territory in which the country is located
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $parentTerritoryUnCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* The international phone prefix for the country
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $phonePrefix = 0;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $shortNameEn = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $shortNameLocal = '';
|
||||
|
||||
/**
|
||||
* Whether the country is a member of the UNO or not
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $unMember = false;
|
||||
|
||||
/**
|
||||
* The Internet top level domain of the country
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $topLevelDomain = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $zoneFlag = false;
|
||||
|
||||
/**
|
||||
* On initialization, get the columns mapping configuration
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
parent::initializeObject();
|
||||
$this->tableName = $this->dataMapper->getDataMap(self::class)->getTableName();
|
||||
$this->countryZones = new ObjectStorage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the address format.
|
||||
*
|
||||
* @param string $addressFormat
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setAddressFormat($addressFormat)
|
||||
{
|
||||
$this->addressFormat = $addressFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the address format.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAddressFormat()
|
||||
{
|
||||
return $this->addressFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of the capital city
|
||||
*
|
||||
* @param string $capitalCity
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCapitalCity($capitalCity)
|
||||
{
|
||||
$this->capitalCity = $capitalCity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the capital city
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCapitalCity()
|
||||
{
|
||||
return $this->capitalCity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO A3 currency code.
|
||||
*
|
||||
* @param string $currencyIsoCodeA3
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyIsoCodeA3($currencyIsoCodeA3)
|
||||
{
|
||||
$this->currencyIsoCodeA3 = $currencyIsoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO A3 currency code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrencyIsoCodeA3()
|
||||
{
|
||||
return $this->currencyIsoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO numeric currency code
|
||||
*
|
||||
* @param int $currencyIsoCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCurrencyIsoCodeNumber($currencyIsoCodeNumber)
|
||||
{
|
||||
$this->currencyIsoCodeNumber = $currencyIsoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO numeric currency code
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCurrencyIsoCodeNumber()
|
||||
{
|
||||
return $this->currencyIsoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this country is a member of the European Union.
|
||||
*
|
||||
* @param bool $euMember
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setEuMember($euMember)
|
||||
{
|
||||
$this->euMember = $euMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deletion status of the entity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDeleted()
|
||||
{
|
||||
return $this->deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deletion status of the entity
|
||||
*
|
||||
* @param bool $deleted
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDeleted($deleted)
|
||||
{
|
||||
$this->deleted = $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this country is a member of the European Union.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getEuMember()
|
||||
{
|
||||
return $this->euMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this country is a member of the European Union.
|
||||
*
|
||||
* This method is a synonym for the getEuMember method.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isEuMember()
|
||||
{
|
||||
return $this->getEuMember();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO alpha-2 code.
|
||||
*
|
||||
* @param string $isoCodeA2
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCodeA2($isoCodeA2)
|
||||
{
|
||||
$this->isoCodeA2 = $isoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO alpha-2 code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIsoCodeA2()
|
||||
{
|
||||
return $this->isoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO alpha-3 code.
|
||||
*
|
||||
* @param string $isoCodeA3
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCodeA3($isoCodeA3)
|
||||
{
|
||||
$this->isoCodeA3 = $isoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO alpha-3 code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIsoCodeA3()
|
||||
{
|
||||
return $this->isoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO code number.
|
||||
*
|
||||
* @param int $isoCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCodeNumber($isoCodeNumber)
|
||||
{
|
||||
$this->isoCodeNumber = $isoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO code number.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getIsoCodeNumber()
|
||||
{
|
||||
return $this->isoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the official name of the country in English
|
||||
*
|
||||
* @param string $officialNameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setOfficialNameEn($officialNameEn)
|
||||
{
|
||||
$this->officialNameEn = $officialNameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the official name of the country in English
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOfficialNameEn()
|
||||
{
|
||||
return $this->officialNameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the official name of the country in local language and script
|
||||
*
|
||||
* @param string $officialNameLocal
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setOfficialNameLocal($officialNameLocal)
|
||||
{
|
||||
$this->officialNameLocal = $officialNameLocal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the official name of the country in local language and script
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOfficialNameLocal()
|
||||
{
|
||||
return $this->officialNameLocal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parent territory UN numeric code.
|
||||
*
|
||||
* @param int $parentTerritoryUnCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setParentTerritoryUnCodeNumber($parentTerritoryUnCodeNumber)
|
||||
{
|
||||
$this->parentTerritoryUnCodeNumber = $parentTerritoryUnCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parent territory UN numeric code.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getParentTerritoryUnCodeNumber()
|
||||
{
|
||||
return $this->parentTerritoryUnCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the phone prefix.
|
||||
*
|
||||
* @param int $phonePrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPhonePrefix($phonePrefix)
|
||||
{
|
||||
$this->phonePrefix = $phonePrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the phone prefix.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPhonePrefix()
|
||||
{
|
||||
return $this->phonePrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the English short name.
|
||||
*
|
||||
* @param string $shortNameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setShortNameEn($shortNameEn)
|
||||
{
|
||||
$this->shortNameEn = $shortNameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the English short name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortNameEn()
|
||||
{
|
||||
return $this->shortNameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the short local name.
|
||||
*
|
||||
* @param string $shortNameLocal
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setShortNameLocal($shortNameLocal)
|
||||
{
|
||||
$this->shortNameLocal = $shortNameLocal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the short local name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortNameLocal()
|
||||
{
|
||||
return $this->shortNameLocal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the top-level domain.
|
||||
*
|
||||
* @param string $topLevelDomain
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setTopLevelDomain($topLevelDomain)
|
||||
{
|
||||
$this->topLevelDomain = $topLevelDomain;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the top-level domain.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTopLevelDomain()
|
||||
{
|
||||
return $this->topLevelDomain;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this country is a member of the United Nations.
|
||||
*
|
||||
* @param bool $unMember
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnMember($unMember)
|
||||
{
|
||||
$this->unMember = $unMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this country is a member of the United Nations.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUnMember()
|
||||
{
|
||||
return $this->unMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this country is a member of the United Nations.
|
||||
*
|
||||
* This method is a synonym for the getUnMember method.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isUnMember()
|
||||
{
|
||||
return $this->getUnMember();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the zone flag.
|
||||
*
|
||||
* @param bool $zoneFlag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setZoneFlag($zoneFlag)
|
||||
{
|
||||
$this->zoneFlag = $zoneFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the zone flag.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getZoneFlag()
|
||||
{
|
||||
return $this->zoneFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the country zones
|
||||
*
|
||||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SJBR\StaticInfoTables\Domain\Model\CountryZone> $countryZones
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCountryZones($countryZones)
|
||||
{
|
||||
$this->countryZones = $countryZones;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the country zones
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SJBR\StaticInfoTables\Domain\Model\CountryZone> $countryZones
|
||||
*/
|
||||
public function getCountryZones()
|
||||
{
|
||||
return $this->countryZones;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Country Zone model
|
||||
*
|
||||
* @copyright Copyright belongs to the respective authors
|
||||
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
|
||||
*/
|
||||
|
||||
class CountryZone extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* Country code as two digit string (i.e. AT)
|
||||
* ISO 3166-1 A2 Country code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $countryIsoCodeA2 = '';
|
||||
|
||||
/**
|
||||
* Country code as three digit string (i.e. AUT)
|
||||
* ISO 3166-1 A3 Country code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $countryIsoCodeA3 = '';
|
||||
|
||||
/**
|
||||
* Country code as number (i.e. 40)
|
||||
* ISO 3166-1 Nr Country code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $countryIsoCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* Deletion status of the object
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $deleted = false;
|
||||
|
||||
/**
|
||||
* Country zone code as string
|
||||
* ISO 3166-2 Country Zone code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $isoCode = '';
|
||||
|
||||
/**
|
||||
* Local name of the country zone
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $localName = '';
|
||||
|
||||
/**
|
||||
* English name of the country zone
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameEn = '';
|
||||
|
||||
/**
|
||||
* On initialization, get the columns mapping configuration
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
parent::initializeObject();
|
||||
$this->tableName = $this->dataMapper->getDataMap(self::class)->getTableName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the country ISO alpha-2 code.
|
||||
*
|
||||
* @param string $countryIsoCodeA2
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCountryIsoCodeA2($countryIsoCodeA2)
|
||||
{
|
||||
$this->countryIsoCodeA2 = $countryIsoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the country ISO alpha-2 code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryIsoCodeA2()
|
||||
{
|
||||
return $this->countryIsoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the country ISO alpha-3 code.
|
||||
*
|
||||
* @param string $countryIsoCodeA3
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCountryIsoCodeA3($countryIsoCodeA3)
|
||||
{
|
||||
$this->countryIsoCodeA3 = $countryIsoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the country ISO alpha-3 code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryIsoCodeA3()
|
||||
{
|
||||
return $this->countryIsoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the country numeric ISO code
|
||||
*
|
||||
* @param int $countryIsoCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCountryIsoCodeNumber($countryIsoCodeNumber)
|
||||
{
|
||||
$this->countryIsoCodeNumber = $countryIsoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the country numeric ISO code
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCountryIsoCodeNumber()
|
||||
{
|
||||
return $this->countryIsoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deletion status of the entity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDeleted()
|
||||
{
|
||||
return $this->deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deletion status of the entity
|
||||
*
|
||||
* @param bool $deleted
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDeleted($deleted)
|
||||
{
|
||||
return $this->deleted = $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the country zone ISO code.
|
||||
*
|
||||
* @param string $isoCode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCode($isoCode)
|
||||
{
|
||||
$this->isoCode = $isoCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the country zone ISO code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIsoCode()
|
||||
{
|
||||
return $this->isoCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the local name.
|
||||
*
|
||||
* @param string $localName
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setLocalName($localName)
|
||||
{
|
||||
$this->localName = $localName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the local name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocalName()
|
||||
{
|
||||
return $this->localName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the English name.
|
||||
*
|
||||
* @param string $nameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNameEn($nameEn)
|
||||
{
|
||||
$this->nameEn = $nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns English name. If empty returns the localName.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameEn()
|
||||
{
|
||||
if ($this->nameEn === '') {
|
||||
return $this->getLocalName();
|
||||
}
|
||||
return $this->nameEn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Currency model
|
||||
*
|
||||
* @copyright Copyright belongs to the respective authors
|
||||
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
|
||||
*/
|
||||
|
||||
class Currency extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* The number of decimals to be shown when an amount is presented in this currency
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $decimalDigits = 0;
|
||||
|
||||
/**
|
||||
* The character to be shown in front of the decimals when an amount is presented in this currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $decimalPoint = '';
|
||||
|
||||
/**
|
||||
* Deletion status of the object
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $deleted = false;
|
||||
|
||||
/**
|
||||
* The divisor used to obtain the subdivision of the currency
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $divisor = 0;
|
||||
|
||||
/**
|
||||
* Currency code as three digit string (i.e. EUR)
|
||||
* ISO 4217 alpha-3 currency code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $isoCodeA3 = '';
|
||||
|
||||
/**
|
||||
* Currency code as number
|
||||
* ISO 4217 numeric currency code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $isoCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* English name of the currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameEn = '';
|
||||
|
||||
/**
|
||||
* English name of the currency subdivision unit
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $subdivisionNameEn = '';
|
||||
|
||||
/**
|
||||
* The symbol to be shown to the left of an amount stated in units of the subdivision of the currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $subdivisionSymbolLeft = '';
|
||||
|
||||
/**
|
||||
* The symbol to be shown to the right of an amount stated in units of the subdivision of the currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $subdivisionSymbolRight = '';
|
||||
|
||||
/**
|
||||
* The symbol to be shown to the left of an amount stated in units of the currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $symbolLeft = '';
|
||||
|
||||
/**
|
||||
* The symbol to be shown to the right of an amount stated in units of the currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $symbolRight = '';
|
||||
|
||||
/**
|
||||
* Character to be used between every group of thousands of an amount stated in units of this currency
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $thousandsPoint = '';
|
||||
|
||||
/**
|
||||
* On initialization, get the columns mapping configuration
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
parent::initializeObject();
|
||||
$this->tableName = $this->dataMapper->getDataMap(self::class)->getTableName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the number of decimal digits.
|
||||
*
|
||||
* @param int $decimalDigits
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDecimalDigits($decimalDigits)
|
||||
{
|
||||
$this->decimalDigits = $decimalDigits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of decimal digits.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDecimalDigits()
|
||||
{
|
||||
return $this->decimalDigits;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the decimal point character
|
||||
*
|
||||
* @param string $decimalPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDecimalPoint($decimalPoint)
|
||||
{
|
||||
$this->decimalPoint = $decimalPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the decimal point character
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDecimalPoint()
|
||||
{
|
||||
return $this->decimalPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deletion status of the entity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDeleted()
|
||||
{
|
||||
return $this->deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deletion status of the entity
|
||||
*
|
||||
* @param bool $deleted
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDeleted($deleted)
|
||||
{
|
||||
return $this->deleted = $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the divisor.
|
||||
*
|
||||
* @param int $divisor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDivisor($divisor)
|
||||
{
|
||||
$this->divisor = $divisor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the divisor.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDivisor()
|
||||
{
|
||||
return $this->divisor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO alpha-3 code.
|
||||
*
|
||||
* @param string $isoCodeA3
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCodeA3($isoCodeA3)
|
||||
{
|
||||
$this->isoCodeA3 = $isoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO alpha-3 code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIsoCodeA3()
|
||||
{
|
||||
return $this->isoCodeA3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO code number.
|
||||
*
|
||||
* @param int $isoCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCodeNumber($isoCodeNumber)
|
||||
{
|
||||
$this->isoCodeNumber = $isoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO code number.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getIsoCodeNumber()
|
||||
{
|
||||
return $this->isoCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the English name of the currency
|
||||
*
|
||||
* @param string $nameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNameEn($nameEn)
|
||||
{
|
||||
$this->nameEn = $nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the English name of the currency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameEn()
|
||||
{
|
||||
return $this->nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the English name of the currency subdivision
|
||||
*
|
||||
* @param string $subdivisionNameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSubdivisionNameEn($subdivisionNameEn)
|
||||
{
|
||||
$this->subdivisionNameEn = $subdivisionNameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the English name of the currency subdivision
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubdivisionNameEn()
|
||||
{
|
||||
return $this->subdivisionNameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the left-hand side symbol for an amount stated in units of the subdivision of the currency
|
||||
*
|
||||
* @param string $subdivisionSymbolLeft
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSubdivisionSymbolLeft($subdivisionSymbolLeft)
|
||||
{
|
||||
$this->subdivisionSymbolLeft = $subdivisionSymbolLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the left-hand side symbol for an amount stated in units of the subdivision of the currency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubdivisionSymbolLeft()
|
||||
{
|
||||
return $this->subdivisionSymbolLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the right-hand side symbol for an amount stated in units of the subdivision of the currency
|
||||
*
|
||||
* @param string $subdivisionSymbolRight
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSubdivisionSymbolRight($subdivisionSymbolRight)
|
||||
{
|
||||
$this->subdivisionSymbolRight = $subdivisionSymbolRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the right-hand side symbol for an amount stated in units of the subdivision of the currency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubdivisionSymbolRight()
|
||||
{
|
||||
return $this->subdivisionSymbolRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the symbol to be shown to the left of an amount stated in units of the currency
|
||||
*
|
||||
* @param string $symbolLeft
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSymbolLeft($symbolLeft)
|
||||
{
|
||||
$this->symbolLeft = $symbolLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the symbol to be shown to the left of an amount stated in units of the currency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSymbolLeft()
|
||||
{
|
||||
return $this->symbolLeft;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the symbol to be shown to the right of an amount stated in units of the currency
|
||||
*
|
||||
* @param string $symbolRight
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSymbolRight($symbolRight)
|
||||
{
|
||||
$this->symbolRight = $symbolRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the symbol to be shown to the right of an amount stated in units of the currency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSymbolRight()
|
||||
{
|
||||
return $this->symbolRight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the thousands point/separator.
|
||||
*
|
||||
* @param string $thousandsPoint
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setThousandsPoint($thousandsPoint)
|
||||
{
|
||||
$this->thousandsPoint = $thousandsPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the thousands point/separator.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getThousandsPoint()
|
||||
{
|
||||
return $this->thousandsPoint;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Language model
|
||||
*
|
||||
* @copyright Copyright belongs to the respective authors
|
||||
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
|
||||
*/
|
||||
|
||||
class Language extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $collatingLocale = '';
|
||||
|
||||
/**
|
||||
* Country code as two digit string (i.e. AT)
|
||||
* Identifies this language as a variant of the language identified by the ISO 639-1 A2 Language code
|
||||
* See also RFC 4646
|
||||
* ISO 3166-1 A2 Country code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $countryIsoCodeA2 = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $constructedLanguage = false;
|
||||
|
||||
/**
|
||||
* Deletion status of the object
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $deleted = false;
|
||||
|
||||
/**
|
||||
* ISO 639-1 A2 Language code
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $isoCodeA2 = '';
|
||||
|
||||
/**
|
||||
* Local name: name of language in the language itself
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $localName = '';
|
||||
|
||||
/**
|
||||
* English name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameEn = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $sacredLanguage = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $typo3Code = '';
|
||||
|
||||
/**
|
||||
* On initialization, get the columns mapping configuration
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
parent::initializeObject();
|
||||
$this->tableName = $this->dataMapper->getDataMap(self::class)->getTableName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the collating locale.
|
||||
*
|
||||
* @param string $collatingLocale
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCollatingLocale($collatingLocale)
|
||||
{
|
||||
$this->collatingLocale = $collatingLocale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the collating locale.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCollatingLocale()
|
||||
{
|
||||
return $this->collatingLocale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO 3166-1 A2 Country code
|
||||
*
|
||||
* @param string $countryIsoCodeA2
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCountryIsoCodeA2($countryIsoCodeA2)
|
||||
{
|
||||
$this->countryIsoCodeA2 = $countryIsoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO 3166-1 A2 Country code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCountryIsoCodeA2()
|
||||
{
|
||||
return $this->countryIsoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this is a constructed language.
|
||||
*
|
||||
* @param bool $constructedLanguage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setConstructedLanguage($constructedLanguage)
|
||||
{
|
||||
$this->constructedLanguage = $constructedLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this is a constructed language.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getConstructedLanguage()
|
||||
{
|
||||
return $this->constructedLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this is a constructed language.
|
||||
*
|
||||
* This method is a synonym for the getConstructedLanguage method.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isConstructedLanguage()
|
||||
{
|
||||
return $this->getConstructedLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deletion status of the entity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDeleted()
|
||||
{
|
||||
return $this->deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deletion status of the entity
|
||||
*
|
||||
* @param bool $deleted
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDeleted($deleted)
|
||||
{
|
||||
return $this->deleted = $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO 639-1 A2 Language code
|
||||
*
|
||||
* @param string $isoCodeA2
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoCodeA2($isoCodeA2)
|
||||
{
|
||||
$this->isoCodeA2 = $isoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO 639-1 A2 Language code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIsoCodeA2()
|
||||
{
|
||||
return $this->isoCodeA2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the local name.
|
||||
*
|
||||
* @param string $localName
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setLocalName($localName)
|
||||
{
|
||||
$this->localName = $localName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the local name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocalName()
|
||||
{
|
||||
return $this->localName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the English name
|
||||
*
|
||||
* @param string $nameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNameEn($nameEn)
|
||||
{
|
||||
$this->nameEn = $nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the English name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameEn()
|
||||
{
|
||||
return $this->nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this is a sacred language.
|
||||
*
|
||||
* @param bool $sacredLanguage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSacredLanguage($sacredLanguage)
|
||||
{
|
||||
$this->sacredLanguage = $sacredLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether this is a sacred language.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSacredLanguage()
|
||||
{
|
||||
return $this->sacredLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this is a sacred language.
|
||||
*
|
||||
* This method is a synonym for the getSacredLanguage method.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSacredLanguage()
|
||||
{
|
||||
return $this->getSacredLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the TYPO3 language code.
|
||||
*
|
||||
* @param string $typo3Code
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setTypo3Code($typo3Code)
|
||||
{
|
||||
$this->typo3Code = $typo3Code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the TYPO3 language code.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTypo3Code()
|
||||
{
|
||||
return $this->typo3Code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,268 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository;
|
||||
use TYPO3\CMS\Core\Localization\Parser\XliffParser;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Annotation\Validate;
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
|
||||
/**
|
||||
* Language Pack object
|
||||
*/
|
||||
class LanguagePack extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* Name of the extension this class belongs to
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @Validate("TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator")
|
||||
*/
|
||||
protected $author;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $authorCompany;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @Validate("TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator")
|
||||
*/
|
||||
protected $vendorName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @Validate("EmailAddress")
|
||||
*/
|
||||
protected $authorEmail;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $locale;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $language;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $typo3VersionRange;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @Validate("TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator")
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
/**
|
||||
* @var CountryRepository
|
||||
*/
|
||||
protected $countryRepository;
|
||||
|
||||
/**
|
||||
* @var CountryZoneRepository
|
||||
*/
|
||||
protected $countryZoneRepository;
|
||||
|
||||
/**
|
||||
* @var CurrencyRepository
|
||||
*/
|
||||
protected $currencyRepository;
|
||||
|
||||
/**
|
||||
* @var LanguageRepository
|
||||
*/
|
||||
protected $languageRepository;
|
||||
|
||||
/**
|
||||
* @var TerritoryRepository
|
||||
*/
|
||||
protected $territoryRepository;
|
||||
|
||||
public function __construct(
|
||||
$author = '',
|
||||
$authorCompany = '',
|
||||
$vendorName = '',
|
||||
$authorEmail = '',
|
||||
$locale = '',
|
||||
$language = ''
|
||||
) {
|
||||
$this->countryRepository = GeneralUtility::makeInstance(CountryRepository::class);
|
||||
$this->countryZoneRepository = GeneralUtility::makeInstance(CountryZoneRepository::class);
|
||||
$this->currencyRepository = GeneralUtility::makeInstance(CurrencyRepository::class);
|
||||
$this->languageRepository = GeneralUtility::makeInstance(LanguageRepository::class);
|
||||
$this->territoryRepository = GeneralUtility::makeInstance(TerritoryRepository::class);
|
||||
$this->setAuthor($author);
|
||||
$this->setAuthorCompany($authorCompany);
|
||||
$this->setVendorName($vendorName);
|
||||
$this->setAuthorEmail($authorEmail);
|
||||
$this->setLocale($locale);
|
||||
$this->setLanguage($language);
|
||||
}
|
||||
|
||||
public function setAuthor($author)
|
||||
{
|
||||
$this->author = $author;
|
||||
}
|
||||
|
||||
public function getAuthor()
|
||||
{
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
public function setAuthorCompany($authorCompany)
|
||||
{
|
||||
$this->authorCompany = $authorCompany;
|
||||
}
|
||||
|
||||
public function getAuthorCompany()
|
||||
{
|
||||
return $this->authorCompany;
|
||||
}
|
||||
|
||||
public function setVendorName($vendorName)
|
||||
{
|
||||
$this->vendorName = $vendorName;
|
||||
}
|
||||
|
||||
public function getVendorName()
|
||||
{
|
||||
return $this->vendorName;
|
||||
}
|
||||
|
||||
public function setAuthorEmail($authorEmail)
|
||||
{
|
||||
$this->authorEmail = $authorEmail;
|
||||
}
|
||||
|
||||
public function getAuthorEmail()
|
||||
{
|
||||
return $this->authorEmail;
|
||||
}
|
||||
|
||||
public function setLocale($locale)
|
||||
{
|
||||
$this->locale = $locale;
|
||||
}
|
||||
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
public function setLanguage($language)
|
||||
{
|
||||
$this->language = $language;
|
||||
}
|
||||
|
||||
public function getLanguage()
|
||||
{
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
public function setTypo3VersionRange($typo3VersionRange)
|
||||
{
|
||||
$this->typo3VersionRange = $typo3VersionRange;
|
||||
}
|
||||
|
||||
public function getTypo3VersionRange()
|
||||
{
|
||||
return $this->typo3VersionRange;
|
||||
}
|
||||
|
||||
public function setVersion($version)
|
||||
{
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the localization labels for this language pack
|
||||
*
|
||||
* @return string localization labels in xliff format
|
||||
*/
|
||||
public function getLocalizationLabels()
|
||||
{
|
||||
// Build the localization labels of the language pack
|
||||
$XliffParser = new XliffParser();
|
||||
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName);
|
||||
$extensionPath = ExtensionManagementUtility::extPath($extensionKey);
|
||||
$sourceXliffFilePath = $extensionPath . 'Resources/Private/Language/locallang_db.xlf';
|
||||
$parsedData = $XliffParser->getParsedData($sourceXliffFilePath, 'default');
|
||||
$localizationLabels = [];
|
||||
$localeLowerCase = strtolower($this->getLocale());
|
||||
$localeUpperCase = strtoupper($this->getLocale());
|
||||
foreach ($parsedData['default'] as $translationElementId => $translationElement) {
|
||||
if (substr($translationElementId, -3) == '_en') {
|
||||
$localizationLabels[] = chr(9) . chr(9) . chr(9) . '<trans-unit id="' . substr($translationElementId, 0, -2) . $localeLowerCase . '" xml:space="preserve">';
|
||||
$localizationLabels[] = chr(9) . chr(9) . chr(9) . chr(9) . '<source>' . str_replace('(EN)', '(' . $localeUpperCase . ')', $translationElement[0]['source']) . '</source>';
|
||||
if ($translationElement[0]['target']) {
|
||||
$localizationLabels[] = chr(9) . chr(9) . chr(9) . chr(9) . '<target>' . str_replace('(EN)', '(' . $localeUpperCase . ')', $translationElement[0]['target']) . '</target>';
|
||||
}
|
||||
$localizationLabels[] = chr(9) . chr(9) . chr(9) . '</trans-unit>';
|
||||
}
|
||||
}
|
||||
return implode(LF, $localizationLabels);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the update queries for this language pack
|
||||
*
|
||||
* @return string update queries in sql format
|
||||
*/
|
||||
public function getUpdateQueries()
|
||||
{
|
||||
$updateQueries = [];
|
||||
$locale = $this->getLocale();
|
||||
$updateQueries = array_merge($updateQueries, $this->countryRepository->getUpdateQueries($locale));
|
||||
$updateQueries = array_merge($updateQueries, $this->countryZoneRepository->getUpdateQueries($locale));
|
||||
$updateQueries = array_merge($updateQueries, $this->currencyRepository->getUpdateQueries($locale));
|
||||
$updateQueries = array_merge($updateQueries, $this->languageRepository->getUpdateQueries($locale));
|
||||
$updateQueries = array_merge($updateQueries, $this->territoryRepository->getUpdateQueries($locale));
|
||||
return implode(LF, $updateQueries);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2017 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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 3 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
|
||||
/**
|
||||
* The System Language model
|
||||
*/
|
||||
class SystemLanguage extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* @var string System language name
|
||||
*/
|
||||
protected $title = '';
|
||||
|
||||
/**
|
||||
* @var \SJBR\StaticInfoTables\Domain\Model\Language
|
||||
*/
|
||||
protected $isoLanguage = null;
|
||||
|
||||
/**
|
||||
* Sets the language name
|
||||
*
|
||||
* @param string $title
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the backend language name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ISO language
|
||||
*
|
||||
* @param Language $isoLanguage
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setIsoLanguage(Language $isoLanguage)
|
||||
{
|
||||
$this->isoLanguage = $isoLanguage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ISO language
|
||||
*
|
||||
* @return Language
|
||||
*/
|
||||
public function getIsoLanguage()
|
||||
{
|
||||
if ($this->isoLanguage !== null) {
|
||||
return clone $this->isoLanguage;
|
||||
}
|
||||
return $this->isoLanguage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
/**
|
||||
* The Territory model
|
||||
*
|
||||
* @copyright Copyright belongs to the respective authors
|
||||
* @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
|
||||
*/
|
||||
|
||||
class Territory extends AbstractEntity
|
||||
{
|
||||
/**
|
||||
* Deletion status of the object
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $deleted = false;
|
||||
|
||||
/**
|
||||
* UN numeric territory code
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $unCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* English name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $nameEn = '';
|
||||
|
||||
/**
|
||||
* UN numeric territory code of parent territory
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $parentTerritoryUnCodeNumber = 0;
|
||||
|
||||
/**
|
||||
* On initialization, get the columns mapping configuration
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
parent::initializeObject();
|
||||
$this->tableName = $this->dataMapper->getDataMap(self::class)->getTableName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deletion status of the entity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDeleted()
|
||||
{
|
||||
return $this->deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deletion status of the entity
|
||||
*
|
||||
* @param bool $deleted
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setDeleted($deleted)
|
||||
{
|
||||
$this->deleted = $deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the English name
|
||||
*
|
||||
* @param string $nameEn
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNameEn($nameEn)
|
||||
{
|
||||
$this->nameEn = $nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the English name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameEn()
|
||||
{
|
||||
return $this->nameEn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the UN territory numeric code
|
||||
*
|
||||
* @param int $unCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUnCodeNumber($unCodeNumber)
|
||||
{
|
||||
$this->unCodeNumber = $unCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the UN territory numeric code
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getUnCodeNumber()
|
||||
{
|
||||
return $this->unCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the UN numeric territory code of the parent territory
|
||||
*
|
||||
* @param int $parentTerritoryUnCodeNumber
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setParentTerritoryUnCodeNumber($parentTerritoryUnCodeNumber)
|
||||
{
|
||||
$this->parentTerritoryUnCodeNumber = $parentTerritoryUnCodeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the UN numeric territory code of the parent territory
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getParentTerritoryUnCodeNumber()
|
||||
{
|
||||
return $this->parentTerritoryUnCodeNumber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use Doctrine\DBAL\Schema\Column;
|
||||
use Doctrine\DBAL\Schema\TableDiff;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use SJBR\StaticInfoTables\Service\SqlSchemaMigrationService;
|
||||
use SJBR\StaticInfoTables\Utility\DatabaseUtility;
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||
|
||||
/**
|
||||
* Abstract Repository for static entities
|
||||
*
|
||||
* @author Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* @author Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
* @author Oliver Klee <typo3-coding@oliverklee.de>
|
||||
*/
|
||||
abstract class AbstractEntityRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* @var string Name of the extension this class belongs to
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* @var DataMapper
|
||||
*/
|
||||
protected $dataMapper;
|
||||
|
||||
/**
|
||||
* @var array ISO keys for this static table
|
||||
*/
|
||||
protected $isoKeys = [];
|
||||
|
||||
/**
|
||||
* Injects the DataMapper to map nodes to objects
|
||||
*
|
||||
* @param DataMapper $dataMapper
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function injectDataMapper(DataMapper $dataMapper)
|
||||
{
|
||||
$this->dataMapper = $dataMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the repository.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initializeObject()
|
||||
{
|
||||
$querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
|
||||
$querySettings->setRespectStoragePage(false);
|
||||
$this->setDefaultQuerySettings($querySettings);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all with deleted included
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface|array all entries
|
||||
*/
|
||||
public function findAllDeletedIncluded()
|
||||
{
|
||||
$querySettings = GeneralUtility::makeInstance(QuerySettingsInterface::class);
|
||||
$querySettings->setStoragePageIds([0]);
|
||||
$querySettings->setIncludeDeleted(true);
|
||||
$this->setDefaultQuerySettings($querySettings);
|
||||
return parent::findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all objects with uid in list
|
||||
*
|
||||
* @param string $list: list of uid's
|
||||
* @return QueryResultInterface|array all entries
|
||||
*/
|
||||
public function findAllByUidInList($list = '')
|
||||
{
|
||||
if (empty($list)) {
|
||||
return [];
|
||||
}
|
||||
$query = $this->createQuery();
|
||||
$list = GeneralUtility::trimExplode(',', $list, true);
|
||||
$query->matching($query->in('uid', $list));
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all ordered by the localized name
|
||||
*
|
||||
* @param string $orderDirection may be "asc" or "desc". Default is "asc".
|
||||
* @return QueryResultInterface|array all entries ordered by localized name
|
||||
*/
|
||||
protected function findAllOrderedByLocalizedName($orderDirection = 'asc')
|
||||
{
|
||||
$entities = parent::findAll();
|
||||
return $this->localizedSort($entities, $orderDirection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort entities by the localized name
|
||||
*
|
||||
* @param QueryResultInterface $entities to be sorted
|
||||
* @param string $orderDirection may be "asc" or "desc". Default is "asc".
|
||||
*
|
||||
* @return array entities ordered by localized name
|
||||
*/
|
||||
public function localizedSort(QueryResultInterface $entities, $orderDirection = 'asc')
|
||||
{
|
||||
$result = $entities->toArray();
|
||||
$locale = LocalizationUtility::setCollatingLocale();
|
||||
if ($locale !== false) {
|
||||
if ($orderDirection === 'asc') {
|
||||
uasort($result, [$this, 'strcollOnLocalizedName']);
|
||||
} else {
|
||||
uasort($result, [$this, 'strcollOnLocalizedNameDesc']);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Using strcoll comparison on localized names
|
||||
*
|
||||
* @return int see strcoll
|
||||
*
|
||||
* @param mixed $entityA
|
||||
* @param mixed $entityB
|
||||
*/
|
||||
protected function strcollOnLocalizedName($entityA, $entityB)
|
||||
{
|
||||
return strcoll($entityA->getNameLocalized(), $entityB->getNameLocalized());
|
||||
}
|
||||
|
||||
/**
|
||||
* Using strcoll comparison on localized names - descending order
|
||||
*
|
||||
* @return int see strcoll
|
||||
*
|
||||
* @param mixed $entityA
|
||||
* @param mixed $entityB
|
||||
*/
|
||||
protected function strcollOnLocalizedNameDesc($entityA, $entityB)
|
||||
{
|
||||
return strcoll($entityB->getNameLocalized(), $entityA->getNameLocalized());
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all ordered by given property name
|
||||
*
|
||||
* @param string $propertyName property name to order by
|
||||
* @param string $orderDirection may be "asc" or "desc". Default is "asc".
|
||||
* @return QueryResultInterface|array all entries ordered by $propertyName
|
||||
*/
|
||||
public function findAllOrderedBy($propertyName, $orderDirection = 'asc')
|
||||
{
|
||||
$queryResult = [];
|
||||
|
||||
if ($orderDirection !== 'asc' && $orderDirection !== 'desc') {
|
||||
throw new \InvalidArgumentException('Order direction must be "asc" or "desc".', 1316607580);
|
||||
}
|
||||
|
||||
if ($propertyName == 'nameLocalized') {
|
||||
$queryResult = $this->findAllOrderedByLocalizedName($orderDirection);
|
||||
} else {
|
||||
$query = $this->createQuery();
|
||||
|
||||
$object = new $this->objectType();
|
||||
if (!array_key_exists($propertyName, $object->_getProperties())) {
|
||||
throw new \InvalidArgumentException('The model "' . $this->objectType . '" has no property "' . $propertyName . '" to order by.', 1316607579);
|
||||
}
|
||||
|
||||
if ($orderDirection === 'asc') {
|
||||
$orderDirection = QueryInterface::ORDER_ASCENDING;
|
||||
} else {
|
||||
$orderDirection = QueryInterface::ORDER_DESCENDING;
|
||||
}
|
||||
$query->setOrderings([$propertyName => $orderDirection]);
|
||||
|
||||
return $query->execute();
|
||||
}
|
||||
return $queryResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds localization columns, if needed
|
||||
*
|
||||
* @param string $locale: the locale for which localization columns should be added
|
||||
* @return AbstractEntityRepository $this
|
||||
*/
|
||||
public function addLocalizationColumns($locale)
|
||||
{
|
||||
$dataMap = $this->dataMapper->getDataMap($this->objectType);
|
||||
$tableName = $dataMap->getTableName();
|
||||
$fieldsInfo = $this->getFieldsInfo();
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
foreach ($fieldsInfo as $field => $fieldInfo) {
|
||||
if ($field != 'cn_official_name_en') {
|
||||
$matches = [];
|
||||
if (preg_match('#_en$#', $field, $matches)) {
|
||||
// Make localization field name
|
||||
$localizationField = preg_replace('#_en$#', '_' . $locale, $field);
|
||||
// Add the field if it does not yet exist
|
||||
if (!$fieldsInfo[$localizationField]) {
|
||||
// Get field length
|
||||
$matches = [];
|
||||
if (preg_match('#\\(([0-9]+)\\)#', $fieldInfo['Type'] ?? '', $matches)) {
|
||||
$localizationFieldLength = (int)($matches[1]);
|
||||
// Add the localization field
|
||||
$connection = $connectionPool->getConnectionForTable($tableName);
|
||||
$column = new Column($localizationField, Type::getType(Type::STRING));
|
||||
$column->setLength($localizationFieldLength)
|
||||
->setNotnull(true)
|
||||
->setDefault('');
|
||||
$tableDiff = new TableDiff($tableName, [$column]);
|
||||
$query = $connection->getDatabasePlatform()->getAlterTableSQL($tableDiff);
|
||||
$connection->executeUpdate($query[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the information on the table fields
|
||||
*
|
||||
* @return array table fields information array
|
||||
*/
|
||||
protected function getFieldsInfo()
|
||||
{
|
||||
$fieldsInfo = [];
|
||||
$dataMap = $this->dataMapper->getDataMap($this->objectType);
|
||||
$tableName = $dataMap->getTableName();
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
$connection = $connectionPool->getConnectionForTable($tableName);
|
||||
$query = $connection->getDatabasePlatform()->getListTableColumnsSQL($tableName, $connection->getDatabase());
|
||||
$columnsInfo = $connection->executeQuery($query);
|
||||
foreach ($columnsInfo as $fieldRow) {
|
||||
$fieldsInfo[$fieldRow['Field']] = $fieldRow;
|
||||
}
|
||||
return $fieldsInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get update queries for the localization columns for a given locale
|
||||
*
|
||||
* @return array Update queries
|
||||
* @param mixed $locale
|
||||
*/
|
||||
public function getUpdateQueries($locale)
|
||||
{
|
||||
// Get the information of the table and its fields
|
||||
$dataMap = $this->dataMapper->getDataMap($this->objectType);
|
||||
$tableName = $dataMap->getTableName();
|
||||
$tableFields = array_keys($this->getFieldsInfo());
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
$connection = $connectionPool->getConnectionForTable($tableName);
|
||||
$updateQueries = [];
|
||||
// If the language pack is not yet created or not yet installed, the localization columns are not yet part of the domain model
|
||||
$exportFields = [];
|
||||
foreach ($tableFields as $field) {
|
||||
$matches = [];
|
||||
if (preg_match('#_' . strtolower($locale) . '$#', $field, $matches)) {
|
||||
$exportFields[] = $field;
|
||||
}
|
||||
}
|
||||
if (count($exportFields)) {
|
||||
$updateQueries[] = '## ' . $tableName;
|
||||
$exportFields = array_merge($exportFields, $this->isoKeys);
|
||||
$queryBuilder = $connectionPool->getQueryBuilderForTable($tableName);
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
$queryBuilder->select($exportFields[0]);
|
||||
array_shift($exportFields);
|
||||
foreach ($exportFields as $exportField) {
|
||||
$queryBuilder->addSelect($exportField);
|
||||
}
|
||||
$rows = $queryBuilder
|
||||
->from($tableName)
|
||||
->execute()
|
||||
->fetchAll();
|
||||
foreach ($rows as $row) {
|
||||
$set = [];
|
||||
foreach ($row as $field => $value) {
|
||||
if (!in_array($field, $this->isoKeys)) {
|
||||
$set[] = $field . '=' . $connection->quote($value);
|
||||
}
|
||||
}
|
||||
$whereClause = '';
|
||||
foreach ($this->isoKeys as $field) {
|
||||
$whereClause .= ($whereClause ? ' AND ' : ' WHERE ') . $field . '=' . $connection->quote($row[$field]);
|
||||
}
|
||||
$updateQueries[] = 'UPDATE ' . $tableName . ' SET ' . implode(',', $set) . $whereClause . ';';
|
||||
}
|
||||
}
|
||||
return $updateQueries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump non-localized contents of the repository
|
||||
*/
|
||||
public function sqlDumpNonLocalizedData()
|
||||
{
|
||||
// Get the information of the table and its fields
|
||||
$dataMap = $this->dataMapper->getDataMap($this->objectType);
|
||||
$tableName = $dataMap->getTableName();
|
||||
|
||||
$sqlSchemaMigrationService = GeneralUtility::makeInstance(SqlSchemaMigrationService::class);
|
||||
$dbFieldDefinitions = $sqlSchemaMigrationService->getFieldDefinitions_database();
|
||||
$dbFields = [];
|
||||
$dbFields[$tableName] = $dbFieldDefinitions[$tableName];
|
||||
|
||||
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName);
|
||||
$extensionPath = ExtensionManagementUtility::extPath($extensionKey);
|
||||
$ext_tables = @file_get_contents($extensionPath . 'ext_tables.sql');
|
||||
|
||||
$tableFields = array_keys($dbFields[$tableName]['fields']);
|
||||
foreach ($tableFields as $field) {
|
||||
// This is a very simple check if the field is from static_info_tables and not from a language pack
|
||||
$match = [];
|
||||
if (!preg_match('#' . preg_quote($field, '#') . '#m', $ext_tables, $match)) {
|
||||
unset($dbFields[$tableName]['fields'][$field]);
|
||||
}
|
||||
}
|
||||
|
||||
$databaseUtility = GeneralUtility::makeInstance(DatabaseUtility::class);
|
||||
return $databaseUtility->dumpStaticTables($dbFields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an object to this repository.
|
||||
*
|
||||
* @param object $object The object to add
|
||||
* @return void
|
||||
* @throws \BadMethodCallException(
|
||||
*/
|
||||
public function add($object)
|
||||
{
|
||||
throw new \BadMethodCallException(
|
||||
'This is a read-only repository in which the add method must not be called.',
|
||||
1420485488
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an object from this repository.
|
||||
*
|
||||
* @param object $object The object to remove
|
||||
* @return void
|
||||
* @throws \BadMethodCallException(
|
||||
*/
|
||||
public function remove($object)
|
||||
{
|
||||
throw new \BadMethodCallException(
|
||||
'This is a read-only repository in which the remove method must not be called.',
|
||||
1420485646
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces an existing object with the same identifier by the given object.
|
||||
*
|
||||
* @return void
|
||||
* @throws \BadMethodCallException(
|
||||
*/
|
||||
public function update($modifiedObject)
|
||||
{
|
||||
throw new \BadMethodCallException(
|
||||
'This is a read-only repository in which the update method must not be called.',
|
||||
1420485660
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all objects of this repository as if remove() was called for all of them.
|
||||
*
|
||||
* @return void
|
||||
* @throws \BadMethodCallException(
|
||||
*/
|
||||
public function removeAll()
|
||||
{
|
||||
throw new \BadMethodCallException(
|
||||
'This is a read-only repository in which the removeAll method must not be called.',
|
||||
1420485668
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rädiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2016 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Territory;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
|
||||
/**
|
||||
* Repository for \SJBR\StaticInfoTables\Domain\Model\Country
|
||||
*/
|
||||
class CountryRepository extends AbstractEntityRepository
|
||||
{
|
||||
/**
|
||||
* ISO keys for this static table
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $isoKeys = ['cn_iso_2'];
|
||||
|
||||
/**
|
||||
* @var TerritoryRepository
|
||||
*/
|
||||
protected $territoryRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Territory Repository
|
||||
*
|
||||
* @param TerritoryRepository $territoryRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectTerritoryRepository(TerritoryRepository $territoryRepository)
|
||||
{
|
||||
$this->territoryRepository = $territoryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds countries by territory
|
||||
*
|
||||
* @param Territory $territory
|
||||
* @return QueryResultInterface|array
|
||||
*/
|
||||
public function findByTerritory(Territory $territory)
|
||||
{
|
||||
$unCodeNumbers = [$territory->getUnCodeNumber()];
|
||||
// Get UN code numbers of subterritories (recursively)
|
||||
$subterritories = $this->territoryRepository->findWithinTerritory($territory);
|
||||
foreach ($subterritories as $subterritory) {
|
||||
$unCodeNumbers[] = $subterritory->getUnCodeNumber();
|
||||
}
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->in('parentTerritoryUnCodeNumber', $unCodeNumbers)
|
||||
);
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds countries by territory ordered by localized name
|
||||
*
|
||||
* @param Territory $territory
|
||||
* @return array Countries of the territory sorted by localized name
|
||||
*/
|
||||
public function findByTerritoryOrderedByLocalizedName(Territory $territory)
|
||||
{
|
||||
$entities = $this->findByTerritory($territory);
|
||||
return $this->localizedSort($entities);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a set of allowed countries
|
||||
*
|
||||
* @param string $allowedCountries: list of alpha-3 country codes
|
||||
* @return array the selected countries
|
||||
*/
|
||||
public function findAllowedByIsoCodeA3($allowedCountries = '')
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$countries = GeneralUtility::trimExplode(',', $allowedCountries, true);
|
||||
$query->matching(
|
||||
$query->in('isoCodeA3', $countries)
|
||||
);
|
||||
$entities = $query->execute();
|
||||
$orderedCountries = [];
|
||||
foreach ($countries as $isoCodeA3) {
|
||||
foreach ($entities as $entity) {
|
||||
if ($entity->getIsoCodeA3() === $isoCodeA3) {
|
||||
$orderedCountries[] = $entity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $orderedCountries;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Country;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
|
||||
/**
|
||||
* Repository for \SJBR\StaticInfoTables\Domain\Model\CountryZone
|
||||
*/
|
||||
class CountryZoneRepository extends AbstractEntityRepository
|
||||
{
|
||||
/**
|
||||
* @var array ISO keys for this static table
|
||||
*/
|
||||
protected $isoKeys = ['zn_country_iso_2', 'zn_code'];
|
||||
|
||||
/**
|
||||
* Finds country zones by country
|
||||
*
|
||||
* @param Country $country
|
||||
* @return QueryResultInterface|array
|
||||
*/
|
||||
public function findByCountry(Country $country)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->equals('countryIsoCodeNumber', $country->getIsoCodeNumber())
|
||||
);
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds country zones by country ordered by localized name
|
||||
*
|
||||
* @param Country $country
|
||||
* @return array Country zones of the country sorted by localized name
|
||||
*/
|
||||
public function findByCountryOrderedByLocalizedName(Country $country)
|
||||
{
|
||||
$entities = $this->findByCountry($country);
|
||||
return $this->localizedSort($entities);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Country;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
|
||||
/**
|
||||
* Repository for \SJBR\StaticInfoTables\Domain\Model\Currency
|
||||
*/
|
||||
class CurrencyRepository extends AbstractEntityRepository
|
||||
{
|
||||
/**
|
||||
* @var array ISO keys for this static table
|
||||
*/
|
||||
protected $isoKeys = ['cu_iso_3'];
|
||||
|
||||
/**
|
||||
* Finds currency by country
|
||||
*
|
||||
* @param Country $country
|
||||
* @return QueryResultInterface|array
|
||||
*/
|
||||
public function findByCountry(Country $country)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->equals('isoCodeNumber', $country->getCurrencyIsoCodeNumber())
|
||||
);
|
||||
return $query->execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Cache\ClassCacheManager;
|
||||
use SJBR\StaticInfoTables\Domain\Model\LanguagePack;
|
||||
use SJBR\StaticInfoTables\Utility\VersionNumberUtility;
|
||||
use TYPO3\CMS\Core\Cache\CacheManager;
|
||||
use TYPO3\CMS\Core\Core\Environment;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
|
||||
|
||||
class LanguagePackRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* @var string Name of the extension this class belongs to
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* Writes the language pack files
|
||||
*
|
||||
* @param LanguagePack the object to be stored
|
||||
* @return array localized messages
|
||||
*/
|
||||
public function writeLanguagePack(LanguagePack $languagePack)
|
||||
{
|
||||
$content = [];
|
||||
|
||||
$extensionKey = GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName);
|
||||
$extensionPath = ExtensionManagementUtility::extPath($extensionKey);
|
||||
|
||||
$content = [];
|
||||
$locale = $languagePack->getLocale();
|
||||
$localeLowerCase = strtolower($locale);
|
||||
$localeUpperCase = strtoupper($locale);
|
||||
$localeCamel = GeneralUtility::underscoredToUpperCamelCase(strtolower($locale));
|
||||
|
||||
$languagePackExtensionKey = $extensionKey . '_' . $localeLowerCase;
|
||||
$languagePackExtensionPath = Environment::getPublicPath() . '/typo3conf/ext/' . $languagePackExtensionKey . '/';
|
||||
|
||||
// Cleanup any pre-existing language pack
|
||||
if (is_dir($languagePackExtensionPath)) {
|
||||
GeneralUtility::rmdir($languagePackExtensionPath, true);
|
||||
}
|
||||
// Create language pack directory structure
|
||||
if (!is_dir($languagePackExtensionPath)) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath);
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Classes/Domain/Model/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Classes/Domain/Model/');
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Configuration/DomainModelExtension/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Configuration/DomainModelExtension/');
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Configuration/TCA/Overrides/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Configuration/TCA/Overrides/');
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Configuration/PageTSconfig/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Configuration/PageTSconfig/');
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Configuration/Extbase/Persistence/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Configuration/Extbase/Persistence/');
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Resources/Private/Language/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Resources/Private/Language/');
|
||||
}
|
||||
if (!is_dir($languagePackExtensionPath . 'Resources/Public/Icons/')) {
|
||||
GeneralUtility::mkdir_deep($languagePackExtensionPath . 'Resources/Public/Icons/');
|
||||
}
|
||||
|
||||
// Get the source files of the language pack template
|
||||
$sourcePath = $extensionPath . 'Resources/Private/LanguagePackTemplate/';
|
||||
$sourceFiles = [];
|
||||
$sourceFiles = GeneralUtility::getAllFilesAndFoldersInPath($sourceFiles, $sourcePath);
|
||||
$sourceFiles = GeneralUtility::removePrefixPathFromList($sourceFiles, $sourcePath);
|
||||
$typo3VersionRange = VersionNumberUtility::splitVersionRange($languagePack->getTypo3VersionRange());
|
||||
$typo3VersionMinArray = VersionNumberUtility::convertVersionStringToArray($typo3VersionRange[0]);
|
||||
$typo3VersionMaxArray = VersionNumberUtility::convertVersionStringToArray(VersionNumberUtility::raiseVersionNumber('main', $typo3VersionRange[1]));
|
||||
// Set markers replacement values
|
||||
$replace = [
|
||||
'###LANG_ISO_LOWER###' => $localeLowerCase,
|
||||
'###LANG_ISO_UPPER###' => $localeUpperCase,
|
||||
'###LANG_ISO_CAMEL###' => $localeCamel,
|
||||
'###TYPO3_VERSION_RANGE###' => $languagePack->getTypo3VersionRange(),
|
||||
'###TYPO3_VERSION_MIN###' => $typo3VersionMinArray['version_main'] . '.' . $typo3VersionMinArray['version_sub'],
|
||||
'###TYPO3_VERSION_MAX###' => $typo3VersionMaxArray['version_main'] . '.0',
|
||||
'###VERSION###' => $languagePack->getVersion(),
|
||||
'###LANG_NAME###' => $languagePack->getLanguage(),
|
||||
'###AUTHOR###' => $languagePack->getAuthor(),
|
||||
'###AUTHOR_EMAIL###' => $languagePack->getAuthorEmail(),
|
||||
'###AUTHOR_COMPANY###' => $languagePack->getAuthorCompany(),
|
||||
'###VENDOR_NAME###' => $languagePack->getVendorName(),
|
||||
'###VERSION_BASE###' => $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey]['version'],
|
||||
'###LANG_TCA_LABELS###' => $languagePack->getLocalizationLabels(),
|
||||
'###LANG_SQL_UPDATE###' => $languagePack->getUpdateQueries(),
|
||||
];
|
||||
// Create the language pack files
|
||||
$success = true;
|
||||
foreach ($sourceFiles as $hash => $file) {
|
||||
$fileContent = @file_get_contents($sourcePath . $file);
|
||||
foreach ($replace as $marker => $replacement) {
|
||||
$fileContent = str_replace($marker, $replacement, $fileContent);
|
||||
}
|
||||
$success = GeneralUtility::writeFile($languagePackExtensionPath . str_replace('.code', '.php', $file), $fileContent);
|
||||
if (!$success) {
|
||||
$content[] = LocalizationUtility::translate('couldNotWriteFile', $this->extensionName) . ' ' . $languagePackExtensionPath . $file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($success) {
|
||||
$cacheManager = GeneralUtility::makeInstance(CacheManager::class);
|
||||
$classCacheManager = new ClassCacheManager($cacheManager);
|
||||
$installUtility = GeneralUtility::makeInstance(InstallUtility::class);
|
||||
$installed = ExtensionManagementUtility::isLoaded($languagePackExtensionKey);
|
||||
if ($installed) {
|
||||
$content[] = LocalizationUtility::translate('languagePack', $this->extensionName)
|
||||
. ' ' . $languagePackExtensionKey
|
||||
. ' ' . LocalizationUtility::translate('languagePackUpdated', $this->extensionName);
|
||||
} else {
|
||||
$content[] = LocalizationUtility::translate('languagePackCreated', $this->extensionName) . ' ' . $languagePack->getLanguage() . ' (' . $locale . ')';
|
||||
$installUtility->install($languagePackExtensionKey);
|
||||
$content[] = LocalizationUtility::translate('languagePack', $this->extensionName)
|
||||
. ' ' . $languagePackExtensionKey
|
||||
. ' ' . LocalizationUtility::translate('wasInstalled', $this->extensionName);
|
||||
}
|
||||
$classCacheManager->reBuild();
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
|
||||
/**
|
||||
* Repository for \SJBR\StaticInfoTables\Domain\Model\Language
|
||||
*/
|
||||
class LanguageRepository extends AbstractEntityRepository
|
||||
{
|
||||
/**
|
||||
* @var array ISO keys for this static table
|
||||
*/
|
||||
protected $isoKeys = ['lg_iso_2', 'lg_country_iso_2'];
|
||||
|
||||
/**
|
||||
* Find all neither constructed nor sacred languages
|
||||
*
|
||||
* @return QueryResultInterface|array all languages neither constructed nor sacred
|
||||
*/
|
||||
public function findAllNonConstructedNonSacred()
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching($query->logicalAnd([$query->equals('constructedLanguage', false), $query->equals('sacredLanguage', false)]));
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the language object with the specified iso codes
|
||||
*
|
||||
* @param string $languageIsoCodeA2
|
||||
* @param string $countryIsoCodeA2
|
||||
* @return QueryResultInterface|array all entries ordered by $propertyName
|
||||
*/
|
||||
public function findOneByIsoCodes($languageIsoCodeA2, $countryIsoCodeA2 = '')
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching($query->logicalAnd([$query->equals('isoCodeA2', $languageIsoCodeA2), $query->equals('countryIsoCodeA2', $countryIsoCodeA2)]));
|
||||
return $query->execute()->getFirst();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2017 Stanislas Rolland <typo3@sjbr.ca>
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||
|
||||
/**
|
||||
* System language repository
|
||||
*/
|
||||
class SystemLanguageRepository extends Repository
|
||||
{
|
||||
/**
|
||||
* Find all system language objects with uid in list
|
||||
* If no list is provided, find all system language objects
|
||||
*
|
||||
* @param string $list: list of uid's
|
||||
*
|
||||
* @return QueryResultInterface|array all entries
|
||||
*/
|
||||
public function findAllByUidInList($list = '')
|
||||
{
|
||||
if (empty($list)) {
|
||||
return $this->findAll();
|
||||
}
|
||||
$query = $this->createQuery();
|
||||
$list = GeneralUtility::trimExplode(',', $list, true);
|
||||
$query->matching($query->in('uid', $list));
|
||||
return $query->execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Domain\Repository;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Country;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Territory;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
/**
|
||||
* Repository for \SJBR\StaticInfoTables\Domain\Model\Territory
|
||||
*/
|
||||
class TerritoryRepository extends AbstractEntityRepository
|
||||
{
|
||||
/**
|
||||
* ISO keys for this static table
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $isoKeys = ['tr_iso_nr'];
|
||||
|
||||
/**
|
||||
* Finds the territory within which a country is located
|
||||
*
|
||||
* @param Country $country
|
||||
* @return QueryResultInterface|array
|
||||
*/
|
||||
public function findByCountry(Country $country)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->equals('unCodeNumber', $country->getParentTerritoryUnCodeNumber())
|
||||
);
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds territories that have a given territory as parent territory
|
||||
*
|
||||
* @param Territory $territory
|
||||
* @return QueryResultInterface|array
|
||||
*/
|
||||
public function findByTerritory(Territory $territory)
|
||||
{
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->equals('parentTerritoryUnCodeNumber', $territory->getUnCodeNumber())
|
||||
);
|
||||
return $query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all territories within a territory recursively
|
||||
*
|
||||
* @param Territory $territory
|
||||
* @param array $unCodeNumbers array of UN territory code numbers used for recursive retrieval of sub-territories
|
||||
* @return QueryResultInterface|array
|
||||
*/
|
||||
public function findWithinTerritory(Territory $territory, &$unCodeNumbers = [])
|
||||
{
|
||||
if (empty($unCodeNumbers)) {
|
||||
$unCodeNumbers = [$territory->getUnCodeNumber()];
|
||||
}
|
||||
$initialCount = count($unCodeNumbers);
|
||||
|
||||
$query = $this->createQuery();
|
||||
$query->matching(
|
||||
$query->in('parentTerritoryUnCodeNumber', $unCodeNumbers)
|
||||
);
|
||||
$territories = $query->execute();
|
||||
|
||||
// Get UN code numbers of new subterritories
|
||||
foreach ($territories as $subterritory) {
|
||||
$unCodeNumbers[] = $subterritory->getUnCodeNumber();
|
||||
}
|
||||
$unCodeNumbers = array_unique($unCodeNumbers);
|
||||
|
||||
// Call recursively until no additional subterritories are found
|
||||
if (count($unCodeNumbers) > $initialCount) {
|
||||
$territories = $this->findWithinTerritory($territory, $unCodeNumbers);
|
||||
}
|
||||
|
||||
return $territories;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\EventListener;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Cache\ClassCacheManager;
|
||||
use SJBR\StaticInfoTables\Utility\DatabaseUpdateUtility;
|
||||
use TYPO3\CMS\Core\Registry;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
/*
|
||||
* AfterPackageActivation event listener
|
||||
*
|
||||
* Always run the extension update script except on first install of base extension
|
||||
*/
|
||||
abstract class AbstractEventListener
|
||||
{
|
||||
/**
|
||||
* @var string Name of the extension this controller belongs to
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* @var Registry
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* @param Registry $registry
|
||||
*/
|
||||
public function __construct(Registry $registry)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the update
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function executeUpdate()
|
||||
{
|
||||
$databaseUpdateUtility = GeneralUtility::makeInstance(DatabaseUpdateUtility::class);
|
||||
// Clear the class cache
|
||||
$classCacheManager = GeneralUtility::makeInstance(ClassCacheManager::class);
|
||||
$classCacheManager->reBuild();
|
||||
|
||||
if ($this->isUpdateRequired()) {
|
||||
// Process the database updates of this base extension (we want to re-process these updates every time the update script is invoked)
|
||||
// unless there was no change in the version numbers of the static info tables and language packs installed
|
||||
$extensionSitePath = ExtensionManagementUtility::extPath(GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName));
|
||||
if (isset($GLOBALS['BE_USER'])) {
|
||||
$GLOBALS['BE_USER']->writelog(3, 1, 0, 0, '[StaticInfoTables]: ' . LocalizationUtility::translate('updateTables', $this->extensionName) ?? '', [$GLOBALS['BE_USER']->user['username']]);
|
||||
}
|
||||
$databaseUpdateUtility->importStaticSqlFile($extensionSitePath);
|
||||
// Get the extensions which want to extend static_info_tables
|
||||
$loadedExtensions = array_unique(ExtensionManagementUtility::getLoadedExtensionListArray());
|
||||
$languagePackUpdated = false;
|
||||
foreach ($loadedExtensions as $extensionKey) {
|
||||
if ($this->isStaticInfoTablesExtension($extensionKey)) {
|
||||
// We need to reprocess the database structure update sql statements (ext_tables)
|
||||
$databaseUpdateUtility->processDatabaseUpdates($extensionKey);
|
||||
// Now we process the static data updates (ext_tables_static+adt)
|
||||
// Note: The Install Tool Utility does not handle sql update statements
|
||||
$databaseUpdateUtility->doUpdate($extensionKey);
|
||||
if (isset($GLOBALS['BE_USER'])) {
|
||||
$GLOBALS['BE_USER']->writelog(3, 1, 0, 0, '[StaticInfoTables]: ' . LocalizationUtility::translate('updateLanguageLabels', $this->extensionName, [$extensionKey]) ?? '', [$GLOBALS['BE_USER']->user['username']]);
|
||||
}
|
||||
$languagePackUpdated = true;
|
||||
}
|
||||
}
|
||||
$this->storeLastUpdateStatus();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Is an update required?
|
||||
*
|
||||
* Returns true when the last stored update status is different from the current status
|
||||
* or the forceUpdate GET parameter is provided.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isUpdateRequired(): bool
|
||||
{
|
||||
$lastUpdateStatus = $this->registry->get('static_info_tables', 'last_update_status', false);
|
||||
if (!$lastUpdateStatus) {
|
||||
return true;
|
||||
}
|
||||
$extensionVersionInfo = $this->buildExtensionVersionInfo();
|
||||
return $lastUpdateStatus !== $extensionVersionInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the last update status in the TYPO3 registry.
|
||||
*/
|
||||
protected function storeLastUpdateStatus()
|
||||
{
|
||||
$extensionVersionInfo = $this->buildExtensionVersionInfo();
|
||||
$this->registry->set('static_info_tables', 'last_update_status', $extensionVersionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loops over all loaded Extensions and collects the version info of every installed static_info_tables
|
||||
* Extension. The Extension keys and version numbers are concated to a string:
|
||||
*
|
||||
* extension_key1:1.2.3
|
||||
* extension_key2:2.3.4
|
||||
* ...
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildExtensionVersionInfo()
|
||||
{
|
||||
$mainVersion = ExtensionManagementUtility::getExtensionVersion('static_info_tables');
|
||||
$extensionVersions = ['static_info_tables:' . $mainVersion];
|
||||
|
||||
$loadedExtensions = array_unique(ExtensionManagementUtility::getLoadedExtensionListArray());
|
||||
foreach ($loadedExtensions as $extensionKey) {
|
||||
if (!$this->isStaticInfoTablesExtension($extensionKey)) {
|
||||
continue;
|
||||
}
|
||||
$extensionVersion = ExtensionManagementUtility::getExtensionVersion($extensionKey);
|
||||
$extensionVersions[] = $extensionKey . ':' . $extensionVersion;
|
||||
}
|
||||
|
||||
return implode(LF, $extensionVersions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when the StaticInfoTables.txt configuration file exists in the given Extension.
|
||||
*
|
||||
* @param string $extensionKey
|
||||
* @return bool
|
||||
*/
|
||||
protected function isStaticInfoTablesExtension($extensionKey)
|
||||
{
|
||||
$extensionInfoFile = ExtensionManagementUtility::extPath($extensionKey)
|
||||
. 'Configuration/DomainModelExtension/StaticInfoTables.txt';
|
||||
return file_exists($extensionInfoFile);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\EventListener;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Extensionmanager\Event\AfterExtensionStaticDatabaseContentHasBeenImportedEvent;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\PathUtility;
|
||||
|
||||
/*
|
||||
* AfterExtensionStaticDatabaseContentHasBeenImported event listener
|
||||
*
|
||||
* Run the update script after base data was re-imported
|
||||
*/
|
||||
class AfterExtensionStaticDatabaseContentHasBeenImportedEventListener extends AbstractEventListener
|
||||
{
|
||||
/**
|
||||
* If the installed extension is static_info_tables or a language pack, execute the update
|
||||
*
|
||||
* @param AfterExtensionStaticDatabaseContentHasBeenImportedEvent $event
|
||||
* @return void
|
||||
*/
|
||||
public function __invoke(AfterExtensionStaticDatabaseContentHasBeenImportedEvent $event): void
|
||||
{
|
||||
$extensionKey = $event->getPackageKey();
|
||||
if (strpos($extensionKey, 'static_info_tables') === 0) {
|
||||
$extensionKeyParts = explode('_', $extensionKey);
|
||||
if (count($extensionKeyParts) === 3) {
|
||||
$extTablesStaticSqlRelFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($extensionKey)) . 'ext_tables_static+adt.sql';
|
||||
}
|
||||
if (
|
||||
// Base extension with data already imported once
|
||||
(count($extensionKeyParts) === 3 && $this->registry->get('extensionDataImport', $extTablesStaticSqlRelFile))
|
||||
) {
|
||||
$this->registry->remove('static_info_tables', 'last_update_status');
|
||||
$this->executeUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\EventListener;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\PathUtility;
|
||||
|
||||
/*
|
||||
* AfterPackageActivation event listener
|
||||
*
|
||||
* Always run the extension update script except on first install of base extension
|
||||
*/
|
||||
class AfterPackageActivationEventListener extends AbstractEventListener
|
||||
{
|
||||
/**
|
||||
* If the installed extension is static_info_tables or a language pack, execute the update
|
||||
*
|
||||
* @param AfterPackageActivationEvent $event
|
||||
* @return void
|
||||
*/
|
||||
public function __invoke(AfterPackageActivationEvent $event): void
|
||||
{
|
||||
$extensionKey = $event->getPackageKey();
|
||||
$packageType = $event->getType();
|
||||
if ($packageType === 'typo3-cms-extension' && strpos($extensionKey, 'static_info_tables') === 0) {
|
||||
$extensionKeyParts = explode('_', $extensionKey);
|
||||
if (count($extensionKeyParts) === 3) {
|
||||
$extTablesStaticSqlRelFile = PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath($extensionKey)) . 'ext_tables_static+adt.sql';
|
||||
}
|
||||
if (
|
||||
// Base extension with data already imported once
|
||||
(count($extensionKeyParts) === 3 && $this->registry->get('extensionDataImport', $extTablesStaticSqlRelFile))
|
||||
// Language pack
|
||||
|| (count($extensionKeyParts) === 4 && strlen($extensionKeyParts[3]) === 2)
|
||||
|| (count($extensionKeyParts) === 5 && strlen($extensionKeyParts[3]) === 2 && strlen($extensionKeyParts[4]) === 2)
|
||||
) {
|
||||
$this->executeUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2017 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Backend\Form\Wizard\SuggestWizardDefaultReceiver;
|
||||
|
||||
/**
|
||||
* Processor for suggest items
|
||||
*/
|
||||
class SuggestLabelProcessor
|
||||
{
|
||||
/**
|
||||
* Translate label of entity in suggest selector
|
||||
*
|
||||
* @param array $params: table, uid, row, entry
|
||||
* @param SuggestWizardDefaultReceiver $parentObj
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function translateLabel(array &$params, SuggestWizardDefaultReceiver $parentObj)
|
||||
{
|
||||
$path = $params['entry']['path'];
|
||||
if (mb_strlen($path, 'utf-8') > 30) {
|
||||
$croppedPath = '<abbr title="' . htmlspecialchars($path) . '">' .
|
||||
htmlspecialchars(
|
||||
mb_substr($path, 0, 10, 'utf-8')
|
||||
. '...'
|
||||
. mb_substr($path, -20, null, 'utf-8')
|
||||
) .
|
||||
'</abbr>';
|
||||
} else {
|
||||
$croppedPath = htmlspecialchars($path);
|
||||
}
|
||||
$label = LocalizationUtility::translate(['uid' => $params['uid']], $params['table']);
|
||||
$params['entry']['text'] = '<span class="suggest-label">' . $label . '</span><span class="suggest-uid">[' . $params['uid'] . ']</span><br />
|
||||
<span class="suggest-path">' . $croppedPath . '</span>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Country;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Currency;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Language;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Territory;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository;
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Core\Http\ApplicationType;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Processor for TCA select items
|
||||
*/
|
||||
class TcaLabelProcessor
|
||||
{
|
||||
/**
|
||||
* @var TerritoryRepository
|
||||
*/
|
||||
protected $territoryRepository;
|
||||
|
||||
/**
|
||||
* @param TerritoryRepository $territoryRepository
|
||||
*/
|
||||
public function injectTerritoryRepository(TerritoryRepository $territoryRepository)
|
||||
{
|
||||
$this->territoryRepository = $territoryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add ISO codes to the label of entities
|
||||
*
|
||||
* @param array $PA: parameters: items, config, TSconfig, table, row, field
|
||||
* @return void
|
||||
*/
|
||||
public function addIsoCodeToLabel(&$PA)
|
||||
{
|
||||
if (!isset($PA['row']['uid'])) {
|
||||
return;
|
||||
}
|
||||
$PA['title'] = LocalizationUtility::translate(['uid' => $PA['row']['uid']], $PA['table']);
|
||||
if (($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface
|
||||
&& ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
|
||||
switch ($PA['table']) {
|
||||
case 'static_territories':
|
||||
$isoCode = $PA['row']['tr_iso_nr'] ?? 0;
|
||||
if (!$isoCode) {
|
||||
$territory = $this->territoryRepository->findByUid($PA['row']['uid']);
|
||||
if ($territory instanceof Territory) {
|
||||
$isoCode = $territory->getUnCodeNumber();
|
||||
}
|
||||
}
|
||||
if ($isoCode) {
|
||||
$PA['title'] .= ' (' . $isoCode . ')';
|
||||
}
|
||||
break;
|
||||
case 'static_countries':
|
||||
$isoCode = $PA['row']['cn_iso_2'] ?? '';
|
||||
if (!$isoCode) {
|
||||
$countryRepository = GeneralUtility::makeInstance(CountryRepository::class);
|
||||
$country = $countryRepository->findByUid($PA['row']['uid']);
|
||||
if ($country instanceof Country) {
|
||||
$isoCode = $country->getIsoCodeA2();
|
||||
}
|
||||
}
|
||||
if ($isoCode) {
|
||||
$PA['title'] .= ' (' . $isoCode . ')';
|
||||
}
|
||||
break;
|
||||
case 'static_languages':
|
||||
$isoCodes = [$PA['row']['lg_iso_2'] ?? ''];
|
||||
if ($PA['row']['lg_country_iso_2'] ?? '') {
|
||||
$isoCodes[] = $PA['row']['lg_country_iso_2'];
|
||||
}
|
||||
$isoCode = implode('_', $isoCodes);
|
||||
if (!$isoCode || !($PA['row']['lg_country_iso_2'] ?? '')) {
|
||||
$languageRepository = GeneralUtility::makeInstance(LanguageRepository::class);
|
||||
$language = $languageRepository->findByUid($PA['row']['uid']);
|
||||
if ($language instanceof Language) {
|
||||
$isoCodes = [$language->getIsoCodeA2()];
|
||||
if ($language->getCountryIsoCodeA2()) {
|
||||
$isoCodes[] = $language->getCountryIsoCodeA2();
|
||||
}
|
||||
$isoCode = implode('_', $isoCodes);
|
||||
}
|
||||
}
|
||||
if ($isoCode) {
|
||||
$PA['title'] .= ' (' . $isoCode . ')';
|
||||
}
|
||||
break;
|
||||
case 'static_currencies':
|
||||
$isoCode = $PA['row']['cu_iso_3'] ?? '';
|
||||
if (!$isoCode) {
|
||||
$currencyRepository = GeneralUtility::makeInstance(CurrencyRepository::class);
|
||||
$currency = $currencyRepository->findByUid($PA['row']['uid']);
|
||||
if ($currency instanceof Currency) {
|
||||
$isoCode = $currency->getIsoCodeA3();
|
||||
}
|
||||
}
|
||||
if ($isoCode) {
|
||||
$PA['title'] .= ' (' . $isoCode . ')';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Country;
|
||||
use SJBR\StaticInfoTables\Domain\Model\CountryZone;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Currency;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Language;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Territory;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository;
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper;
|
||||
|
||||
/**
|
||||
* Processor for TCA select items
|
||||
*/
|
||||
class TcaSelectItemsProcessor
|
||||
{
|
||||
/**
|
||||
* Translate and sort the territories selector using the current locale
|
||||
*
|
||||
* @param array $PA: parameters: items, config, TSconfig, table, row, field
|
||||
* @param DataPreprocessor $fObj
|
||||
* @return void
|
||||
*/
|
||||
public function translateTerritoriesSelector($PA, TcaSelectItems $fObj)
|
||||
{
|
||||
switch ($PA['table'] ?? '') {
|
||||
case 'static_territories':
|
||||
// Avoid circular relation
|
||||
$row = $PA['row'] ?? [];
|
||||
foreach (($PA['items'] ?? []) as $index => $item) {
|
||||
if ($item[1] == $row['uid']) {
|
||||
unset($PA['items'][$index]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
$PA['items'] = $this->translateSelectorItems($PA['items'], 'static_territories');
|
||||
$PA['items'] = $this->replaceSelectorIndexField($PA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate and sort the countries selector using the current locale
|
||||
*
|
||||
* @param array $PA: parameters: items, config, TSconfig, table, row, field
|
||||
* @param DataPreprocessor $fObj
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function translateCountriesSelector($PA, TcaSelectItems $fObj)
|
||||
{
|
||||
$PA['items'] = $this->translateSelectorItems($PA['items'], 'static_countries');
|
||||
$PA['items'] = $this->replaceSelectorIndexField($PA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate and sort the country zones selector using the current locale
|
||||
*
|
||||
* @param array $PA: parameters: items, config, TSconfig, table, row, field
|
||||
* @param DataPreprocessor $fObj
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function translateCountryZonesSelector($PA, TcaSelectItems $fObj)
|
||||
{
|
||||
$PA['items'] = $this->translateSelectorItems($PA['items'], 'static_country_zones');
|
||||
$PA['items'] = $this->replaceSelectorIndexField($PA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate and sort the currencies selector using the current locale
|
||||
*
|
||||
* @param array $PA: parameters: items, config, TSconfig, table, row, field
|
||||
* @param DataPreprocessor $fObj
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function translateCurrenciesSelector($PA, TcaSelectItems $fObj)
|
||||
{
|
||||
$PA['items'] = $this->translateSelectorItems($PA['items'], 'static_currencies');
|
||||
$PA['items'] = $this->replaceSelectorIndexField($PA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate and sort the languages selector using the current locale
|
||||
*
|
||||
* @param array $PA: parameters: items, config, TSconfig, table, row, field
|
||||
* @param DataPreprocessor $fObj
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function translateLanguagesSelector($PA, TcaSelectItems $fObj)
|
||||
{
|
||||
$PA['items'] = $this->translateSelectorItems($PA['items'], 'static_languages');
|
||||
$PA['items'] = $this->replaceSelectorIndexField($PA);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate selector items array
|
||||
*
|
||||
* @param array $items: array of value/label pairs
|
||||
* @param string $tableName: name of static info tables
|
||||
*
|
||||
* @return array array of value/translated label pairs
|
||||
*/
|
||||
protected function translateSelectorItems($items, $tableName)
|
||||
{
|
||||
$translatedItems = $items;
|
||||
if (isset($translatedItems) && is_array($translatedItems)) {
|
||||
foreach ($translatedItems as $key => $item) {
|
||||
if (is_array($translatedItems[$key]) && array_key_exists(1, $translatedItems[$key]) && ($translatedItems[$key][1] ?? '')) {
|
||||
//Get isocode if present
|
||||
$code = strstr($item[0], '(');
|
||||
$code2 = strstr(substr($code, 1), '(');
|
||||
$code = $code2 ? $code2 : $code;
|
||||
// Translate
|
||||
$translatedItems[$key][0] = LocalizationUtility::translate(['uid' => $item[1]], $tableName);
|
||||
// Re-append isocode, if present
|
||||
$translatedItems[$key][0] = $translatedItems[$key][0] . ($code ? ' ' . $code : '');
|
||||
}
|
||||
}
|
||||
$currentLocale = setlocale(LC_COLLATE, '0');
|
||||
$locale = LocalizationUtility::setCollatingLocale();
|
||||
if ($locale !== false) {
|
||||
uasort($translatedItems, [$this, 'strcollOnLabels']);
|
||||
}
|
||||
setlocale(LC_COLLATE, $currentLocale);
|
||||
}
|
||||
$items = $translatedItems;
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Using strcoll comparison on labels
|
||||
*
|
||||
* @return int see strcoll
|
||||
*
|
||||
* @param mixed $itemA
|
||||
* @param mixed $itemB
|
||||
*/
|
||||
protected function strcollOnLabels($itemA, $itemB)
|
||||
{
|
||||
return strcoll($itemA[0], $itemB[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the selector's uid index with configured indexField
|
||||
*
|
||||
* @param array $PA: TCA select field parameters array
|
||||
* @return array The new $items array
|
||||
*/
|
||||
protected function replaceSelectorIndexField($PA)
|
||||
{
|
||||
$items = $PA['items'] ?? [];
|
||||
$indexFields = GeneralUtility::trimExplode(',', $PA['config']['itemsProcFunc_config']['indexField'] ?? '', true);
|
||||
if (!empty($indexFields)) {
|
||||
$rows = [];
|
||||
// Collect items uid's
|
||||
$uids = [];
|
||||
foreach ($items as $key => $item) {
|
||||
if (is_array($items[$key]) && array_key_exists(1, $items[$key]) && ($items[$key][1] ?? 0)) {
|
||||
$uids[] = $item[1];
|
||||
}
|
||||
}
|
||||
$uidList = implode(',', $uids);
|
||||
if (!empty($uidList)) {
|
||||
switch ($PA['config']['foreign_table'] ?? '') {
|
||||
case 'static_territories':
|
||||
/** @var $territoryRepository TerritoryRepository */
|
||||
$territoryRepository = GeneralUtility::makeInstance(TerritoryRepository::class);
|
||||
$objects = $territoryRepository->findAllByUidInList($uidList)->toArray();
|
||||
break;
|
||||
case 'static_countries':
|
||||
/** @var $countryRepository CountryRepository */
|
||||
$countryRepository = GeneralUtility::makeInstance(CountryRepository::class);
|
||||
$objects = $countryRepository->findAllByUidInList($uidList)->toArray();
|
||||
break;
|
||||
case 'static_country_zones':
|
||||
/** @var $countryZoneRepository CountryZoneRepository */
|
||||
$countryZoneRepository = GeneralUtility::makeInstance(CountryZoneRepository::class);
|
||||
$objects = $countryZoneRepository->findAllByUidInList($uidList)->toArray();
|
||||
break;
|
||||
case 'static_languages':
|
||||
/** @var $languageRepository LanguageRepository */
|
||||
$languageRepository = GeneralUtility::makeInstance(LanguageRepository::class);
|
||||
$objects = $languageRepository->findAllByUidInList($uidList)->toArray();
|
||||
break;
|
||||
case 'static_currencies':
|
||||
/** @var $currencyRepository CurrencyRepository */
|
||||
$currencyRepository = GeneralUtility::makeInstance(CurrencyRepository::class);
|
||||
$objects = $currencyRepository->findAllByUidInList($uidList)->toArray();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!empty($objects)) {
|
||||
$columnsMapping = $this->getColumnsMapping($objects[0]);
|
||||
// Map table column to object property
|
||||
$indexProperties = [];
|
||||
foreach ($indexFields as $indexField) {
|
||||
if ($columnsMapping[$indexField]['mapOnProperty'] ?? '') {
|
||||
$indexProperties[] = $columnsMapping[$indexField]['mapOnProperty'];
|
||||
} else {
|
||||
$indexProperties[] = GeneralUtility::underscoredToLowerCamelCase($indexField);
|
||||
}
|
||||
}
|
||||
// Index rows by uid
|
||||
$uidIndexedRows = [];
|
||||
foreach ($objects as $object) {
|
||||
$uidIndexedObjects[$object->getUid()] = $object;
|
||||
}
|
||||
// Replace the items index field
|
||||
foreach ($items as $key => $item) {
|
||||
if (is_array($items[$key]) && array_key_exists(1, $items[$key]) && ($items[$key][1] ?? 0)) {
|
||||
$object = $uidIndexedObjects[$items[$key][1]];
|
||||
$items[$key][1] = $object->_getProperty($indexProperties[0]);
|
||||
if (($indexFields[1] ?? false) && $object->_getProperty($indexProperties[1] ?? '')) {
|
||||
$items[$key][1] .= '_' . $object->_getProperty($indexProperties[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the columns mapping for the object
|
||||
*
|
||||
* @param object $object
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumnsMapping($object)
|
||||
{
|
||||
$columnsMapping = [];
|
||||
$dataMapper = GeneralUtility::makeInstance(DataMapper::class);
|
||||
$className = get_class($object);
|
||||
$dataMap = $dataMapper->getDataMap($className);
|
||||
$properties = $object->_getProperties();
|
||||
foreach ($properties as $propertyName => $propertyValue) {
|
||||
if (!$dataMap->isPersistableProperty($propertyName)) {
|
||||
continue;
|
||||
}
|
||||
$columnMap = $dataMap->getColumnMap($propertyName);
|
||||
$columnName = $columnMap->getColumnName();
|
||||
$columnsMapping[$columnName] = ['mapOnProperty' => $propertyName];
|
||||
}
|
||||
return $columnsMapping;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Hook\Backend\Form\Wizard;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2007-2011 Andreas Wolf <andreas.wolf@ikt-werk.de>
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Backend\Form\Wizard\SuggestWizardDefaultReceiver;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Default implementation of a handler class for an ajax record selector.
|
||||
*
|
||||
* Normally other implementations should be inherited from this one.
|
||||
* queryTable() should not be overwritten under normal circumstances.
|
||||
*
|
||||
* @author Andreas Wolf <andreas.wolf@ikt-werk.de>
|
||||
* @author Benjamin Mack <benni@typo3.org>
|
||||
* @author Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*/
|
||||
class SuggestReceiver extends SuggestWizardDefaultReceiver
|
||||
{
|
||||
/**
|
||||
* Prepare the statement for selecting the records which will be returned to the selector. May also return some
|
||||
* other records (e.g. from a mm-table) which will be used later on to select the real records
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareSelectStatement()
|
||||
{
|
||||
$expressionBuilder = $this->queryBuilder->expr();
|
||||
$searchWholePhrase = !isset($this->config['searchWholePhrase']) || $this->config['searchWholePhrase'];
|
||||
$searchString = $this->params['value'];
|
||||
$searchUid = (int)$searchString;
|
||||
if ($searchString !== '') {
|
||||
$likeCondition = ($searchWholePhrase ? '%' : '') . $this->queryBuilder->escapeLikeWildcards($searchString) . '%';
|
||||
// Get the label field for the current language, if any is available
|
||||
$lang = LocalizationUtility::getCurrentLanguage();
|
||||
$lang = LocalizationUtility::getIsoLanguageKey($lang);
|
||||
$labelFields = LocalizationUtility::getLabelFields($this->table, $lang);
|
||||
$selectFieldsList = $labelFields[0] . ',' . $this->config['additionalSearchFields'];
|
||||
$selectFields = GeneralUtility::trimExplode(',', $selectFieldsList, true);
|
||||
$selectFields = array_unique($selectFields);
|
||||
$selectParts = $expressionBuilder->orX();
|
||||
foreach ($selectFields as $field) {
|
||||
$selectParts->add($expressionBuilder->like($field, $this->queryBuilder->createPositionalParameter($likeCondition)));
|
||||
}
|
||||
$searchClause = $expressionBuilder->orX($selectParts);
|
||||
if ($searchUid > 0 && $searchUid == $searchString) {
|
||||
$searchClause->add($expressionBuilder->eq('uid', $searchUid));
|
||||
}
|
||||
$this->queryBuilder->andWhere($expressionBuilder->orX($searchClause));
|
||||
}
|
||||
if (!empty($this->allowedPages)) {
|
||||
$pidList = array_map('intval', $this->allowedPages);
|
||||
if (!empty($pidList)) {
|
||||
$this->queryBuilder->andWhere(
|
||||
$expressionBuilder->in('pid', $pidList)
|
||||
);
|
||||
}
|
||||
}
|
||||
// add an additional search condition comment
|
||||
if (isset($this->config['searchCondition']) && $this->config['searchCondition'] !== '') {
|
||||
$this->queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($this->config['searchCondition']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the clause by which the result elements are sorted. See description of ORDER BY in
|
||||
* SQL standard for reference.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareOrderByStatement()
|
||||
{
|
||||
// Get the label field for the current language, if any is available
|
||||
$lang = LocalizationUtility::getCurrentLanguage();
|
||||
$lang = LocalizationUtility::getIsoLanguageKey($lang);
|
||||
$labelFields = LocalizationUtility::getLabelFields($this->table, $lang);
|
||||
if (!empty($labelFields)) {
|
||||
foreach ($labelFields as $labelField) {
|
||||
$this->queryBuilder->addOrderBy($labelField);
|
||||
}
|
||||
} elseif ($GLOBALS['TCA'][$this->table]['ctrl']['label']) {
|
||||
$this->queryBuilder->addOrderBy($GLOBALS['TCA'][$this->table]['ctrl']['label']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manipulate a record before using it to render the selector; may be used to replace a MM-relation etc.
|
||||
*
|
||||
* @param array $row
|
||||
*/
|
||||
protected function manipulateRecord(&$row)
|
||||
{
|
||||
// Localize the record
|
||||
$row[$GLOBALS['TCA'][$this->table]['ctrl']['label']] = LocalizationUtility::translate(['uid' => $row['uid']], $this->table);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Hook\Backend\Recordlist;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2018-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||||
use TYPO3\CMS\Core\Database\Query\QueryHelper;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
|
||||
/**
|
||||
* Order records according to language field of current language
|
||||
*/
|
||||
class ModifyQuery
|
||||
{
|
||||
/**
|
||||
* Specify records order
|
||||
*
|
||||
* @param array $parameters
|
||||
* @param string $table
|
||||
* @param int $pageId
|
||||
* @param string $additionalConstraints
|
||||
* @param string $fieldList
|
||||
* @param QueryBuilder $queryBuilder
|
||||
* @return void
|
||||
*/
|
||||
public function modifyQuery(&$parameters, $table, $pageId, $additionalConstraints, $fieldList, QueryBuilder $queryBuilder)
|
||||
{
|
||||
if (in_array($table, array_keys($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'] ?? []))) {
|
||||
$lang = substr(strtolower($this->getLanguageService()->lang), 0, 2);
|
||||
if (ExtensionManagementUtility::isLoaded('static_info_tables_' . $lang) &&
|
||||
isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$table]['label_fields']) &&
|
||||
is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$table]['label_fields'])) {
|
||||
$label = array_key_first($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$table]['label_fields']);
|
||||
if ($label) {
|
||||
$orderBy = str_replace('##', $lang, $label);
|
||||
$orderByFields = QueryHelper::parseOrderBy((string)$orderBy);
|
||||
foreach ($orderByFields as $fieldNameAndSorting) {
|
||||
list($fieldName, $sorting) = $fieldNameAndSorting;
|
||||
$queryBuilder->orderBy($fieldName, $sorting);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Hook\Core\DataHandling;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Hook on Core/DataHandling/DataHandler to manage redundancy of ISO codes in static info tables
|
||||
*/
|
||||
class ProcessDataMap
|
||||
{
|
||||
protected $countryRepository;
|
||||
|
||||
public function injectCountryRepository(CountryRepository $countryRepository)
|
||||
{
|
||||
$this->countryRepository = $countryRepository;
|
||||
}
|
||||
protected $currencyRepository;
|
||||
|
||||
public function injectCurrencyRepository(CurrencyRepository $currencyRepository)
|
||||
{
|
||||
$this->currencyRepository = $currencyRepository;
|
||||
}
|
||||
|
||||
protected $territoryRepository;
|
||||
|
||||
public function injectTerritoryRepository(TerritoryRepository $territoryRepository)
|
||||
{
|
||||
$this->territoryRepository = $territoryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post-process redundant ISO codes fields
|
||||
*
|
||||
* @param object $fobj TCEmain object reference
|
||||
* @param mixed $status
|
||||
* @param mixed $table
|
||||
* @param mixed $id
|
||||
* @return void
|
||||
*/
|
||||
public function processDatamap_postProcessFieldArray($status, $table, $id, &$incomingFieldArray, &$fObj)
|
||||
{
|
||||
switch ($table) {
|
||||
case 'static_territories':
|
||||
//Post-process containing territory ISO numeric code
|
||||
if ($incomingFieldArray['tr_parent_territory_uid'] ?? 0) {
|
||||
$territory = $this->territoryRepository->findOneByUid((int)$incomingFieldArray['tr_parent_territory_uid']);
|
||||
if (is_object($territory)) {
|
||||
$incomingFieldArray['tr_parent_iso_nr'] = $territory->getUnCodeNumber();
|
||||
}
|
||||
} elseif (isset($incomingFieldArray['tr_parent_territory_uid'])) {
|
||||
$incomingFieldArray['tr_parent_iso_nr'] = 0;
|
||||
}
|
||||
break;
|
||||
case 'static_countries':
|
||||
//Post-process containing territory ISO numeric code
|
||||
if ($incomingFieldArray['cn_parent_territory_uid'] ?? 0) {
|
||||
$territory = $this->territoryRepository->findOneByUid((int)$incomingFieldArray['cn_parent_territory_uid']);
|
||||
if (is_object($territory)) {
|
||||
$incomingFieldArray['cn_parent_tr_iso_nr'] = $territory->getUnCodeNumber();
|
||||
}
|
||||
} elseif (isset($incomingFieldArray['cn_parent_territory_uid'])) {
|
||||
$incomingFieldArray['cn_parent_tr_iso_nr'] = 0;
|
||||
}
|
||||
//Post-process currency ISO numeric and A3 codes
|
||||
if ($incomingFieldArray['cn_currency_uid'] ?? 0) {
|
||||
$currency = $this->currencyRepository->findOneByUid((int)$incomingFieldArray['cn_currency_uid']);
|
||||
if (is_object($currency)) {
|
||||
$incomingFieldArray['cn_currency_iso_nr'] = $currency->getIsoCodeNumber();
|
||||
$incomingFieldArray['cn_currency_iso_3'] = $currency->getIsoCodeA3();
|
||||
}
|
||||
} elseif (isset($incomingFieldArray['cn_currency_uid'])) {
|
||||
$incomingFieldArray['cn_currency_iso_nr'] = 0;
|
||||
$incomingFieldArray['cn_currency_iso_3'] = '';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Post-process redundant ISO codes fields of IRRE child
|
||||
*
|
||||
* @param object $fobj TCEmain object reference
|
||||
* @param mixed $status
|
||||
* @param mixed $table
|
||||
* @param mixed $id
|
||||
* @return void
|
||||
*/
|
||||
public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, &$fObj)
|
||||
{
|
||||
switch ($table) {
|
||||
case 'static_countries':
|
||||
//Post-process country ISO numeric, A2 and A3 codes on country zones
|
||||
// Get the country record uid
|
||||
if ($status === 'new') {
|
||||
$id = $fObj->substNEWwithIDs[$id];
|
||||
}
|
||||
// Get the country
|
||||
$country = $this->countryRepository->findOneByUid((int)$id);
|
||||
// Get the country zones
|
||||
$countryZones = $country->getCountryZones()->toArray();
|
||||
if (count($countryZones)) {
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('static_country_zones');
|
||||
foreach ($countryZones as $countryZone) {
|
||||
$connection->update(
|
||||
'static_country_zones',
|
||||
[
|
||||
'zn_country_iso_nr' => (int)$country->getIsoCodeNumber(),
|
||||
'zn_country_iso_2' => $country->getIsoCodeA2(),
|
||||
'zn_country_iso_3' => $country->getIsoCodeA3(),
|
||||
],
|
||||
['uid' => (int)$countryZone->getUid()]
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
622
typo3conf/ext/static_info_tables/Classes/PiBaseApi.php
Normal file
@@ -0,0 +1,622 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2004-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Currency;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Utility\HtmlElementUtility;
|
||||
use SJBR\StaticInfoTables\Utility\LocalizationUtility;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\QueryHelper;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
|
||||
use TYPO3\CMS\Core\Http\ApplicationType;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Frontend\Plugin\AbstractPlugin;
|
||||
|
||||
/**
|
||||
* Class for handling static info tables: countries, and subdivisions, currencies, languages and taxes
|
||||
*/
|
||||
class PiBaseApi extends AbstractPlugin
|
||||
{
|
||||
/**
|
||||
* The backReference to the mother cObj object set at call time
|
||||
*/
|
||||
public $cObj;
|
||||
|
||||
// Same as class name
|
||||
public $prefixId = 'tx_staticinfotables_pi1';
|
||||
// Path to this script relative to the extension dir.
|
||||
public $scriptRelPath = 'pi1/class.tx_staticinfotables_pi1.php';
|
||||
|
||||
/**
|
||||
* The extension key
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $extKey = 'static_info_tables';
|
||||
|
||||
public $conf = [];
|
||||
// Default currency
|
||||
public $currency;
|
||||
public $currencyInfo = [];
|
||||
public $defaultCountry;
|
||||
public $defaultCountryZone;
|
||||
public $defaultLanguage;
|
||||
public $types = ['TERRITORIES', 'COUNTRIES', 'SUBDIVISIONS', 'CURRENCIES', 'LANGUAGES'];
|
||||
public $tables = [
|
||||
'TERRITORIES' => 'static_territories',
|
||||
'COUNTRIES' => 'static_countries',
|
||||
'SUBDIVISIONS' => 'static_country_zones',
|
||||
'CURRENCIES' => 'static_currencies',
|
||||
'LANGUAGES' => 'static_languages',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var CountryRepository
|
||||
*/
|
||||
protected $countryRepository;
|
||||
|
||||
/**
|
||||
* @var CurrencyRepository
|
||||
*/
|
||||
protected $currencyRepository;
|
||||
|
||||
/**
|
||||
* Whether the class has been initialized
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $bHasBeenInitialised = false;
|
||||
|
||||
/**
|
||||
* Returns info if the tx_staticinfotables_pi1 object has already been initialised.
|
||||
* You need to initialise this object only once.
|
||||
*
|
||||
* @return bool Always returns true
|
||||
*/
|
||||
public function needsInit()
|
||||
{
|
||||
return !$this->bHasBeenInitialised;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializing the class: sets the language based on the TS configuration language property
|
||||
*
|
||||
* @param array $conf ... overwriting setup of extension
|
||||
* @return bool Always returns true
|
||||
*/
|
||||
public function init($conf = [])
|
||||
{
|
||||
if (($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface
|
||||
&& ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) {
|
||||
$this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'] ?? [];
|
||||
}
|
||||
|
||||
$this->countryRepository = GeneralUtility::makeInstance(CountryRepository::class);
|
||||
$this->currencyRepository = GeneralUtility::makeInstance(CurrencyRepository::class);
|
||||
|
||||
//Get the default currency and make sure it does exist in table static_currencies
|
||||
$this->currency = $conf['currencyCode'] ?? '';
|
||||
if (!$this->currency) {
|
||||
$this->currency = (trim($this->conf['currencyCode'] ?? '')) ? trim($this->conf['currencyCode']) : 'EUR';
|
||||
}
|
||||
//If nothing is set, we use the Euro because TYPO3 is spread more in this area
|
||||
if (!$this->getStaticInfoName('CURRENCIES', $this->currency)) {
|
||||
$this->currency = 'EUR';
|
||||
}
|
||||
$this->currencyInfo = $this->loadCurrencyInfo($this->currency);
|
||||
|
||||
$this->defaultCountry = $conf['countryCode'] ?? '';
|
||||
if (!$this->defaultCountry) {
|
||||
$this->defaultCountry = trim($this->conf['countryCode'] ?? '');
|
||||
}
|
||||
if (!$this->getStaticInfoName('COUNTRIES', $this->defaultCountry)) {
|
||||
$this->defaultCountry = 'DEU';
|
||||
}
|
||||
|
||||
$this->defaultCountryZone = $conf['countryZoneCode'] ?? '';
|
||||
if (!$this->defaultCountryZone) {
|
||||
$this->defaultCountryZone = trim($this->conf['countryZoneCode'] ?? '');
|
||||
}
|
||||
if (!$this->getStaticInfoName('SUBDIVISIONS', $this->defaultCountryZone, $this->defaultCountry)) {
|
||||
if ($this->defaultCountry == 'DEU') {
|
||||
$this->defaultCountryZone = 'NW';
|
||||
} else {
|
||||
$this->defaultCountryZone = '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->defaultLanguage = $conf['languageCode'] ?? '';
|
||||
if (!$this->defaultLanguage) {
|
||||
$this->defaultLanguage = trim($this->conf['languageCode'] ?? '');
|
||||
}
|
||||
if (!$this->getStaticInfoName('LANGUAGES', $this->defaultLanguage)) {
|
||||
$this->defaultLanguage = 'EN';
|
||||
}
|
||||
|
||||
$this->bHasBeenInitialised = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting the name of a country, country subdivision, currency, language, tax
|
||||
*
|
||||
* @param string Defines the type of entry of the requested name: 'TERRITORIES', 'COUNTRIES', 'SUBDIVISIONS', 'CURRENCIES', 'LANGUAGES'
|
||||
* @param string The ISO alpha-3 code of a territory, country or currency, or the ISO alpha-2 code of a language or the code of a country subdivision, can be a comma ',' separated string, then all the single items are looked up and returned
|
||||
* @param string The value of the country code (cn_iso_3) for which a name of type 'SUBDIVISIONS' is requested (meaningful only in this case)
|
||||
* @param string Not used
|
||||
* @param bool local name only - if set local title is returned
|
||||
* @param mixed $type
|
||||
* @param mixed $code
|
||||
* @param mixed $country
|
||||
* @param mixed $countrySubdivision
|
||||
* @param mixed $local
|
||||
*
|
||||
* @return string|bool The name of the object in the current language or false
|
||||
*/
|
||||
public function getStaticInfoName($type = 'COUNTRIES', $code = '', $country = '', $countrySubdivision = '', $local = false)
|
||||
{
|
||||
$names = false;
|
||||
if (in_array($type, $this->types) && trim($code)) {
|
||||
$codeArray = GeneralUtility::trimExplode(',', ($code));
|
||||
$tableName = $this->tables[$type];
|
||||
if (!$tableName) {
|
||||
return false;
|
||||
}
|
||||
$nameArray = [];
|
||||
foreach ($codeArray as $item) {
|
||||
$isoCodeArray = [];
|
||||
$isoCodeArray[] = $item;
|
||||
switch ($type) {
|
||||
case 'SUBDIVISIONS':
|
||||
$isoCodeArray[] = trim($country) ? trim($country) : $this->defaultCountry;
|
||||
break;
|
||||
case 'LANGUAGES':
|
||||
$isoCodeArray = GeneralUtility::trimExplode('_', $code, 1);
|
||||
break;
|
||||
}
|
||||
$nameArray[] = LocalizationUtility::translate(['iso' => $isoCodeArray], $tableName, $local);
|
||||
}
|
||||
$names = implode(',', $nameArray);
|
||||
}
|
||||
return $names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Buils a HTML drop-down selector of countries, country subdivisions, currencies or languages
|
||||
*
|
||||
* @param string $type: Defines the type of entries to be presented in the drop-down selector: 'COUNTRIES', 'SUBDIVISIONS', 'CURRENCIES' or 'LANGUAGES'
|
||||
* @param string $name: A value for the name attribute of the <select> tag
|
||||
* @param string $class: A value for the class attribute of the <select> tag
|
||||
* @param array $selectedArray: The values of the code of the entries to be pre-selected in the drop-down selector: value of cn_iso_3, zn_code, cu_iso_3 or lg_iso_2
|
||||
* @param string $country: The value of the country code (cn_iso_3) for which a drop-down selector of type 'SUBDIVISIONS' is requested (meaningful only in this case)
|
||||
* @param boolean/string $submit: If set to 1, an onchange attribute will be added to the <select> tag for immediate submit of the changed value; if set to other than 1, overrides the onchange script
|
||||
* @param string $id: A value for the id attribute of the <select> tag
|
||||
* @param string $title: A value for the title attribute of the <select> tag
|
||||
* @param string $addWhere: A where clause for the records
|
||||
* @param string $lang: language to be used
|
||||
* @param bool $local: If set, we are looking for the "local" title field
|
||||
* @param array $mergeArray: additional array to be merged as key => value pair
|
||||
* @param int $size: max elements that can be selected. Default: 1
|
||||
* @param array $outSelectedArray: resulting selected array with the ISO alpha-3 code of the countries (passed by reference)
|
||||
*
|
||||
* @return string A set of HTML <select> and <option> tags
|
||||
*/
|
||||
public function buildStaticInfoSelector($type = 'COUNTRIES', $name = '', $class = '', $selectedArray = [], $country = '', $submit = 0, $id = '', $title = '', $addWhere = '', $lang = '', $local = false, $mergeArray = [], $size = 1, &$outSelectedArray = [])
|
||||
{
|
||||
$selector = '';
|
||||
|
||||
if (isset($selectedArray) && !is_array($selectedArray)) {
|
||||
$selectedArray = GeneralUtility::trimExplode(',', $selectedArray);
|
||||
}
|
||||
|
||||
$country = trim($country);
|
||||
$onChange = '';
|
||||
if ($submit) {
|
||||
if ($submit == 1) {
|
||||
$onChange = $this->conf['onChangeAttribute'];
|
||||
} else {
|
||||
$onChange = $submit;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'COUNTRIES':
|
||||
$nameArray = $this->initCountries('ALL', $lang, $local, $addWhere);
|
||||
$defaultSelectedArray = [$this->defaultCountry];
|
||||
break;
|
||||
case 'SUBDIVISIONS':
|
||||
$param = (trim($country) ? trim($country) : $this->defaultCountry);
|
||||
$nameArray = $this->initCountrySubdivisions($param, $addWhere);
|
||||
if ($param == $this->defaultCountry) {
|
||||
$defaultSelectedArray = [$this->defaultCountryZone];
|
||||
}
|
||||
break;
|
||||
case 'CURRENCIES':
|
||||
$nameArray = $this->initCurrencies($addWhere);
|
||||
$defaultSelectedArray = [$this->currency];
|
||||
break;
|
||||
case 'LANGUAGES':
|
||||
$nameArray = $this->initLanguages($addWhere);
|
||||
$defaultSelectedArray = [$this->defaultLanguage];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isset($defaultSelectedArray) || !$defaultSelectedArray) {
|
||||
reset($nameArray);
|
||||
$defaultSelectedArray = [key($nameArray)];
|
||||
}
|
||||
$bEmptySelected = (empty($selectedArray) || ((count($selectedArray) == 1) && empty($selectedArray[0])));
|
||||
$selectedArray = ((!$bEmptySelected || count($mergeArray)) ? $selectedArray : $defaultSelectedArray);
|
||||
|
||||
if (count($mergeArray)) {
|
||||
$nameArray = array_merge($nameArray, $mergeArray);
|
||||
uasort($nameArray, 'strcoll');
|
||||
}
|
||||
|
||||
if (count($nameArray) > 0) {
|
||||
$items = [];
|
||||
foreach ($nameArray as $itemKey => $itemName) {
|
||||
$items[] = ['name' => $itemName, 'value' => $itemKey];
|
||||
}
|
||||
$selector = HtmlElementUtility::selectConstructor($items, $selectedArray, $outSelectedArray, $name, $class, $id, $title, $onChange, $size);
|
||||
}
|
||||
return $selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting all countries into an array
|
||||
* where the key is the ISO alpha-3 code of the country
|
||||
* and where the value is the name of the country in the current language
|
||||
*
|
||||
* @param string $param: It defines a selection: 'ALL', 'UN', 'EU'
|
||||
* @param string $lang: language to be used
|
||||
* @param bool $local: If set, we are looking for the "local" title field
|
||||
* @param string $addWhere: additional WHERE clause
|
||||
*
|
||||
* @return array An array of names of countries
|
||||
*/
|
||||
public function initCountries($param = 'UN', $lang = '', $local = false, $addWhere = '')
|
||||
{
|
||||
$nameArray = [];
|
||||
$table = $this->tables['COUNTRIES'];
|
||||
if (!$lang) {
|
||||
$lang = LocalizationUtility::getCurrentLanguage();
|
||||
$lang = LocalizationUtility::getIsoLanguageKey($lang);
|
||||
}
|
||||
$titleFields = LocalizationUtility::getLabelFields($table, $lang, $local);
|
||||
$prefixedTitleFields = [];
|
||||
$prefixedTitleFields[] = $table . '.cn_iso_3';
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
$prefixedTitleFields[] = $table . '.' . $titleField;
|
||||
}
|
||||
array_unique($prefixedTitleFields);
|
||||
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable($table);
|
||||
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||||
$queryBuilder
|
||||
->select($prefixedTitleFields[0])
|
||||
->from($table);
|
||||
array_shift($prefixedTitleFields);
|
||||
foreach ($prefixedTitleFields as $titleField) {
|
||||
$queryBuilder->addSelect($titleField);
|
||||
}
|
||||
if ($param === 'UN') {
|
||||
$queryBuilder->where($queryBuilder->expr()->eq('cn_uno_member', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT)));
|
||||
} elseif ($param === 'EU') {
|
||||
$queryBuilder->where($queryBuilder->expr()->eq('cn_eu_member', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT)));
|
||||
}
|
||||
if ($addWhere) {
|
||||
$addWhere = QueryHelper::stripLogicalOperatorPrefix($addWhere);
|
||||
if (empty($queryBuilder->getQueryPart('where'))) {
|
||||
$queryBuilder->where($addWhere);
|
||||
} else {
|
||||
$queryBuilder->andWhere($addWhere);
|
||||
}
|
||||
}
|
||||
$query = $queryBuilder->execute();
|
||||
while ($row = $query->fetch()) {
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
if ($row[$titleField] ?? false) {
|
||||
$nameArray[$row['cn_iso_3']] = $row[$titleField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($this->conf['countriesAllowed']) && $this->conf['countriesAllowed'] != '') {
|
||||
$countriesAllowedArray = GeneralUtility::trimExplode(',', $this->conf['countriesAllowed']);
|
||||
$newNameArray = [];
|
||||
foreach ($countriesAllowedArray as $iso3) {
|
||||
if (isset($nameArray[$iso3])) {
|
||||
$newNameArray[$iso3] = $nameArray[$iso3];
|
||||
}
|
||||
}
|
||||
$nameArray = $newNameArray;
|
||||
} else {
|
||||
uasort($nameArray, 'strcoll');
|
||||
}
|
||||
return $nameArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting all country subdivisions of a given country into an array
|
||||
* where the key is the code of the subdivision
|
||||
* and where the value is the name of the country subdivision in the current language
|
||||
* You can leave the ISO code empty and use the additional WHERE clause instead of it.
|
||||
*
|
||||
* @param string The ISO alpha-3 code of a country
|
||||
* @param string additional WHERE clause
|
||||
* @param mixed $param
|
||||
* @param mixed $addWhere
|
||||
*
|
||||
* @return array An array of names of country subdivisions
|
||||
*/
|
||||
public function initCountrySubdivisions($param, $addWhere='')
|
||||
{
|
||||
$nameArray = [];
|
||||
$table = $this->tables['SUBDIVISIONS'];
|
||||
$lang = LocalizationUtility::getCurrentLanguage();
|
||||
$lang = LocalizationUtility::getIsoLanguageKey($lang);
|
||||
$titleFields = LocalizationUtility::getLabelFields($table, $lang);
|
||||
$prefixedTitleFields = [];
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
$prefixedTitleFields[] = $table . '.' . $titleField;
|
||||
}
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable($table);
|
||||
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||||
$queryBuilder
|
||||
->select($table . '.zn_code')
|
||||
->from($table);
|
||||
foreach ($prefixedTitleFields as $titleField) {
|
||||
$queryBuilder->addSelect($titleField);
|
||||
}
|
||||
if (strlen($param) == 3) {
|
||||
$queryBuilder->where($queryBuilder->expr()->eq('zn_country_iso_3', $queryBuilder->createNamedParameter($param, \PDO::PARAM_STR)));
|
||||
}
|
||||
if ($addWhere) {
|
||||
$addWhere = QueryHelper::stripLogicalOperatorPrefix($addWhere);
|
||||
if (empty($queryBuilder->getQueryPart('where'))) {
|
||||
$queryBuilder->where($addWhere);
|
||||
} else {
|
||||
$queryBuilder->andWhere($addWhere);
|
||||
}
|
||||
}
|
||||
$query = $queryBuilder->execute();
|
||||
while ($row = $query->fetch()) {
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
if ($row[$titleField] ?? false) {
|
||||
$nameArray[$row['zn_code']] = $row[$titleField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
uasort($nameArray, 'strcoll');
|
||||
return $nameArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting all currencies into an array
|
||||
* where the key is the ISO alpha-3 code of the currency
|
||||
* and where the value are the name of the currency in the current language
|
||||
*
|
||||
* @param string additional WHERE clause
|
||||
* @param mixed $addWhere
|
||||
*
|
||||
* @return array An array of names of currencies
|
||||
*/
|
||||
public function initCurrencies($addWhere='')
|
||||
{
|
||||
$nameArray = [];
|
||||
$table = $this->tables['CURRENCIES'];
|
||||
$lang = LocalizationUtility::getCurrentLanguage();
|
||||
$lang = LocalizationUtility::getIsoLanguageKey($lang);
|
||||
$titleFields = LocalizationUtility::getLabelFields($table, $lang);
|
||||
$prefixedTitleFields = [];
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
$prefixedTitleFields[] = $table . '.' . $titleField;
|
||||
}
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable($table);
|
||||
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||||
$queryBuilder
|
||||
->select($table . '.cu_iso_3')
|
||||
->from($table);
|
||||
foreach ($prefixedTitleFields as $titleField) {
|
||||
$queryBuilder->addSelect($titleField);
|
||||
}
|
||||
if ($addWhere) {
|
||||
$addWhere = QueryHelper::stripLogicalOperatorPrefix($addWhere);
|
||||
$queryBuilder->where($addWhere);
|
||||
}
|
||||
$query = $queryBuilder->execute();
|
||||
while ($row = $query->fetch()) {
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
if ($row[$titleField] ?? false) {
|
||||
$nameArray[$row['cu_iso_3']] = $row[$titleField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
uasort($nameArray, 'strcoll');
|
||||
return $nameArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getting all languages into an array
|
||||
* where the key is the ISO alpha-2 code of the language
|
||||
* and where the value are the name of the language in the current language
|
||||
* Note: we exclude sacred and constructed languages
|
||||
*
|
||||
* @param string $addWhere: additional WHERE clause
|
||||
*
|
||||
* @return array An array of names of languages
|
||||
*/
|
||||
public function initLanguages($addWhere = '')
|
||||
{
|
||||
$nameArray = [];
|
||||
$table = $this->tables['LANGUAGES'];
|
||||
$lang = LocalizationUtility::getCurrentLanguage();
|
||||
$lang = LocalizationUtility::getIsoLanguageKey($lang);
|
||||
$titleFields = LocalizationUtility::getLabelFields($table, $lang);
|
||||
$prefixedTitleFields = [];
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
$prefixedTitleFields[] = $table . '.' . $titleField;
|
||||
}
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable($table);
|
||||
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||||
$queryBuilder
|
||||
->select($table . '.lg_iso_2')
|
||||
->addSelect($table . '.lg_country_iso_2')
|
||||
->from($table);
|
||||
foreach ($prefixedTitleFields as $titleField) {
|
||||
$queryBuilder->addSelect($titleField);
|
||||
}
|
||||
$queryBuilder->where(
|
||||
$queryBuilder->expr()->eq('lg_sacred', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
|
||||
$queryBuilder->expr()->eq('lg_constructed', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
|
||||
);
|
||||
if ($addWhere) {
|
||||
$addWhere = QueryHelper::stripLogicalOperatorPrefix($addWhere);
|
||||
$queryBuilder->andWhere($addWhere);
|
||||
}
|
||||
$query = $queryBuilder->execute();
|
||||
while ($row = $query->fetch()) {
|
||||
$code = $row['lg_iso_2'] . ($row['lg_country_iso_2'] ? '_' . $row['lg_country_iso_2'] : '');
|
||||
foreach ($titleFields as $titleField => $map) {
|
||||
if ($row[$titleField] ?? false) {
|
||||
$nameArray[$code] = $row[$titleField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
uasort($nameArray, 'strcoll');
|
||||
return $nameArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loading currency display parameters from Static Info Tables
|
||||
*
|
||||
* @param string $currencyCode: An ISO alpha-3 currency code
|
||||
*
|
||||
* @return array An array of information regarding the currrency
|
||||
*/
|
||||
public function loadCurrencyInfo($currencyCode)
|
||||
{
|
||||
// Fetching the currency record
|
||||
$this->currencyInfo['cu_iso_3'] = trim($currencyCode);
|
||||
$this->currencyInfo['cu_iso_3'] = $this->currencyInfo['cu_iso_3'] ?: $this->currency;
|
||||
$currency = $this->currencyRepository->findOneByIsoCodeA3($this->currencyInfo['cu_iso_3']);
|
||||
// If not found we fetch the default currency!
|
||||
if (!($currency instanceof Currency)) {
|
||||
$this->currencyInfo['cu_iso_3'] = $this->currency;
|
||||
$currency = $this->currencyRepository->findOneByIsoCodeA3($this->currencyInfo['cu_iso_3']);
|
||||
}
|
||||
if ($currency instanceof Currency) {
|
||||
$this->currencyInfo['cu_name'] = $this->getStaticInfoName('CURRENCIES', $this->currencyInfo['cu_iso_3']);
|
||||
$this->currencyInfo['cu_symbol_left'] = $currency->getSymbolLeft();
|
||||
$this->currencyInfo['cu_symbol_right'] = $currency->getSymbolRight();
|
||||
$this->currencyInfo['cu_decimal_digits'] = $currency->getDecimalDigits();
|
||||
$this->currencyInfo['cu_decimal_point'] = $currency->getDecimalPoint();
|
||||
$this->currencyInfo['cu_thousands_point'] = $currency->getThousandsPoint();
|
||||
}
|
||||
return $this->currencyInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formatting an amount in the currency loaded by loadCurrencyInfo($currencyCode)
|
||||
*
|
||||
* '' - the currency code is not displayed
|
||||
* 'RIGHT' - the code is displayed at the right of the amount
|
||||
* 'LEFT' - the code is displayed at the left of the amount
|
||||
*
|
||||
* @param float $amount: An amount to be displayed in the loaded currency
|
||||
* @param string $displayCurrencyCode: A flag specifying if the the currency code should be displayed:
|
||||
*
|
||||
* @return string The formated amounted
|
||||
*/
|
||||
public function formatAmount($amount, $displayCurrencyCode = '')
|
||||
{
|
||||
$formatedAmount = '';
|
||||
if ($displayCurrencyCode === 'LEFT') {
|
||||
$formatedAmount .= $this->currencyInfo['cu_iso_3'] . chr(32);
|
||||
}
|
||||
$formatedAmount .= $this->currencyInfo['cu_symbol_left'];
|
||||
$formatedAmount .= number_format($amount, (int)$this->currencyInfo['cu_decimal_digits'], $this->currencyInfo['cu_decimal_point'], (($this->currencyInfo['cu_thousands_point']) ? $this->currencyInfo['cu_thousands_point'] : chr(32)));
|
||||
$formatedAmount .= (($this->currencyInfo['cu_symbol_right']) ? chr(32) : '') . $this->currencyInfo['cu_symbol_right'];
|
||||
if ($displayCurrencyCode === 'RIGHT') {
|
||||
$formatedAmount .= chr(32) . $this->currencyInfo['cu_iso_3'];
|
||||
}
|
||||
return $formatedAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formatting an address in the format specified
|
||||
*
|
||||
* @param string $delim: A delimiter for the fields of the returned address
|
||||
* @param string $streetAddress: A street address
|
||||
* @param string $city: A city
|
||||
* @param string $zip: A zip code
|
||||
* @param string $subdivisionCode: A country subdivision code (zn_code)
|
||||
* @param string $countryCode: A ISO alpha-3 country code (cn_iso_3)
|
||||
*
|
||||
* @return string The formated address using the country address format (cn_address_format)
|
||||
*/
|
||||
public function formatAddress($delim, $streetAddress, $city, $zip, $subdivisionCode = '', $countryCode = '')
|
||||
{
|
||||
$formatedAddress = '';
|
||||
$countryCode = ($countryCode ? trim($countryCode) : $this->defaultCountry);
|
||||
$subdivisionCode = ($subdivisionCode ? trim($subdivisionCode) : ($countryCode == $this->defaultCountry ? $this->defaultCountryZone : ''));
|
||||
// Get country name
|
||||
$countryName = $this->getStaticInfoName('COUNTRIES', $countryCode);
|
||||
if ($countryName) {
|
||||
// Get address format
|
||||
$country = $this->countryRepository->findOneByIsoCodeA3($countryCode);
|
||||
if (is_object($country)) {
|
||||
$addressFormat = $country->getAddressFormat();
|
||||
// Get country subdivision name
|
||||
$countrySubdivisionName = $this->getStaticInfoName('SUBDIVISIONS', $subdivisionCode, $countryCode);
|
||||
// Format the address
|
||||
$formatedAddress = $this->conf['addressFormat.'][$addressFormat];
|
||||
$formatedAddress = str_replace('%street', $streetAddress, $formatedAddress);
|
||||
$formatedAddress = str_replace('%city', $city, $formatedAddress);
|
||||
$formatedAddress = str_replace('%zip', $zip, $formatedAddress);
|
||||
$formatedAddress = str_replace('%countrySubdivisionCode', $subdivisionCode, $formatedAddress);
|
||||
$formatedAddress = str_replace('%countrySubdivisionName', $countrySubdivisionName, $formatedAddress);
|
||||
$formatedAddress = str_replace('%countryName', strtoupper($countryName), $formatedAddress);
|
||||
$formatedAddress = implode($delim, GeneralUtility::trimExplode(';', $formatedAddress, 1));
|
||||
}
|
||||
}
|
||||
return $formatedAddress;
|
||||
}
|
||||
}
|
||||
class_alias('SJBR\\StaticInfoTables\\PiBaseApi', 'tx_staticinfotables_pi1');
|
||||
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Service;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Verify TYPO3 DB table structure. Mainly used in install tool
|
||||
* compare wizard and extension manager.
|
||||
* Removed form Install extension in TYPO3 9 LTS
|
||||
*/
|
||||
class SqlSchemaMigrationService
|
||||
{
|
||||
/**
|
||||
* @constant Maximum field width of MySQL
|
||||
*/
|
||||
const MYSQL_MAXIMUM_FIELD_WIDTH = 64;
|
||||
|
||||
/**
|
||||
* @var string Prefix of deleted tables
|
||||
*/
|
||||
protected $deletedPrefixKey = 'zzz_deleted_';
|
||||
|
||||
/**
|
||||
* @var array Caching output "SHOW CHARACTER SET"
|
||||
*/
|
||||
protected $character_sets = [];
|
||||
|
||||
/**
|
||||
* Reads the field definitions for the current database
|
||||
*
|
||||
* @return array Array with information about table.
|
||||
*/
|
||||
public function getFieldDefinitions_database()
|
||||
{
|
||||
$total = [];
|
||||
$tempKeys = [];
|
||||
$tempKeysPrefix = [];
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionByName('Default');
|
||||
$statement = $connection->query('SHOW TABLE STATUS FROM `' . $connection->getDatabase() . '`');
|
||||
$tables = [];
|
||||
while ($theTable = $statement->fetch()) {
|
||||
$tables[$theTable['Name']] = $theTable;
|
||||
}
|
||||
foreach ($tables as $tableName => $tableStatus) {
|
||||
// Fields
|
||||
$statement = $connection->query('SHOW FULL COLUMNS FROM `' . $tableName . '`');
|
||||
$fieldInformation = [];
|
||||
while ($fieldRow = $statement->fetch()) {
|
||||
$fieldInformation[$fieldRow['Field']] = $fieldRow;
|
||||
}
|
||||
foreach ($fieldInformation as $fN => $fieldRow) {
|
||||
$total[$tableName]['fields'][$fN] = $this->assembleFieldDefinition($fieldRow);
|
||||
}
|
||||
// Keys
|
||||
$statement = $connection->query('SHOW KEYS FROM `' . $tableName . '`');
|
||||
$keyInformation = [];
|
||||
while ($keyRow = $statement->fetch()) {
|
||||
$keyInformation[] = $keyRow;
|
||||
}
|
||||
foreach ($keyInformation as $keyRow) {
|
||||
$keyName = $keyRow['Key_name'];
|
||||
$colName = $keyRow['Column_name'];
|
||||
if ($keyRow['Sub_part'] && $keyRow['Index_type'] !== 'SPATIAL') {
|
||||
$colName .= '(' . $keyRow['Sub_part'] . ')';
|
||||
}
|
||||
$tempKeys[$tableName][$keyName][$keyRow['Seq_in_index']] = $colName;
|
||||
if ($keyName === 'PRIMARY') {
|
||||
$prefix = 'PRIMARY KEY';
|
||||
} else {
|
||||
if ($keyRow['Index_type'] === 'FULLTEXT') {
|
||||
$prefix = 'FULLTEXT';
|
||||
} elseif ($keyRow['Index_type'] === 'SPATIAL') {
|
||||
$prefix = 'SPATIAL';
|
||||
} elseif ($keyRow['Non_unique']) {
|
||||
$prefix = 'KEY';
|
||||
} else {
|
||||
$prefix = 'UNIQUE';
|
||||
}
|
||||
$prefix .= ' ' . $keyName;
|
||||
}
|
||||
$tempKeysPrefix[$tableName][$keyName] = $prefix;
|
||||
}
|
||||
// Table status (storage engine, collaction, etc.)
|
||||
if (is_array($tableStatus)) {
|
||||
$tableExtraFields = [
|
||||
'Engine' => 'ENGINE',
|
||||
'Collation' => 'COLLATE',
|
||||
];
|
||||
foreach ($tableExtraFields as $mysqlKey => $internalKey) {
|
||||
if (isset($tableStatus[$mysqlKey])) {
|
||||
$total[$tableName]['extra'][$internalKey] = $tableStatus[$mysqlKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Compile key information:
|
||||
if (!empty($tempKeys)) {
|
||||
foreach ($tempKeys as $table => $keyInf) {
|
||||
foreach ($keyInf as $kName => $index) {
|
||||
ksort($index);
|
||||
$total[$table]['keys'][$kName] = $tempKeysPrefix[$table][$kName] . ' (' . implode(',', $index) . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a result row with field information into the SQL field definition string
|
||||
*
|
||||
* @param array $row MySQL result row
|
||||
*
|
||||
* @return string Field definition
|
||||
*/
|
||||
public function assembleFieldDefinition($row)
|
||||
{
|
||||
$field = [$row['Type']];
|
||||
if ($row['Null'] === 'NO') {
|
||||
$field[] = 'NOT NULL';
|
||||
}
|
||||
if (!strstr($row['Type'], 'blob') && !strstr($row['Type'], 'text')) {
|
||||
// Add a default value if the field is not auto-incremented (these fields never have a default definition)
|
||||
if (!stristr($row['Extra'], 'auto_increment')) {
|
||||
if ($row['Default'] === null) {
|
||||
$field[] = 'default NULL';
|
||||
} else {
|
||||
$field[] = 'default \'' . addslashes($row['Default']) . '\'';
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($row['Extra']) {
|
||||
$field[] = $row['Extra'];
|
||||
}
|
||||
if (trim($row['Comment'] ?? '') !== '') {
|
||||
$field[] = "COMMENT '" . $row['Comment'] . "'";
|
||||
}
|
||||
return implode(' ', $field);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Utility;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2022 StanislasRolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use Doctrine\DBAL\DBALException;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Schema\SchemaMigrator;
|
||||
use TYPO3\CMS\Core\Database\Schema\SqlReader;
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
|
||||
|
||||
/**
|
||||
* Utility used by the update script of the base extension and of the language packs
|
||||
*/
|
||||
class DatabaseUpdateUtility
|
||||
{
|
||||
/**
|
||||
* @var string Name of the extension this class belongs to
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* Do the language pack update
|
||||
*
|
||||
* @param string $extensionKey: extension key of the language pack
|
||||
* @return void
|
||||
*/
|
||||
public function doUpdate($extensionKey)
|
||||
{
|
||||
$result = [];
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
$insertStatements = [];
|
||||
$updateStatements = [];
|
||||
$extPath = ExtensionManagementUtility::extPath($extensionKey);
|
||||
$statements = explode(LF, @file_get_contents($extPath . 'ext_tables_static+adt.sql'));
|
||||
|
||||
foreach ($statements as $statement) {
|
||||
$statement = trim($statement);
|
||||
// Only handle update statements and extract the table at the same time. Extracting
|
||||
// the table name is required to perform the inserts on the right connection.
|
||||
if (preg_match('/^UPDATE\\s+`?(\\w+)`?(.*)/i', $statement, $matches)) {
|
||||
list(, $tableName, $sqlFragment) = $matches;
|
||||
$updateStatements[$tableName][] = sprintf(
|
||||
'UPDATE %s %s',
|
||||
$connectionPool->getConnectionForTable($tableName)->quoteIdentifier($tableName),
|
||||
rtrim($sqlFragment, ';')
|
||||
);
|
||||
}
|
||||
}
|
||||
foreach ($updateStatements as $tableName => $perTableStatements) {
|
||||
$connection = $connectionPool->getConnectionForTable($tableName);
|
||||
foreach ((array)$perTableStatements as $statement) {
|
||||
try {
|
||||
$connection->executeUpdate($statement);
|
||||
$result[$statement] = '';
|
||||
} catch (DBALException $e) {
|
||||
$result[$statement] = $e->getPrevious()->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports a static tables SQL File (ext_tables_static+adt)
|
||||
*
|
||||
* @param string $extensionSitePath
|
||||
* @return void
|
||||
*/
|
||||
public function importStaticSqlFile($extensionSitePath)
|
||||
{
|
||||
$extTablesStaticSqlFile = $extensionSitePath . 'ext_tables_static+adt.sql';
|
||||
$extTablesStaticSqlContent = '';
|
||||
if (file_exists($extTablesStaticSqlFile)) {
|
||||
$extTablesStaticSqlContent .= GeneralUtility::getUrl($extTablesStaticSqlFile);
|
||||
}
|
||||
if ($extTablesStaticSqlContent !== '') {
|
||||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
|
||||
// Drop all tables
|
||||
foreach (array_keys($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'] ?? []) as $tableName) {
|
||||
$connection = $connectionPool->getConnectionForTable($tableName);
|
||||
try {
|
||||
$connection->executeUpdate($connection->getDatabasePlatform()
|
||||
->getDropTableSQL($connection->quoteIdentifier($tableName)));
|
||||
} catch (TableNotFoundException $e) {
|
||||
// Ignore table not found exception
|
||||
}
|
||||
}
|
||||
// Re-create all tables
|
||||
$this->processDatabaseUpdates(GeneralUtility::camelCaseToLowerCaseUnderscored($this->extensionName));
|
||||
$installTool = GeneralUtility::makeInstance(InstallUtility::class);
|
||||
$installTool->importStaticSql($extTablesStaticSqlContent);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the tables SQL File (ext_tables)
|
||||
*
|
||||
* @param string $extensionKey
|
||||
* @return void
|
||||
*/
|
||||
public function processDatabaseUpdates($extensionKey)
|
||||
{
|
||||
$extensionSitePath = ExtensionManagementUtility::extPath($extensionKey);
|
||||
$extTablesSqlFile = $extensionSitePath . 'ext_tables.sql';
|
||||
$extTablesSqlContent = '';
|
||||
if (file_exists($extTablesSqlFile)) {
|
||||
$extTablesSqlContent .= GeneralUtility::getUrl($extTablesSqlFile);
|
||||
}
|
||||
if ($extTablesSqlContent !== '') {
|
||||
// Prevent the DefaultTcaSchema from enriching our definitions
|
||||
$tcaBackup = $GLOBALS['TCA'];
|
||||
$GLOBALS['TCA'] = [];
|
||||
$sqlReader = GeneralUtility::makeInstance(SqlReader::class);
|
||||
$schemaMigrator = GeneralUtility::makeInstance(SchemaMigrator::class);
|
||||
$sqlStatements = [];
|
||||
$sqlStatements[] = $extTablesSqlContent;
|
||||
$sqlStatements = $sqlReader->getCreateTableStatementArray(implode(LF . LF, array_filter($sqlStatements)));
|
||||
$updateStatements = $schemaMigrator->getUpdateSuggestions($sqlStatements);
|
||||
$updateStatements = array_merge_recursive(...array_values($updateStatements));
|
||||
$selectedStatements = [];
|
||||
foreach (['add', 'change', 'create_table', 'change_table'] as $action) {
|
||||
if (empty($updateStatements[$action])) {
|
||||
continue;
|
||||
}
|
||||
$selectedStatements = array_merge(
|
||||
$selectedStatements,
|
||||
array_combine(
|
||||
array_keys($updateStatements[$action]),
|
||||
array_fill(0, count($updateStatements[$action]), true)
|
||||
)
|
||||
);
|
||||
}
|
||||
$schemaMigrator->migrate($sqlStatements, $selectedStatements);
|
||||
$GLOBALS['TCA'] = $tcaBackup;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Utility;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Utility for dealing with database related operations
|
||||
*/
|
||||
class DatabaseUtility implements SingletonInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const MULTI_LINEBREAKS = '
|
||||
|
||||
|
||||
';
|
||||
|
||||
/**
|
||||
* Dump content for static tables
|
||||
*
|
||||
* @param array $dbFields
|
||||
* @return string
|
||||
*/
|
||||
public function dumpStaticTables($dbFields)
|
||||
{
|
||||
$out = '';
|
||||
// Traverse the table list and dump each:
|
||||
foreach ($dbFields as $table => $fields) {
|
||||
if (isset($dbFields[$table]['fields']) && is_array($dbFields[$table]['fields'])) {
|
||||
$header = $this->dumpHeader();
|
||||
$tableHeader = $this->dumpTableHeader($table, $dbFields[$table], true);
|
||||
$insertStatements = $this->dumpTableContent($table, $dbFields[$table]['fields']);
|
||||
$out .= $header . self::MULTI_LINEBREAKS . $tableHeader . self::MULTI_LINEBREAKS . $insertStatements . self::MULTI_LINEBREAKS;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Header comments of the SQL dump file
|
||||
*
|
||||
* @return string Table header
|
||||
*/
|
||||
protected function dumpHeader()
|
||||
{
|
||||
return trim('
|
||||
# TYPO3 Extension Manager dump 1.1
|
||||
#--------------------------------------------------------
|
||||
');
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump CREATE TABLE definition
|
||||
*
|
||||
* @param string $table
|
||||
* @param array $fieldKeyInfo
|
||||
* @param bool $dropTableIfExists
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function dumpTableHeader($table, array $fieldKeyInfo, $dropTableIfExists = false)
|
||||
{
|
||||
$lines = [];
|
||||
$dump = '';
|
||||
// Create field definitions
|
||||
if (isset($fieldKeyInfo['fields']) && is_array($fieldKeyInfo['fields'])) {
|
||||
foreach ($fieldKeyInfo['fields'] as $fieldN => $data) {
|
||||
$lines[] = ' ' . $fieldN . ' ' . $data;
|
||||
}
|
||||
}
|
||||
// Create index key definitions
|
||||
if (isset($fieldKeyInfo['keys']) && is_array($fieldKeyInfo['keys'])) {
|
||||
foreach ($fieldKeyInfo['keys'] as $fieldN => $data) {
|
||||
$lines[] = ' ' . $data;
|
||||
}
|
||||
}
|
||||
// Compile final output:
|
||||
if (!empty($lines)) {
|
||||
$dump = trim('
|
||||
#
|
||||
# Table structure for table "' . $table . '"
|
||||
#
|
||||
' . ($dropTableIfExists ? 'DROP TABLE IF EXISTS ' . $table . ';
|
||||
' : '') . 'CREATE TABLE ' . $table . ' (
|
||||
' . implode((',' . LF), $lines) . '
|
||||
);');
|
||||
}
|
||||
return $dump;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump table content
|
||||
* Is DBAL compliant, but the dump format is written as MySQL standard.
|
||||
* If the INSERT statements should be imported in a DBMS using other
|
||||
* quoting than MySQL they must first be translated.
|
||||
*
|
||||
* @param string $table Table name
|
||||
* @param array $fieldStructure Field structure
|
||||
*
|
||||
* @return string SQL Content of dump (INSERT statements)
|
||||
*/
|
||||
protected function dumpTableContent($table, array $fieldStructure)
|
||||
{
|
||||
// Substitution of certain characters (borrowed from phpMySQL):
|
||||
$search = ['\\', '\'', "\0", "\n", "\r", "\x1A"];
|
||||
$replace = ['\\\\', '\\\'', '\\0', '\\n', '\\r', '\\Z'];
|
||||
$lines = [];
|
||||
// Names of inserted fields
|
||||
$fieldList = implode (', ', array_keys($fieldStructure));
|
||||
// Select all rows from the table:
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable($table);
|
||||
$queryBuilder->getRestrictions()
|
||||
->removeAll();
|
||||
$result = $queryBuilder->select('*')
|
||||
->from($table)
|
||||
->execute();
|
||||
// Traverse the selected rows and dump each row as a line in the file:
|
||||
while ($row = $result->fetch()) {
|
||||
$values = [];
|
||||
foreach ($fieldStructure as $field => $structure) {
|
||||
$values[] = isset($row[$field]) ? '\'' . str_replace($search, $replace, $row[$field]) . '\'' : 'NULL';
|
||||
}
|
||||
$lines[] = 'INSERT INTO ' . $table . ' (' . $fieldList . ')' . ' VALUES (' . implode(', ', $values) . ');';
|
||||
}
|
||||
// Implode lines and return:
|
||||
return implode(LF, $lines);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Utility;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2017 StanislasRolland <typo3@sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
/**
|
||||
* HTML form element utility functions
|
||||
*/
|
||||
class HtmlElementUtility
|
||||
{
|
||||
/**
|
||||
* Buils a HTML drop-down selector of countries, country subdivisions, currencies or languages
|
||||
*
|
||||
* @param array $items: An array of couples ('name', 'value) where the names will be the texts of an <option> tags and values will be the values of the tags
|
||||
* @param array $selected: The values of the code of the entries to be pre-selected in the drop-down selector
|
||||
* @param array $outSelected: resulting array of keys of selected items
|
||||
* @param string $name: A value for the name attribute of the <select> tag
|
||||
* @param string $class: A value for the class attribute of the <select> tag
|
||||
* @param string $id: A value for the id attribute of the <select> tag
|
||||
* @param string $title: A value for the title attribute of the <select> tag
|
||||
* @param string $onChange: A value for the onChange attribute of the <select> tag
|
||||
* @param int $size: max elements that can be selected. Default: 1
|
||||
*
|
||||
* @return string A set of HTML <select> and <option> tags
|
||||
*/
|
||||
public static function selectConstructor($items, $selected = [], &$outSelected = [], $name = '', $class = '', $id = '', $title = '', $onChange = '', $size = 1)
|
||||
{
|
||||
$selector = '';
|
||||
if (is_array($items) && count($items) > 0) {
|
||||
$idAttribute = (trim($id)) ? 'id="' . htmlspecialchars(trim($id)) . '" ' : '';
|
||||
$nameAttribute = (trim($name)) ? 'name="' . htmlspecialchars(trim($name)) . '" ' : '';
|
||||
$titleAttribute = (trim($title)) ? 'title="' . htmlspecialchars(trim($title)) . '" ' : '';
|
||||
$classAttribute = (trim($class)) ? 'class="' . htmlspecialchars(trim($class)) . '" ' : '';
|
||||
|
||||
if ($onChange) {
|
||||
$onChangeAttribute = $onChange;
|
||||
$onChangeAttribute = str_replace('"', '\'', $onChangeAttribute);
|
||||
$onChangeAttribute = self::quoteJsValue($onChangeAttribute);
|
||||
$onChangeAttribute = 'onchange=' . $onChangeAttribute . ' ';
|
||||
} else {
|
||||
$onChangeAttribute = '';
|
||||
}
|
||||
|
||||
if ($size > 1) {
|
||||
$multiple = 'multiple="multiple" ';
|
||||
$name .= '[]';
|
||||
} else {
|
||||
$multiple = '';
|
||||
}
|
||||
|
||||
$selector = '<select size="' . $size . '" ' . $idAttribute . $nameAttribute . $titleAttribute . $classAttribute . $onChangeAttribute . $multiple . '>' . LF;
|
||||
$selector .= self::optionsConstructor($items, $selected, $outSelected);
|
||||
$selector .= '</select>' . LF;
|
||||
}
|
||||
return $selector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a list of <option> tags
|
||||
*
|
||||
* @param array $items: An array where the values will be the texts of an <option> tags and keys will be the values of the tags
|
||||
* @param string $selected: array of pre-selected values: if the value appears as a key, the <option> tag will bear a 'selected' attribute
|
||||
* @param array $outSelected: resulting array of keys of selected items
|
||||
*
|
||||
* @return string A string of HTML <option> tags
|
||||
*/
|
||||
public static function optionsConstructor($items, $selected = [], &$outSelected = [])
|
||||
{
|
||||
$options = '';
|
||||
foreach ($items as $item) {
|
||||
$options .= '<option value="' . $item['value'] . '"';
|
||||
if (in_array($item['value'], $selected)) {
|
||||
$options .= ' selected="selected"';
|
||||
$outSelected[] = $item['value'];
|
||||
}
|
||||
$options .= '>' . $item['name'] . '</option>' . LF;
|
||||
}
|
||||
if (!isset($outSelected) || count($outSelected) == 0) {
|
||||
reset($items);
|
||||
$outSelected = [$items[0]['value']];
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Quotes a string for usage as JS parameter.
|
||||
*
|
||||
* @param string The string to encode.
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return string The encoded value already quoted
|
||||
*/
|
||||
protected static function quoteJsValue($value)
|
||||
{
|
||||
$value = addcslashes($value, '"' . LF . CR);
|
||||
$value = htmlspecialchars($value);
|
||||
return '"' . $value . '"';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Utility;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2013-2021 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\Language;
|
||||
use TYPO3\CMS\Core\Localization\Locales;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
/**
|
||||
* Locale-related functions
|
||||
*/
|
||||
class LocaleUtility
|
||||
{
|
||||
/**
|
||||
* @var string Name of the extension this class belongs to
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* Get the typo3-supported locale options
|
||||
*
|
||||
* @return array An array of language objects
|
||||
*/
|
||||
public function getLocales()
|
||||
{
|
||||
$localeArray = [];
|
||||
$locales = GeneralUtility::makeInstance(Locales::class);
|
||||
$languages = $locales->getLanguages();
|
||||
foreach ($languages as $locale => $language) {
|
||||
// No language pack for English
|
||||
if ($locale != 'default') {
|
||||
$languageObject = new Language();
|
||||
$languageObject->setCollatingLocale($locale);
|
||||
$localizedLanguage = LocalizationUtility::translate('lang_' . $locale, $this->extensionName);
|
||||
$label = ($localizedLanguage ? $localizedLanguage : $language) . ' (' . $locale . ')';
|
||||
$languageObject->setNameEn($label);
|
||||
$localeArray[$label] = $languageObject;
|
||||
}
|
||||
}
|
||||
ksort($localeArray);
|
||||
return $localeArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get language name from locale
|
||||
*
|
||||
* @param string $locale
|
||||
* @return string Language name
|
||||
*/
|
||||
public function getLanguageFromLocale($locale)
|
||||
{
|
||||
$locales = GeneralUtility::makeInstance(Locales::class);
|
||||
$languages = $locales->getLanguages();
|
||||
return $languages[$locale];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,378 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\Utility;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2009 Sebastian Kurfürst <sebastian@typo3.org>
|
||||
* (c) 2013-2022 Stanislas Rolland <typo3AAAA@sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use SJBR\StaticInfoTables\Domain\Model\Language;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Http\ApplicationType;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Localization\Locales;
|
||||
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Utility\MathUtility;
|
||||
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
|
||||
|
||||
/**
|
||||
* Localization helper which should be used to fetch localized labels for static info entities.
|
||||
*/
|
||||
class LocalizationUtility
|
||||
{
|
||||
/**
|
||||
* Key of the language to use
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $languageKey = 'default';
|
||||
|
||||
/**
|
||||
* Pointer to alternative fall-back language to use
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $alternativeLanguageKeys = [];
|
||||
|
||||
/**
|
||||
* Collating locale for the language in use
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static $collatingLocale = '';
|
||||
|
||||
/**
|
||||
* Returns the localized label for a static info entity
|
||||
*
|
||||
* @param array $identifiers An array with key 1- 'uid' containing a uid and/or 2- 'iso' containing one or two iso codes (i.e. country zone code and country code, or language code and country code)
|
||||
* @param string $tableName The name of the table
|
||||
* @param bool local name only - if set local labels are returned
|
||||
* @param mixed $local
|
||||
* @return string The value from the label field of the table
|
||||
*/
|
||||
public static function translate($identifiers, $tableName, $local = false)
|
||||
{
|
||||
$value = '';
|
||||
self::setLanguageKeys();
|
||||
$isoLanguage = self::getIsoLanguageKey(self::$languageKey);
|
||||
$value = self::getLabelFieldValue($identifiers, $tableName, $isoLanguage, $local);
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the localized value for the label field
|
||||
*
|
||||
* @param array $identifiers An array with key 1- 'uid' containing a uid and/or 2- 'iso' containing one or two iso codes (i.e. country zone code and country code, or language code and country code)
|
||||
* @param string $tableName The name of the table
|
||||
* @param string language ISO code
|
||||
* @param bool local name only - if set local labels are returned
|
||||
* @param mixed $language
|
||||
* @param mixed $local
|
||||
*
|
||||
* @return string the value for the label field
|
||||
*/
|
||||
public static function getLabelFieldValue($identifiers, $tableName, $language, $local = false)
|
||||
{
|
||||
$value = '';
|
||||
$labelFields = self::getLabelFields($tableName, $language, $local);
|
||||
if (count($labelFields)) {
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($tableName);
|
||||
$queryBuilder->from($tableName)->select('uid');
|
||||
foreach ($labelFields as $labelField => $map) {
|
||||
$queryBuilder->addSelect($labelField);
|
||||
}
|
||||
$whereCount = 0;
|
||||
if ($identifiers['uid'] ?? false) {
|
||||
$queryBuilder->where(
|
||||
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$identifiers['uid']), \PDO::PARAM_INT)
|
||||
);
|
||||
$whereCount++;
|
||||
} elseif (!empty($identifiers['iso'])) {
|
||||
$isoCode = is_array($identifiers['iso']) ? $identifiers['iso'] : [$identifiers['iso']];
|
||||
foreach ($isoCode as $index => $code) {
|
||||
if ($code) {
|
||||
$field = self::getIsoCodeField($tableName, $code, $index);
|
||||
if ($field) {
|
||||
if ($whereCount) {
|
||||
$queryBuilder->andWhere(
|
||||
$queryBuilder->expr()->eq($field, $queryBuilder->createNamedParameter($code))
|
||||
);
|
||||
$whereCount++;
|
||||
} else {
|
||||
$queryBuilder->where(
|
||||
$queryBuilder->expr()->eq($field, $queryBuilder->createNamedParameter($code))
|
||||
);
|
||||
$whereCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Get the entity
|
||||
if ($whereCount) {
|
||||
$row = $queryBuilder->execute()->fetch();
|
||||
if ($row) {
|
||||
foreach ($labelFields as $labelField => $map) {
|
||||
if ($row[$labelField]) {
|
||||
$value = $row[$labelField];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the label fields for a given language
|
||||
*
|
||||
* @param string table name
|
||||
* @param string ISO language code to be used
|
||||
* @param bool If set, we are looking for the "local" title field
|
||||
* @param mixed $tableName
|
||||
* @param mixed $lang
|
||||
* @param mixed $local
|
||||
* @return array field names
|
||||
*/
|
||||
public static function getLabelFields($tableName, $lang, $local = false)
|
||||
{
|
||||
$labelFields = [];
|
||||
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$tableName]['label_fields'])
|
||||
&& is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$tableName]['label_fields'])) {
|
||||
$alternativeLanguages = [];
|
||||
if (count(self::$alternativeLanguageKeys)) {
|
||||
$alternativeLanguages = array_reverse(self::$alternativeLanguageKeys);
|
||||
}
|
||||
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$tableName]['label_fields'] as $field => $map) {
|
||||
if ($local) {
|
||||
$labelField = str_replace('##', 'local', $field);
|
||||
$property = str_replace('##', 'Local', $map['mapOnProperty']);
|
||||
} else {
|
||||
$labelField = str_replace('##', strtolower($lang), $field);
|
||||
$property = str_replace('##', ucfirst(strtolower($lang)), $map['mapOnProperty']);
|
||||
}
|
||||
// Make sure the resulting field name exists in the table
|
||||
if (isset($GLOBALS['TCA'][$tableName]['columns'][$labelField])
|
||||
&& is_array($GLOBALS['TCA'][$tableName]['columns'][$labelField])
|
||||
) {
|
||||
$labelFields[$labelField] = ['mapOnProperty' => $property];
|
||||
}
|
||||
// Add fields for alternative languages
|
||||
if (strpos($field, '##') !== false && count($alternativeLanguages)) {
|
||||
foreach ($alternativeLanguages as $language) {
|
||||
$labelField = str_replace('##', strtolower($language), $field);
|
||||
$property = str_replace('##', ucfirst(strtolower($language)), $map['mapOnProperty']);
|
||||
// Make sure the resulting field name exists in the table
|
||||
if (is_array($GLOBALS['TCA'][$tableName]['columns'][$labelField])) {
|
||||
$labelFields[$labelField] = ['mapOnProperty' => $property];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $labelFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a iso code field for the passed table name, iso code and index
|
||||
*
|
||||
* @param string table name
|
||||
* @param string iso code
|
||||
* @param int index in the table's isocode_field configuration array
|
||||
* @param mixed $table
|
||||
* @param mixed $isoCode
|
||||
* @param mixed $index
|
||||
* @return string field name
|
||||
*/
|
||||
public static function getIsoCodeField($table, $isoCode, $index = 0)
|
||||
{
|
||||
$isoCodeField = '';
|
||||
$isoCodeFieldTemplate = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'][$table]['isocode_field'][$index] ?? '';
|
||||
if ($isoCode && $table && $isoCodeFieldTemplate) {
|
||||
$field = str_replace('##', self::isoCodeType($isoCode), $isoCodeFieldTemplate);
|
||||
if (is_array($GLOBALS['TCA'][$table]['columns'][$field])) {
|
||||
$isoCodeField = $field;
|
||||
}
|
||||
}
|
||||
return $isoCodeField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of an iso code: nr, 2, 3
|
||||
*
|
||||
* @param string iso code
|
||||
* @param mixed $isoCode
|
||||
*
|
||||
* @return string iso code type
|
||||
*/
|
||||
protected static function isoCodeType($isoCode)
|
||||
{
|
||||
$type = '';
|
||||
$isoCodeAsInteger = MathUtility::canBeInterpretedAsInteger($isoCode);
|
||||
if ($isoCodeAsInteger) {
|
||||
$type = 'nr';
|
||||
} elseif (strlen($isoCode) == 2) {
|
||||
$type = '2';
|
||||
} elseif (strlen($isoCode) == 3) {
|
||||
$type = '3';
|
||||
}
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ISO language key corresponding to a TYPO3 language key
|
||||
*
|
||||
* @param string $key The TYPO3 language key
|
||||
*
|
||||
* @return string the ISO language key
|
||||
*/
|
||||
public static function getIsoLanguageKey($key)
|
||||
{
|
||||
return $key === 'default' ? 'EN' : $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current TYPO3 language
|
||||
*
|
||||
* @return string the TYP3 language key
|
||||
*/
|
||||
public static function getCurrentLanguage()
|
||||
{
|
||||
if (self::$languageKey === 'default') {
|
||||
self::setLanguageKeys();
|
||||
}
|
||||
return self::$languageKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the currently active language/language_alt keys.
|
||||
* Default values are "default" for language key and "" for language_alt key.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function setLanguageKeys()
|
||||
{
|
||||
self::$languageKey = 'default';
|
||||
self::$alternativeLanguageKeys = [];
|
||||
if (($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface
|
||||
&& ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()
|
||||
) {
|
||||
$tsfe = static::getTypoScriptFrontendController();
|
||||
$siteLanguage = self::getCurrentSiteLanguage();
|
||||
// Get values from site language, which takes precedence over TypoScript settings
|
||||
if ($siteLanguage instanceof SiteLanguage) {
|
||||
self::$languageKey = $siteLanguage->getTypo3Language();
|
||||
} elseif (isset($tsfe->config['config']['language'])) {
|
||||
self::$languageKey = $tsfe->config['config']['language'];
|
||||
}
|
||||
if (isset($tsfe->config['config']['language_alt'])) {
|
||||
self::$alternativeLanguageKeys[] = $tsfe->config['config']['language_alt'];
|
||||
}
|
||||
if (empty(self::$alternativeLanguageKeys)) {
|
||||
$locales = GeneralUtility::makeInstance(Locales::class);
|
||||
if (in_array(self::$languageKey, $locales->getLocales())) {
|
||||
foreach ($locales->getLocaleDependencies(self::$languageKey) as $language) {
|
||||
self::$alternativeLanguageKeys[] = $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($GLOBALS['BE_USER']->uc['lang'])) {
|
||||
self::$languageKey = $GLOBALS['BE_USER']->uc['lang'];
|
||||
} elseif (!empty(static::getLanguageService()->lang)) {
|
||||
self::$languageKey = static::getLanguageService()->lang;
|
||||
}
|
||||
// Get standard locale dependencies for the backend
|
||||
$locales = GeneralUtility::makeInstance(Locales::class);
|
||||
if (in_array(self::$languageKey, $locales->getLocales())) {
|
||||
foreach ($locales->getLocaleDependencies(self::$languageKey) as $language) {
|
||||
self::$alternativeLanguageKeys[] = $language;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!self::$languageKey || self::$languageKey === 'default') {
|
||||
self::$languageKey = 'EN';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the collating locale
|
||||
*
|
||||
* @return mixed the set locale or false
|
||||
*/
|
||||
public static function setCollatingLocale()
|
||||
{
|
||||
if (self::$collatingLocale === '') {
|
||||
$languageCode = self::getCurrentLanguage();
|
||||
$languageRepository = GeneralUtility::makeInstance(LanguageRepository::class);
|
||||
$languageCodeParts = explode('_', $languageCode, 2);
|
||||
$languageIsoCodeA2 = $languageCodeParts[0] ?? '';
|
||||
$countryIsoCodeA2 = $languageCodeParts[1] ?? '';
|
||||
|
||||
$language = $languageRepository->findOneByIsoCodes($languageIsoCodeA2, $countryIsoCodeA2 ?? '');
|
||||
// If $language is NULL, current language was not found in the Language repository. Most probably, the repository is empty.
|
||||
self::$collatingLocale = ($language instanceof Language) ? $language->getCollatingLocale() : 'en_GB';
|
||||
}
|
||||
return setlocale(
|
||||
LC_COLLATE,
|
||||
[
|
||||
self::$collatingLocale . '.UTF-8',
|
||||
self::$collatingLocale . '.UTF8',
|
||||
self::$collatingLocale . '.utf8',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently configured "site language" if a site is configured (= resolved)
|
||||
* in the current request.
|
||||
*
|
||||
* @return SiteLanguage|null
|
||||
*/
|
||||
protected static function getCurrentSiteLanguage(): ?SiteLanguage
|
||||
{
|
||||
if ($GLOBALS['TYPO3_REQUEST'] instanceof ServerRequestInterface) {
|
||||
return $GLOBALS['TYPO3_REQUEST']->getAttribute('language', null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TypoScriptFrontendController
|
||||
*/
|
||||
protected static function getTypoScriptFrontendController()
|
||||
{
|
||||
return $GLOBALS['TSFE'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LanguageService
|
||||
*/
|
||||
protected static function getLanguageService()
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
namespace SJBR\StaticInfoTables\Utility;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Utility\MathUtility;
|
||||
|
||||
/**
|
||||
* Class with helper functions for version number handling
|
||||
*/
|
||||
class VersionNumberUtility
|
||||
{
|
||||
/**
|
||||
* Splits a version range into an array.
|
||||
*
|
||||
* If a single version number is given, it is considered a minimum value.
|
||||
* If a dash is found, the numbers left and right are considered as minimum and maximum. Empty values are allowed.
|
||||
* If no version can be parsed "0.0.0" — "0.0.0" is the result
|
||||
*
|
||||
* @param string $version A string with a version range.
|
||||
* @return array
|
||||
*/
|
||||
public static function splitVersionRange($version)
|
||||
{
|
||||
$versionRange = [];
|
||||
if (strpos($version, '-') !== false) {
|
||||
$versionRange = explode('-', $version, 2);
|
||||
} else {
|
||||
$versionRange[0] = $version;
|
||||
$versionRange[1] = '';
|
||||
}
|
||||
if (!$versionRange[0]) {
|
||||
$versionRange[0] = '0.0.0';
|
||||
}
|
||||
if (!$versionRange[1]) {
|
||||
$versionRange[1] = '0.0.0';
|
||||
}
|
||||
return $versionRange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the version number x.x.x and returns an array with the various parts.
|
||||
* It also forces each … 0 to 999
|
||||
*
|
||||
* @param string $version Version code, x.x.x
|
||||
* @return array
|
||||
*/
|
||||
public static function convertVersionStringToArray($version)
|
||||
{
|
||||
$parts = GeneralUtility::intExplode('.', $version . '..');
|
||||
$parts[0] = MathUtility::forceIntegerInRange($parts[0], 0, 999);
|
||||
$parts[1] = MathUtility::forceIntegerInRange($parts[1], 0, 999);
|
||||
$parts[2] = MathUtility::forceIntegerInRange($parts[2], 0, 999);
|
||||
$result = [];
|
||||
$result['version'] = $parts[0] . '.' . $parts[1] . '.' . $parts[2];
|
||||
$result['version_int'] = (int)($parts[0] * 1000000 + $parts[1] * 1000 + $parts[2]);
|
||||
$result['version_main'] = $parts[0];
|
||||
$result['version_sub'] = $parts[1];
|
||||
$result['version_dev'] = $parts[2];
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to raise a version number
|
||||
*
|
||||
* @param string $raise one of "main", "sub", "dev" - the version part to raise by one
|
||||
* @param string $version (like 4.1.20)
|
||||
* @return string
|
||||
*/
|
||||
public static function raiseVersionNumber($raise, $version)
|
||||
{
|
||||
if (!in_array($raise, ['main', 'sub', 'dev'])) {
|
||||
throw new Exception('RaiseVersionNumber expects one of "main", "sub" or "dev".', 1342639555);
|
||||
}
|
||||
$parts = GeneralUtility::intExplode('.', $version . '..');
|
||||
$parts[0] = MathUtility::forceIntegerInRange($parts[0], 0, 999);
|
||||
$parts[1] = MathUtility::forceIntegerInRange($parts[1], 0, 999);
|
||||
$parts[2] = MathUtility::forceIntegerInRange($parts[2], 0, 999);
|
||||
switch ((string)$raise) {
|
||||
case 'main':
|
||||
$parts[0]++;
|
||||
$parts[1] = 0;
|
||||
$parts[2] = 0;
|
||||
break;
|
||||
case 'sub':
|
||||
$parts[1]++;
|
||||
$parts[2] = 0;
|
||||
break;
|
||||
case 'dev':
|
||||
$parts[2]++;
|
||||
break;
|
||||
}
|
||||
return $parts[0] . '.' . $parts[1] . '.' . $parts[2];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables\ViewHelpers\Form;
|
||||
|
||||
/*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Carsten Biebricher <carsten.biebricher@hdnet.de>
|
||||
* (c) 2016-2022 Stanislas Rolland <typo3AAAA(arobas)sjbr.ca>
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
*/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\LanguageRepository;
|
||||
use SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository;
|
||||
use TYPO3\CMS\Core\Utility\MathUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
|
||||
/**
|
||||
* StaticInfoTables SelectViewHelper
|
||||
*
|
||||
* Display the Values of the selected StaticInfoTable.
|
||||
*
|
||||
* Default usage:
|
||||
* <code>
|
||||
* <sit:form.select name="staticInfoTablesTestCountry" staticInfoTable="country" options="{}"/>
|
||||
* <sit:form.select name="staticInfoTablesTestLanguage" staticInfoTable="language" options="{}"/>
|
||||
* <sit:form.select name="staticInfoTablesTestTerritory" staticInfoTable="territory" options="{}"/>
|
||||
* <sit:form.select name="staticInfoTablesTestCurrency" staticInfoTable="currency" options="{}"/>
|
||||
* <sit:form.select name="staticInfoTablesTestCountryZones" staticInfoTable="countryZone" options="{}"/>
|
||||
* </code>
|
||||
*
|
||||
* Optional Usage:
|
||||
* <code>
|
||||
* <sit:form.select name="staticInfoTablesTestCountry" id="staticInfoTablesTestCountry" staticInfoTable="country" options="{}" optionLabelField="isoCodeA2"/>
|
||||
* <sit:form.select name="staticInfoTablesTestCountry" id="staticInfoTablesTestCountry" staticInfoTable="country" options="{}" optionLabelField="capitalCity"/>
|
||||
* </code>
|
||||
*
|
||||
* Subselect Usage: (only CountryZones of Germany)
|
||||
* <sit:form.select name="staticInfoTablesTestCountryZones" id="staticInfoTablesTestCountryZones" staticInfoTable="countryZone" options="{}" staticInfoTableSubselect="{country: 54}"/>
|
||||
*
|
||||
* if you specify the Label-Field for the table use the Variable-Name from the StaticInfoTable-Model. (@see \SJBR\StaticInfoTables\Domain\Model\Country, ...)
|
||||
*
|
||||
* use name or property!
|
||||
*
|
||||
* Available Tables:
|
||||
* country
|
||||
* language
|
||||
* territory
|
||||
* currency
|
||||
* countryZone
|
||||
*/
|
||||
class SelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper
|
||||
{
|
||||
/**
|
||||
* Extension name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $extensionName = 'StaticInfoTables';
|
||||
|
||||
/**
|
||||
* Settings
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $settings;
|
||||
|
||||
/**
|
||||
* Country repository
|
||||
*
|
||||
* @var \SJBR\StaticInfoTables\Domain\Repository\CountryRepository
|
||||
*/
|
||||
protected $countryRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Country Repository
|
||||
*
|
||||
* @param CountryRepository $countryRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectCountryRepository(CountryRepository $countryRepository)
|
||||
{
|
||||
$this->countryRepository = $countryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Language repository
|
||||
*
|
||||
* @var \SJBR\StaticInfoTables\Domain\Repository\LanguageRepository
|
||||
*/
|
||||
protected $languageRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Language Repository
|
||||
*
|
||||
* @param LanguageRepository $languageRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectLanguageRepository(LanguageRepository $languageRepository)
|
||||
{
|
||||
$this->languageRepository = $languageRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Territory repository
|
||||
*
|
||||
* @var \SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository
|
||||
*/
|
||||
protected $territoryRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Territory Repository
|
||||
*
|
||||
* @param TerritoryRepository $territoryRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectTerritoryRepository(TerritoryRepository $territoryRepository)
|
||||
{
|
||||
$this->territoryRepository = $territoryRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Currency repository
|
||||
*
|
||||
* @var \SJBR\StaticInfoTables\Domain\Repository\CurrencyRepository
|
||||
*/
|
||||
protected $currencyRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the Currency Repository
|
||||
*
|
||||
* @param CurrencyRepository $currencyRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectCurrencyRepository(CurrencyRepository $currencyRepository)
|
||||
{
|
||||
$this->currencyRepository = $currencyRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Country Zone repository
|
||||
*
|
||||
* @var \SJBR\StaticInfoTables\Domain\Repository\CountryZoneRepository
|
||||
*/
|
||||
protected $countryZoneRepository;
|
||||
|
||||
/**
|
||||
* Dependency injection of the CountryZone Repository
|
||||
*
|
||||
* @param CountryZoneRepository $countryZoneRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectCountryZoneRepository(CountryZoneRepository $countryZoneRepository)
|
||||
{
|
||||
$this->countryZoneRepository = $countryZoneRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('staticInfoTable', 'string', 'set the tablename of the StaticInfoTable to build the Select-Tag.');
|
||||
$this->registerArgument('staticInfoTableSubselect', 'array', '{fieldname: fieldvalue}');
|
||||
$this->registerArgument('defaultOptionLabel', 'string', 'if set, add default option with given label');
|
||||
$this->registerArgument('defaultOptionValue', 'string', 'if set, add default option with given label');
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the Options.
|
||||
*
|
||||
* @throws Exception
|
||||
* @return string
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
$this->settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, $this->extensionName);
|
||||
if (!$this->hasArgument('staticInfoTable') || ($this->arguments['staticInfoTable'] ?? '') == '') {
|
||||
throw new \Exception('Please configure the "staticInfoTable"-Argument for this ViewHelper.', 1378136534);
|
||||
}
|
||||
/** @var \SJBR\StaticInfoTables\Domain\Repository\AbstractEntityRepository $repository */
|
||||
$repository = lcfirst($this->arguments['staticInfoTable']) . 'Repository';
|
||||
if (!array_key_exists($repository, get_object_vars($this))) {
|
||||
throw new \Exception('Please configure the right table in the "staticInfoTable"-Argument for this ViewHelper.', 1378136533);
|
||||
}
|
||||
/** @var array $items */
|
||||
$items = $this->getItems($repository);
|
||||
/** @var string $valueFunction */
|
||||
$valueFunction = $this->getMethodnameFromArgumentsAndUnset('optionValueField', 'uid');
|
||||
/** @var string $labelFunction */
|
||||
$labelFunction = $this->getMethodnameFromArgumentsAndUnset('optionLabelField', 'nameLocalized');
|
||||
if (!($this->settings['countriesAllowed'] ?? false) && (!$this->hasArgument('sortByOptionLabel') || ($this->arguments['sortByOptionLabel'] ?? '') == '')) {
|
||||
$this->arguments['sortByOptionLabel'] = true;
|
||||
}
|
||||
/** @var bool $test Test only the first item if they have the needed functions */
|
||||
$test = true;
|
||||
$options = [];
|
||||
/** @var \SJBR\StaticInfoTables\Domain\Model\AbstractEntity $item */
|
||||
foreach ($items as $item) {
|
||||
if ($test && !method_exists($item, $valueFunction)) {
|
||||
throw new \Exception('Wrong optionValueField.', 1378136535);
|
||||
}
|
||||
if ($test && !method_exists($item, $labelFunction)) {
|
||||
throw new \Exception('Wrong optionLabelField.', 1378136536);
|
||||
}
|
||||
$test = false;
|
||||
$value = $item->{$valueFunction}();
|
||||
$label = $item->{$labelFunction}();
|
||||
if ($value != '' && $label != '') {
|
||||
$options[$value] = $label;
|
||||
}
|
||||
}
|
||||
$this->arguments['options'] = $options;
|
||||
$sortedOptions = parent::getOptions();
|
||||
// Put default option after sorting to get it to the top of the items
|
||||
if ($this->hasArgument('defaultOptionLabel')) {
|
||||
$defaultOptionLabel = $this->arguments['defaultOptionLabel'];
|
||||
$defaultOptionValue = $this->hasArgument('defaultOptionValue') ? $this->arguments['defaultOptionValue'] : 0;
|
||||
$sortedOptions = [$defaultOptionValue => $defaultOptionLabel] + $sortedOptions;
|
||||
}
|
||||
return $sortedOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Items
|
||||
*
|
||||
* @param string $repository
|
||||
* @return array
|
||||
*/
|
||||
protected function getItems($repository)
|
||||
{
|
||||
if ($this->hasArgument('staticInfoTableSubselect')) {
|
||||
$items = $this->getItemsWithSubselect($repository);
|
||||
} elseif ($repository === 'countryRepository') {
|
||||
if (isset($this->settings['countriesAllowed']) && $this->settings['countriesAllowed']) {
|
||||
$items = $this->{$repository}->findAllowedByIsoCodeA3($this->settings['countriesAllowed']);
|
||||
} else {
|
||||
$items = $this->{$repository}->findAll()
|
||||
->toArray();
|
||||
}
|
||||
} elseif ($repository === 'languageRepository') {
|
||||
$items = $this->{$repository}->findAllNonConstructedNonSacred()
|
||||
->toArray();
|
||||
} else {
|
||||
$items = $this->{$repository}->findAll()
|
||||
->toArray();
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get items with custom sub select.
|
||||
*
|
||||
* @param string $repository
|
||||
* @return array
|
||||
*/
|
||||
protected function getItemsWithSubselect($repository)
|
||||
{
|
||||
$items = [];
|
||||
$subselects = $this->arguments['staticInfoTableSubselect'] ?? [];
|
||||
foreach ($subselects as $fieldname => $fieldvalue) {
|
||||
// default implemented Subselect
|
||||
if (strtolower($fieldname) === 'country' && MathUtility::canBeInterpretedAsInteger($fieldvalue)) {
|
||||
$findby = 'findBy' . ucfirst($fieldname);
|
||||
$fieldvalue = $this->countryRepository->findByUid((int)$fieldvalue);
|
||||
$items = call_user_func_array([
|
||||
$this->{$repository},
|
||||
$findby,
|
||||
], [$fieldvalue]);
|
||||
$items = $items->toArray();
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the in the arguments defined field, prepend 'get' and return it.
|
||||
* If the field is in the arguments not set it return the in the default defined value.
|
||||
*
|
||||
* @param string $field fieldname like 'optionLabelField'
|
||||
* @param string $default default value like 'nameLocalized'
|
||||
* @return string
|
||||
*/
|
||||
protected function getMethodnameFromArgumentsAndUnset($field, $default)
|
||||
{
|
||||
if (!$this->hasArgument($field) || $this->arguments[$field] == '') {
|
||||
$this->arguments[$field] = $default;
|
||||
}
|
||||
$methodName = 'get' . ucfirst($this->arguments[$field]);
|
||||
unset($this->arguments[$field]);
|
||||
return $methodName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
return [
|
||||
\SJBR\StaticInfoTables\Domain\Model\Country::class => [
|
||||
'tableName' => 'static_countries',
|
||||
'properties' => [
|
||||
'addressFormat' => [
|
||||
'fieldName' => 'cn_address_format'
|
||||
],
|
||||
'capitalCity' => [
|
||||
'fieldName' => 'cn_capital'
|
||||
],
|
||||
'currencyIsoCodeA3' => [
|
||||
'fieldName' => 'cn_currency_iso_3'
|
||||
],
|
||||
'currencyIsoCodeNumber' => [
|
||||
'fieldName' => 'cn_currency_iso_nr'
|
||||
],
|
||||
'euMember' => [
|
||||
'fieldName' => 'cn_eu_member'
|
||||
],
|
||||
'isoCodeA2' => [
|
||||
'fieldName' => 'cn_iso_2'
|
||||
],
|
||||
'isoCodeA3' => [
|
||||
'fieldName' => 'cn_iso_3'
|
||||
],
|
||||
'isoCodeNumber' => [
|
||||
'fieldName' => 'cn_iso_nr'
|
||||
],
|
||||
'officialNameLocal' => [
|
||||
'fieldName' => 'cn_official_name_local'
|
||||
],
|
||||
'officialNameEn' => [
|
||||
'fieldName' => 'cn_official_name_en'
|
||||
],
|
||||
'parentTerritoryUnCodeNumber' => [
|
||||
'fieldName' => 'cn_parent_tr_iso_nr'
|
||||
],
|
||||
'phonePrefix' => [
|
||||
'fieldName' => 'cn_phone'
|
||||
],
|
||||
'shortNameLocal' => [
|
||||
'fieldName' => 'cn_short_local'
|
||||
],
|
||||
'shortNameEn' => [
|
||||
'fieldName' => 'cn_short_en'
|
||||
],
|
||||
'topLevelDomain' => [
|
||||
'fieldName' => 'cn_tldomain'
|
||||
],
|
||||
'unMember' => [
|
||||
'fieldName' => 'cn_uno_member'
|
||||
],
|
||||
'zoneFlag' => [
|
||||
'fieldName' => 'cn_zone_flag'
|
||||
],
|
||||
'countryZones' => [
|
||||
'fieldName' => 'cn_country_zones'
|
||||
],
|
||||
'deleted' => [
|
||||
'fieldName' => 'deleted'
|
||||
],
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\CountryZone::class => [
|
||||
'tableName' => 'static_country_zones',
|
||||
'properties' => [
|
||||
'countryIsoCodeA2' => [
|
||||
'fieldName' => 'zn_country_iso_2'
|
||||
],
|
||||
'countryIsoCodeA3' => [
|
||||
'fieldName' => 'zn_country_iso_3'
|
||||
],
|
||||
'countryIsoCodeNumber' => [
|
||||
'fieldName' => 'zn_country_iso_nr'
|
||||
],
|
||||
'isoCode' => [
|
||||
'fieldName' => 'zn_code'
|
||||
],
|
||||
'localName' => [
|
||||
'fieldName' => 'zn_name_local'
|
||||
],
|
||||
'nameEn' => [
|
||||
'fieldName' => 'zn_name_en'
|
||||
],
|
||||
'deleted' => [
|
||||
'fieldName' => 'deleted'
|
||||
],
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\Currency::class => [
|
||||
'tableName' => 'static_currencies',
|
||||
'properties' => [
|
||||
'decimalDigits' => [
|
||||
'fieldName' => 'cu_decimal_digits'
|
||||
],
|
||||
'decimalPoint' => [
|
||||
'fieldName' => 'cu_decimal_point'
|
||||
],
|
||||
'divisor' => [
|
||||
'fieldName' => 'cu_sub_divisor'
|
||||
],
|
||||
'isoCodeA3' => [
|
||||
'fieldName' => 'cu_iso_3'
|
||||
],
|
||||
'isoCodeNumber' => [
|
||||
'fieldName' => 'cu_iso_nr'
|
||||
],
|
||||
'nameEn' => [
|
||||
'fieldName' => 'cu_name_en'
|
||||
],
|
||||
'subdivisionNameEn' => [
|
||||
'fieldName' => 'cu_sub_name_en'
|
||||
],
|
||||
'subdivisionSymbolLeft' => [
|
||||
'fieldName' => 'cu_sub_symbol_left'
|
||||
],
|
||||
'subdivisionSymbolRight' => [
|
||||
'fieldName' => 'cu_sub_symbol_right'
|
||||
],
|
||||
'symbolLeft' => [
|
||||
'fieldName' => 'cu_symbol_left'
|
||||
],
|
||||
'symbolRight' => [
|
||||
'fieldName' => 'cu_symbol_right'
|
||||
],
|
||||
'thousandsPoint' => [
|
||||
'fieldName' => 'cu_thousands_point'
|
||||
],
|
||||
'deleted' => [
|
||||
'fieldName' => 'deleted'
|
||||
],
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\Language::class => [
|
||||
'tableName' => 'static_languages',
|
||||
'properties' => [
|
||||
'collatingLocale' => [
|
||||
'fieldName' => 'lg_collate_locale'
|
||||
],
|
||||
'countryIsoCodeA2' => [
|
||||
'fieldName' => 'lg_country_iso_2'
|
||||
],
|
||||
'constructedLanguage' => [
|
||||
'fieldName' => 'lg_constructed'
|
||||
],
|
||||
'isoCodeA2' => [
|
||||
'fieldName' => 'lg_iso_2'
|
||||
],
|
||||
'localName' => [
|
||||
'fieldName' => 'lg_name_local'
|
||||
],
|
||||
'nameEn' => [
|
||||
'fieldName' => 'lg_name_en'
|
||||
],
|
||||
'sacredLanguage' => [
|
||||
'fieldName' => 'lg_sacred'
|
||||
],
|
||||
'typo3Code' => [
|
||||
'fieldName' => 'lg_typo3'
|
||||
],
|
||||
'deleted' => [
|
||||
'fieldName' => 'deleted'
|
||||
],
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\Territory::class => [
|
||||
'tableName' => 'static_territories',
|
||||
'properties' => [
|
||||
'unCodeNumber' => [
|
||||
'fieldName' => 'tr_iso_nr'
|
||||
],
|
||||
'nameEn' => [
|
||||
'fieldName' => 'tr_name_en'
|
||||
],
|
||||
'parentTerritoryUnCodeNumber' => [
|
||||
'fieldName' => 'tr_parent_iso_nr'
|
||||
],
|
||||
'deleted' => [
|
||||
'fieldName' => 'deleted'
|
||||
],
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\SystemLanguage::class => [
|
||||
'tableName' => 'sys_language',
|
||||
'properties' => [
|
||||
'title' => [
|
||||
'fieldName' => 'title'
|
||||
],
|
||||
'isoLanguage' => [
|
||||
'fieldName' => 'static_lang_isocode'
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
# ***************************************************************************************
|
||||
# Translate currency labels in suggestion on static_countries table
|
||||
# ***************************************************************************************
|
||||
TCEFORM.static_countries.cn_currency_uid.suggest.default.renderFunc = SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\SuggestLabelProcessor->translateLabel
|
||||
36
typo3conf/ext/static_info_tables/Configuration/Services.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
# Configuration/Services.yaml
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
public: false
|
||||
|
||||
SJBR\StaticInfoTables\:
|
||||
resource: '../Classes/*'
|
||||
exclude: '../Classes/Domain/Model/*'
|
||||
|
||||
SJBR\StaticInfoTables\EventListener\AfterPackageActivationEventListener:
|
||||
tags:
|
||||
- name: event.listener
|
||||
identifier: 'staticInfoTablesListener'
|
||||
event: TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent
|
||||
public: true
|
||||
|
||||
SJBR\StaticInfoTables\EventListener\AfterExtensionStaticDatabaseContentHasBeenImportedEventListener:
|
||||
tags:
|
||||
- name: event.listener
|
||||
identifier: 'staticInfoTablesListener'
|
||||
event: TYPO3\CMS\Extensionmanager\Event\AfterExtensionStaticDatabaseContentHasBeenImportedEvent
|
||||
public: true
|
||||
|
||||
SJBR\StaticInfoTables\Configuration\TypoScript\ConfigurationHelper:
|
||||
public: true
|
||||
|
||||
SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaLabelProcessor:
|
||||
public: true
|
||||
|
||||
SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSelectItemsProcessor:
|
||||
public: true
|
||||
|
||||
SJBR\StaticInfoTables\Hook\Core\DataHandling\ProcessDataMap:
|
||||
public: true
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
// Configure extension static template
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
|
||||
'static_info_tables',
|
||||
'Configuration/TypoScript/Static',
|
||||
'Static Info Tables'
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
call_user_func(
|
||||
function ($extKey) {
|
||||
if ($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extKey]['enableManager']) {
|
||||
// Enable editing Static Info Tables
|
||||
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['static_info_tables']['tables'])) {
|
||||
$tableNames = array_keys($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extKey]['tables']);
|
||||
foreach ($tableNames as $tableName) {
|
||||
$GLOBALS['TCA'][$tableName]['ctrl']['readOnly'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'static_info_tables'
|
||||
);
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
// Configure static_lang_isocode field in TCA
|
||||
$GLOBALS['TCA']['sys_language']['columns']['static_lang_isocode'] = [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_language.isocode',
|
||||
'config' => [
|
||||
'type' => 'group',
|
||||
'internal_type' => 'db',
|
||||
'allowed' => 'static_languages',
|
||||
'foreign_table' => 'static_languages',
|
||||
'suggestOptions' => [
|
||||
'default' => [
|
||||
'pidList' => '0',
|
||||
'additionalSearchFields' => 'lg_name_local',
|
||||
],
|
||||
],
|
||||
'fieldWizard' => [
|
||||
'recordsOverview' => [
|
||||
'disabled' => true,
|
||||
],
|
||||
'tableList' => [
|
||||
'disabled' => true,
|
||||
],
|
||||
],
|
||||
'size' => 1,
|
||||
'minitems' => 0,
|
||||
'maxitems' => 1,
|
||||
],
|
||||
];
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
|
||||
'sys_language',
|
||||
'static_lang_isocode',
|
||||
'',
|
||||
'after:language_isocode'
|
||||
);
|
||||
@@ -0,0 +1,321 @@
|
||||
<?php
|
||||
// Country reference data from ISO 3166-1
|
||||
return [
|
||||
'ctrl' => [
|
||||
'label' => 'cn_short_en',
|
||||
'label_alt' => 'cn_iso_2',
|
||||
'label_alt_force' => 1,
|
||||
'label_userFunc' => \SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaLabelProcessor::class . '->addIsoCodeToLabel',
|
||||
'adminOnly' => true,
|
||||
'rootLevel' => 1,
|
||||
'is_static' => 1,
|
||||
'readOnly' => 1,
|
||||
'default_sortby' => 'ORDER BY cn_short_en',
|
||||
'delete' => 'deleted',
|
||||
'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries.title',
|
||||
'iconfile' => 'EXT:static_info_tables/Resources/Public/Images/Icons/static_countries.svg',
|
||||
'searchFields' => 'cn_short_en,cn_official_name_local,cn_official_name_en',
|
||||
],
|
||||
'columns' => [
|
||||
'cn_official_name_local' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_official_name_local',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '25',
|
||||
'max' => '128',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cn_official_name_en' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_official_name_en',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '25',
|
||||
'max' => '50',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'deleted' => [
|
||||
'readonly' => 1,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:deleted',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'cn_iso_2' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_iso_2',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '4',
|
||||
'max' => '2',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cn_iso_3' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_iso_3',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '5',
|
||||
'max' => '3',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cn_iso_nr' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_iso_nr',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '7',
|
||||
'max' => '7',
|
||||
'eval' => 'int',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cn_parent_territory_uid' => [
|
||||
'exclude' => false,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_parent_territory_uid',
|
||||
'config' => [
|
||||
'type' => 'select',
|
||||
'renderType' => 'selectSingle',
|
||||
'items' => [
|
||||
['', 0],
|
||||
],
|
||||
'foreign_table' => 'static_territories',
|
||||
'foreign_table_where' => 'ORDER BY static_territories.tr_name_en',
|
||||
'itemsProcFunc' => \SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSelectItemsProcessor::class . '->translateTerritoriesSelector',
|
||||
'size' => 1,
|
||||
'minitems' => 0,
|
||||
'maxitems' => 1,
|
||||
],
|
||||
],
|
||||
'cn_parent_tr_iso_nr' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'cn_capital' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_capital',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '15',
|
||||
'max' => '45',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cn_tldomain' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_tldomain',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '5',
|
||||
'max' => '',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cn_currency_uid' => [
|
||||
'exclude' => false,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_currency_uid',
|
||||
'config' => [
|
||||
'type' => 'group',
|
||||
'internal_type' => 'db',
|
||||
'allowed' => 'static_currencies',
|
||||
'foreign_table' => 'static_currencies',
|
||||
'foreign_table_where' => 'ORDER BY static_currencies.cu_name_en',
|
||||
'suggestOptions' => [
|
||||
'default' => [
|
||||
'pidList' => '0',
|
||||
],
|
||||
],
|
||||
'fieldWizard' => [
|
||||
'recordsOverview' => [
|
||||
'disabled' => true,
|
||||
],
|
||||
'tableList' => [
|
||||
'disabled' => true,
|
||||
],
|
||||
],
|
||||
'size' => 1,
|
||||
'minitems' => 0,
|
||||
'maxitems' => 1,
|
||||
],
|
||||
],
|
||||
'cn_currency_iso_nr' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'cn_currency_iso_3' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'cn_phone' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_phone',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '10',
|
||||
'max' => '20',
|
||||
'eval' => '',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cn_eu_member' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_eu_member',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cn_uno_member' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_uno_member',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cn_address_format' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'select',
|
||||
'renderType' => 'selectSingle',
|
||||
'items' => [
|
||||
['', '0'],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_1',
|
||||
'1',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_2',
|
||||
'2',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_3',
|
||||
'3',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_4',
|
||||
'4',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_5',
|
||||
'5',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_6',
|
||||
'6',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_7',
|
||||
'7',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_8',
|
||||
'8',
|
||||
],
|
||||
[
|
||||
'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_address_format_9',
|
||||
'9',
|
||||
],
|
||||
],
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cn_zone_flag' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_zone_flag',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cn_short_local' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_short_local',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '25',
|
||||
'max' => '50',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cn_short_en' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_short_en',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '25',
|
||||
'max' => '50',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cn_country_zones' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_country_zones',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'inline',
|
||||
'foreign_table' => 'static_country_zones',
|
||||
'foreign_field' => 'zn_country_uid',
|
||||
'foreign_table_field' => 'zn_country_table',
|
||||
'foreign_default_sortby' => 'zn_name_local',
|
||||
'maxitems' => '200',
|
||||
'appearance' => [
|
||||
'expandSingle' => 1,
|
||||
'newRecordLinkAddTitle' => 1,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => 'cn_short_local,cn_official_name_local,cn_official_name_en,--palette--;;1,--palette--;;5,--palette--;;2,--palette--;;3,--palette--;;6,--palette--;;4,cn_short_en,cn_country_zones'
|
||||
]
|
||||
],
|
||||
'palettes' => [
|
||||
'1' => [
|
||||
'showitem' => 'cn_iso_nr,cn_iso_2,cn_iso_3',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'2' => [
|
||||
'showitem' => 'cn_currency_uid,cn_currency_iso_nr,cn_currency_iso_3',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'3' => [
|
||||
'showitem' => 'cn_capital,cn_uno_member,cn_eu_member',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'4' => [
|
||||
'showitem' => 'cn_address_format,cn_zone_flag',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'5' => [
|
||||
'showitem' => 'cn_parent_territory_uid,cn_parent_tr_iso_nr',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'6' => [
|
||||
'showitem' => 'cn_phone,cn_tldomain',
|
||||
'canNotCollapse' => '1'
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
// Country subdivision reference data from ISO 3166-2
|
||||
return [
|
||||
'ctrl' => [
|
||||
'label' => 'zn_name_local',
|
||||
'label_alt' => 'zn_name_local,zn_code',
|
||||
'adminOnly' => true,
|
||||
'rootLevel' => 1,
|
||||
'is_static' => 1,
|
||||
'readOnly' => 1,
|
||||
'default_sortby' => 'ORDER BY zn_name_local',
|
||||
'delete' => 'deleted',
|
||||
'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_country_zones.title',
|
||||
'iconfile' => 'EXT:static_info_tables/Resources/Public/Images/Icons/static_country_zones.svg',
|
||||
'searchFields' => 'zn_name_en,zn_name_local',
|
||||
],
|
||||
'columns' => [
|
||||
'deleted' => [
|
||||
'readonly' => 1,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:deleted',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'zn_country_uid' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'zn_country_table' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'zn_country_iso_nr' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'zn_country_iso_2' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'zn_country_iso_3' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'zn_code' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_country_zones_item.zn_code',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '45',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'zn_name_local' => [
|
||||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.name',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '45',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'zn_name_en' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_country_zones_item.zn_name_en',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '45',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
],
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => 'zn_name_local,zn_code,--palette--;;1,zn_name_en'
|
||||
]
|
||||
],
|
||||
'palettes' => [
|
||||
'1' => [
|
||||
'showitem' => 'zn_country_uid,zn_country_iso_nr,zn_country_iso_2,zn_country_iso_3',
|
||||
'canNotCollapse' => '1'
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
// Currency reference data from ISO 4217
|
||||
return [
|
||||
'ctrl' => [
|
||||
'label' => 'cu_name_en',
|
||||
'label_alt' => 'cu_iso_3',
|
||||
'label_alt_force' => 1,
|
||||
'label_userFunc' => \SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaLabelProcessor::class . '->addIsoCodeToLabel',
|
||||
'adminOnly' => true,
|
||||
'rootLevel' => 1,
|
||||
'is_static' => 1,
|
||||
'readOnly' => 1,
|
||||
'default_sortby' => 'ORDER BY cu_name_en',
|
||||
'delete' => 'deleted',
|
||||
'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies.title',
|
||||
'iconfile' => 'EXT:static_info_tables/Resources/Public/Images/Icons/static_currencies.svg',
|
||||
'searchFields' => 'cu_name_en',
|
||||
],
|
||||
'columns' => [
|
||||
'deleted' => [
|
||||
'readonly' => 1,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:deleted',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'cu_iso_3' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_iso_3',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '5',
|
||||
'max' => '3',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cu_iso_nr' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_iso_nr',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '7',
|
||||
'max' => '3',
|
||||
'eval' => '',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'cu_name_en' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_name_en',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '40',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cu_sub_name_en' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_sub_name_en',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '20',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cu_symbol_left' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_symbol_left',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '8',
|
||||
'max' => '12',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cu_symbol_right' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_symbol_right',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '8',
|
||||
'max' => '12',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cu_thousands_point' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_thousands_point',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '3',
|
||||
'max' => '1',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cu_decimal_point' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_decimal_point',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '3',
|
||||
'max' => '1',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cu_decimal_digits' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_decimal_digits',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '5',
|
||||
'max' => '',
|
||||
'eval' => 'int',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'cu_sub_divisor' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_sub_divisor',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '8',
|
||||
'max' => '20',
|
||||
'eval' => 'int',
|
||||
'default' => '1',
|
||||
],
|
||||
],
|
||||
'cu_sub_symbol_left' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_sub_symbol_left',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '8',
|
||||
'max' => '12',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'cu_sub_symbol_right' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_currencies_item.cu_sub_symbol_right',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '8',
|
||||
'max' => '12',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
],
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => 'cu_name_en,--palette--;;1,--palette--;;2,cu_sub_name_en,--palette--;;3'
|
||||
]
|
||||
],
|
||||
'palettes' => [
|
||||
'1' => [
|
||||
'showitem' => 'cu_iso_nr,cu_iso_3',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'2' => [
|
||||
'showitem' => 'cu_symbol_left,cu_symbol_right,cu_thousands_point,cu_decimal_point',
|
||||
'canNotCollapse' => '1'
|
||||
],
|
||||
'3' => [
|
||||
'showitem' => 'cu_sub_symbol_left,cu_sub_symbol_right,cu_decimal_digits,cu_sub_divisor',
|
||||
'canNotCollapse' => '1'
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
// Language reference data from ISO 639-1
|
||||
return [
|
||||
'ctrl' => [
|
||||
'label' => 'lg_name_en',
|
||||
'label_alt' => 'lg_iso_2',
|
||||
'label_alt_force' => 1,
|
||||
'label_userFunc' => \SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaLabelProcessor::class . '->addIsoCodeToLabel',
|
||||
'adminOnly' => true,
|
||||
'rootLevel' => 1,
|
||||
'is_static' => 1,
|
||||
'readOnly' => 1,
|
||||
'default_sortby' => 'ORDER BY lg_name_en',
|
||||
'delete' => 'deleted',
|
||||
'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages.title',
|
||||
'iconfile' => 'EXT:static_info_tables/Resources/Public/Images/Icons/static_languages.svg',
|
||||
'searchFields' => 'lg_name_en,lg_name_local',
|
||||
],
|
||||
'columns' => [
|
||||
'deleted' => [
|
||||
'readonly' => 1,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:deleted',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'lg_iso_2' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages_item.lg_iso_2',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '4',
|
||||
'max' => '2',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'lg_name_local' => [
|
||||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.name',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '25',
|
||||
'max' => '50',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'lg_name_en' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages_item.lg_name_en',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '40',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
'lg_typo3' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages_item.lg_typo3',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '3',
|
||||
'max' => '2',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'lg_country_iso_2' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_countries_item.cn_iso_2',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '3',
|
||||
'max' => '2',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'lg_collate_locale' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages_item.lg_collate_locale',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '5',
|
||||
'max' => '5',
|
||||
'eval' => '',
|
||||
'default' => '',
|
||||
],
|
||||
],
|
||||
'lg_sacred' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages_item.lg_sacred',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'lg_constructed' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_languages_item.lg_constructed',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
],
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => 'lg_name_local,lg_name_en,lg_iso_2,lg_typo3,lg_country_iso_2,lg_collate_locale,lg_sacred,lg_constructed'
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
// UN Territory reference data
|
||||
return [
|
||||
'ctrl' => [
|
||||
'label' => 'tr_name_en',
|
||||
'label_alt' => 'tr_iso_nr',
|
||||
'label_alt_force' => 1,
|
||||
'label_userFunc' => \SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaLabelProcessor::class . '->addIsoCodeToLabel',
|
||||
'adminOnly' => true,
|
||||
'rootLevel' => 1,
|
||||
'is_static' => 1,
|
||||
'readOnly' => 1,
|
||||
'default_sortby' => 'ORDER BY tr_name_en',
|
||||
'delete' => 'deleted',
|
||||
'title' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_territories.title',
|
||||
'iconfile' => 'EXT:static_info_tables/Resources/Public/Images/Icons/static_territories.svg',
|
||||
'searchFields' => 'tr_name_en',
|
||||
],
|
||||
'columns' => [
|
||||
'deleted' => [
|
||||
'readonly' => 1,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:deleted',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
],
|
||||
],
|
||||
'tr_iso_nr' => [
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_territories_item.tr_iso_nr',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '7',
|
||||
'max' => '7',
|
||||
'eval' => 'int',
|
||||
'default' => '0',
|
||||
],
|
||||
],
|
||||
'tr_parent_territory_uid' => [
|
||||
'exclude' => false,
|
||||
'label' => 'LLL:EXT:static_info_tables/Resources/Private/Language/locallang_db.xlf:static_territories_item.tr_parent_territory_uid',
|
||||
'config' => [
|
||||
'type' => 'select',
|
||||
'renderType' => 'selectSingle',
|
||||
'items' => [
|
||||
['', 0],
|
||||
],
|
||||
'foreign_table' => 'static_territories',
|
||||
'foreign_table_where' => 'ORDER BY static_territories.tr_name_en',
|
||||
'itemsProcFunc' => \SJBR\StaticInfoTables\Hook\Backend\Form\FormDataProvider\TcaSelectItemsProcessor::class . '->translateTerritoriesSelector',
|
||||
'size' => 1,
|
||||
'minitems' => 0,
|
||||
'maxitems' => 1,
|
||||
],
|
||||
],
|
||||
'tr_parent_iso_nr' => [
|
||||
'config' => [
|
||||
'type' => 'passthrough',
|
||||
],
|
||||
],
|
||||
'tr_name_en' => [
|
||||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.name',
|
||||
'exclude' => false,
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => '18',
|
||||
'max' => '45',
|
||||
'eval' => 'trim',
|
||||
'default' => '',
|
||||
'_is_string' => '1',
|
||||
],
|
||||
],
|
||||
],
|
||||
'types' => [
|
||||
'1' => [
|
||||
'showitem' => 'tr_iso_nr,tr_name_en,fk_billing_country,--palette--;;1'
|
||||
]
|
||||
],
|
||||
'palettes' => [
|
||||
'1' => [
|
||||
'showitem' => 'tr_parent_territory_uid,tr_parent_iso_nr',
|
||||
'canNotCollapse' => '1'
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
## Configuring the Static Info Manager backend module
|
||||
module.tx_staticinfotables {
|
||||
## Paths for Manager templates
|
||||
view {
|
||||
templateRootPaths.0 = EXT:static_info_tables/Resources/Private/Templates/
|
||||
partialRootPaths.0 = EXT:static_info_tables/Resources/Private/Partials/
|
||||
layoutRootPaths.0 = EXT:static_info_tables/Resources/Private/Layouts/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
plugin.tx_staticinfotables_pi1 {
|
||||
|
||||
# cat=plugin.tx_staticinfotables_pi1//3; type=user[SJBR\StaticInfoTables\Configuration\TypoScript\ConfigurationHelper->buildEntitySelector];; label= Default currency: ISO alpha-3 code of the default currency used to format an amount.
|
||||
currencyCode = EUR
|
||||
|
||||
# cat=plugin.tx_staticinfotables_pi1//1; type=user[SJBR\StaticInfoTables\Configuration\TypoScript\ConfigurationHelper->buildEntitySelector];; label= Default country: ISO alpha-3 code of the default selected country in the drop-down selector.
|
||||
countryCode =
|
||||
|
||||
# cat=plugin.tx_staticinfotables_pi1//5; type=string; label= Allowed countries: ISO alpha-3 codes of the countries which are allowed in the drop-down selector. The order of the countries will remain in the output.
|
||||
countriesAllowed =
|
||||
|
||||
# cat=plugin.tx_staticinfotables_pi1//2; type=user[SJBR\StaticInfoTables\Configuration\TypoScript\ConfigurationHelper->buildEntitySelector];; label= Default country zone: Code of the default selected country zone in drop-down selector.
|
||||
countryZoneCode =
|
||||
|
||||
# cat=plugin.tx_staticinfotables_pi1//4; type=user[SJBR\StaticInfoTables\Configuration\TypoScript\ConfigurationHelper->buildEntitySelector];; label= Default language: ISO alpha-2 code of the default selected language in drop-down selector.
|
||||
languageCode =
|
||||
|
||||
# cat=plugin.tx_staticinfotables_pi1//6; type=string; label= Onchange attribute : Value of onchange attribute of drop-down selectors, when present.
|
||||
onChangeAttribute = javascript:this.form.submit();
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
plugin.tx_staticinfotables.settings {
|
||||
countryCode = {$plugin.tx_staticinfotables_pi1.countryCode}
|
||||
countriesAllowed = {$plugin.tx_staticinfotables_pi1.countriesAllowed}
|
||||
countryZoneCode = {$plugin.tx_staticinfotables_pi1.countryZoneCode}
|
||||
currencyCode = {$plugin.tx_staticinfotables_pi1.currencyCode}
|
||||
languageCode = {$plugin.tx_staticinfotables_pi1.languageCode}
|
||||
onChangeAttribute = {$plugin.tx_staticinfotables_pi1.onChangeAttribute}
|
||||
|
||||
addressFormat {
|
||||
## See www.upu.int
|
||||
## Semi-colon (;)-separated address lines
|
||||
## Examples of address format 1: Austria, Denmark, France, Germany, Russia
|
||||
1 = %street;%zip %city;%countryName
|
||||
|
||||
## Examples of address format 2: India
|
||||
2 = %street;%city %zip;%countryName
|
||||
|
||||
## Examples of address format 3: Australia, USA
|
||||
3 = %street;%city %countrySubdivisionCode %zip;%countryName
|
||||
|
||||
## Example of address format 4: Canada
|
||||
4 = %street;%city (%countrySubdivisionName) %zip;%countryName
|
||||
|
||||
## Example of address format 5: Great Britain
|
||||
5 = %street;%city;%zip%countryName
|
||||
|
||||
## Example of address format 6: Mexico
|
||||
6 = %street;%zip %city, %countrySubdivisionCode;%countryName
|
||||
|
||||
## Example of address format 7: Italy
|
||||
7 = %street;%zip %city %countrySubdivisionCode;%countryName
|
||||
|
||||
## Example of address format 8: Spain
|
||||
8 = %street;%zip %city (%countrySubdivisionName);%countryName
|
||||
|
||||
## Example of address format 9: Brazil
|
||||
9 = %street;%city - %countrySubdivisionCode;%zip;%countryName
|
||||
}
|
||||
}
|
||||
|
||||
plugin.tx_staticinfotables_pi1 {
|
||||
|
||||
countryCode = {$plugin.tx_staticinfotables_pi1.countryCode}
|
||||
countriesAllowed = {$plugin.tx_staticinfotables_pi1.countriesAllowed}
|
||||
countryZoneCode = {$plugin.tx_staticinfotables_pi1.countryZoneCode}
|
||||
currencyCode = {$plugin.tx_staticinfotables_pi1.currencyCode}
|
||||
languageCode = {$plugin.tx_staticinfotables_pi1.languageCode}
|
||||
onChangeAttribute = {$plugin.tx_staticinfotables_pi1.onChangeAttribute}
|
||||
|
||||
addressFormat {
|
||||
## See www.upu.int
|
||||
## Semi-colon (;)-separated address lines
|
||||
## Examples of address format 1: Austria, Denmark, France, Germany, Russia
|
||||
1 = %street;%zip %city;%countryName
|
||||
|
||||
## Examples of address format 2: India
|
||||
2 = %street;%city %zip;%countryName
|
||||
|
||||
## Examples of address format 3: Australia, USA
|
||||
3 = %street;%city %countrySubdivisionCode %zip;%countryName
|
||||
|
||||
## Example of address format 4: Canada
|
||||
4 = %street;%city (%countrySubdivisionName) %zip;%countryName
|
||||
|
||||
## Example of address format 5: Great Britain
|
||||
5 = %street;%city;%zip%countryName
|
||||
|
||||
## Example of address format 6: Mexico
|
||||
6 = %street;%zip %city, %countrySubdivisionCode;%countryName
|
||||
|
||||
## Example of address format 7: Italy
|
||||
7 = %street;%zip %city %countrySubdivisionCode;%countryName
|
||||
|
||||
## Example of address format 8: Spain
|
||||
8 = %street;%zip %city (%countrySubdivisionName);%countryName
|
||||
|
||||
## Example of address format 9: Brazil
|
||||
9 = %street;%city - %countrySubdivisionCode;%zip;%countryName
|
||||
}
|
||||
}
|
||||
340
typo3conf/ext/static_info_tables/LICENSE.txt
Normal file
@@ -0,0 +1,340 @@
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2013-03-05T21:51:01Z" product-name="static_info_tables">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="title" xml:space="preserve">
|
||||
<source>Static Info Tables Manager</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="information" xml:space="preserve">
|
||||
<source>Information</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="actionList" xml:space="preserve">
|
||||
<source></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="newLanguagePack" xml:space="preserve">
|
||||
<source>Create/update a language pack extension</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="createLanguagePackTitle" xml:space="preserve">
|
||||
<source>Create or update a language pack extension for the Static Info Tables</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="createLanguagePackDescription" xml:space="preserve">
|
||||
<source>This action creates a language pack for a given language.
|
||||
If the language pack is new, it is immediately installed, and fields are added to the tables to allow translation of labels into the language of the language pack.
|
||||
The backend forms may then be used to translate the labels in the language-specific fields of the Static Info Tables.
|
||||
When updating the localized labels is complete, this same action may be used to update the language pack with the localized data.
|
||||
</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="createLanguagePackSubmit" xml:space="preserve">
|
||||
<source>Create or update the language pack</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="language" xml:space="preserve">
|
||||
<source>Language of the language pack</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="version" xml:space="preserve">
|
||||
<source>Version of the language pack</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="author" xml:space="preserve">
|
||||
<source>Name of extension author</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="authorCompany" xml:space="preserve">
|
||||
<source>Name of company of extension author</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="vendorName" xml:space="preserve">
|
||||
<source>Vendor name of composer package</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="authorEmail" xml:space="preserve">
|
||||
<source>Email of extension author</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="couldNotWriteFile" xml:space="preserve">
|
||||
<source>The following file could not be written:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="languagePackCreated" xml:space="preserve">
|
||||
<source>A language pack was created for</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="languagePackUpdated" xml:space="preserve">
|
||||
<source>was updated.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="languagePack" xml:space="preserve">
|
||||
<source>Language pack</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="wasInstalled" xml:space="preserve">
|
||||
<source>was installed.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="testForm" xml:space="preserve">
|
||||
<source>Display the test form</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="testFormTitle" xml:space="preserve">
|
||||
<source>Use the test form to check the installation of Static Info Tables.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="testFormDescription" xml:space="preserve">
|
||||
<source>This action allows to test the installation of the Static Info Tables and its language packs.
|
||||
It will display a form containing some selector boxes.
|
||||
If an appropriate language pack is installed, all data should be localized in the current language of the backend.
|
||||
</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="testFormSubmit" xml:space="preserve">
|
||||
<source>Submit the test form</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="testFormResultTitle" xml:space="preserve">
|
||||
<source>Results of the test form of Static Info Tables.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="sqlDumpNonLocalizedData" xml:space="preserve">
|
||||
<source>SQL dump of non-localized data</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="sqlDumpNonLocalizedDataTitle" xml:space="preserve">
|
||||
<source>Create a SQL dump of the non-localized data of the Static Info Tables</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="sqlDumpNonLocalizedDataDescription" xml:space="preserve">
|
||||
<source>This action creates a SQL dump of all non-localized data. The SQL dump may then be used to create a new version of the main extension Static Info Tables (static_info_tables).</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="sqlDumpCreated" xml:space="preserve">
|
||||
<source>SQL dump of non-localized data was created in</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="1238108067" xml:space="preserve">
|
||||
<source>Please enter a string of length 1 to 255 characters.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="1221560718" xml:space="preserve">
|
||||
<source>Please enter a string of length 1 to 255 characters.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="1221559976" xml:space="preserve">
|
||||
<source>Please enter a valid email address.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="updateLanguageLabels" xml:space="preserve">
|
||||
<source>The Static Info Tables were updated with language labels from language pack %s.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="updateTables" xml:space="preserve">
|
||||
<source>The Static Info Tables were re-created.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="nothingToDo" xml:space="preserve">
|
||||
<source>No additional update was necessary as no language pack is installed.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="noVersionChangeSinceLastUpdate" xml:space="preserve">
|
||||
<source>No update is required because the versions of the base extension and of the installed language packs did not change since the last update.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="forceUpdate" xml:space="preserve">
|
||||
<source>Force update</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="enableStaticInfoTablesManager" xml:space="preserve">
|
||||
<source>Enable the Static Info Tables Manager: Enable the Static Info Tables Manager module in the backend.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="afterInstall" xml:space="preserve">
|
||||
<source>ATTENTION!: After installing or upgrading this extension, you should execute the update script. The update script will re-create the tables and re-apply any installed language pack.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="update.oldLanguagePacks" xml:space="preserve">
|
||||
<source>If language packs with versions lower than 6.0 are installed, they could not be detected and they need to be re-created. Please read the manual.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="selectCountry" xml:space="preserve">
|
||||
<source>Select a country</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="selectCountryZone" xml:space="preserve">
|
||||
<source>Select a country subdivision</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="selectLanguage" xml:space="preserve">
|
||||
<source>Select a language</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="countryLocalizedName" xml:space="preserve">
|
||||
<source>Country localized name</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="countryZoneLocalizedName" xml:space="preserve">
|
||||
<source>Country subdivision localized name</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="currencyLocalizedName" xml:space="preserve">
|
||||
<source>Currency localized name</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="languageLocalizedName" xml:space="preserve">
|
||||
<source>Language localized name</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="territoryLocalizedName" xml:space="preserve">
|
||||
<source>Territory localized name</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,194 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2013-02-21T01:35:44Z" product-name="static_info_tables">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="static_territories.title" xml:space="preserve">
|
||||
<source>Territories</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_territories_item.tr_iso_nr" xml:space="preserve">
|
||||
<source>ISO nr territory code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_territories_item.tr_parent_territory_uid" xml:space="preserve">
|
||||
<source>Territory in which this one is contained:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_territories_item.tr_parent_iso_nr" xml:space="preserve">
|
||||
<source>ISO numeric code of territory in which this one is contained:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_territories_item.tr_name_en" xml:space="preserve">
|
||||
<source>Name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries.title" xml:space="preserve">
|
||||
<source>Countries</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_iso_2" xml:space="preserve">
|
||||
<source>ISO 3166-1 A2 Country code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_iso_3" xml:space="preserve">
|
||||
<source>ISO 3166-1 A3 Country code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_iso_nr" xml:space="preserve">
|
||||
<source>ISO 3166-1 Nr Country code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_official_name_local" xml:space="preserve">
|
||||
<source>Official name (local):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_official_name_en" xml:space="preserve">
|
||||
<source>Official name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_parent_territory_uid" xml:space="preserve">
|
||||
<source>Territory in which this country is located:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_parent_tr_iso_nr" xml:space="preserve">
|
||||
<source>ISO numeric code of territory in which this country is located:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_capital" xml:space="preserve">
|
||||
<source>Capital:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_tldomain" xml:space="preserve">
|
||||
<source>Top level domain:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_currency_uid" xml:space="preserve">
|
||||
<source>Currency:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_currency_iso_nr" xml:space="preserve">
|
||||
<source>ISO 4217 Nr Currency code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_currency_iso_3" xml:space="preserve">
|
||||
<source>ISO 4217 A3 Currency code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_phone" xml:space="preserve">
|
||||
<source>Int. phone prefix:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_uno_member" xml:space="preserve">
|
||||
<source>UN member:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_eu_member" xml:space="preserve">
|
||||
<source>EU member:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format" xml:space="preserve">
|
||||
<source>Address format:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_1" xml:space="preserve">
|
||||
<source>zip city</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_2" xml:space="preserve">
|
||||
<source>city zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_3" xml:space="preserve">
|
||||
<source>city region-code zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_4" xml:space="preserve">
|
||||
<source>city (region-name) zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_5" xml:space="preserve">
|
||||
<source>city/zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_6" xml:space="preserve">
|
||||
<source>zip city, region-code</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_7" xml:space="preserve">
|
||||
<source>zip city region-code</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_8" xml:space="preserve">
|
||||
<source>zip city (region-name)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_address_format_9" xml:space="preserve">
|
||||
<source>city - region-code/zip</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_zone_flag" xml:space="preserve">
|
||||
<source>Zone flag:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_short_local" xml:space="preserve">
|
||||
<source>Short name (local):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_short_en" xml:space="preserve">
|
||||
<source>Short name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_countries_item.cn_country_zones" xml:space="preserve">
|
||||
<source>Country subdivisions:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_country_zones.title" xml:space="preserve">
|
||||
<source>Country subdivisions</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_country_zones_item.zn_country_iso_nr" xml:space="preserve">
|
||||
<source>ISO 3166-1 Nr Country code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_country_zones_item.zn_country_iso_2" xml:space="preserve">
|
||||
<source>ISO 3166-1 A2 Country code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_country_zones_item.zn_country_iso_3" xml:space="preserve">
|
||||
<source>ISO 3166-1 A3 Country code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_country_zones_item.zn_code" xml:space="preserve">
|
||||
<source>ISO 3166-2 Country Zone code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_country_zones_item.zn_name_en" xml:space="preserve">
|
||||
<source>Name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages.title" xml:space="preserve">
|
||||
<source>Languages</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages_item.lg_iso_2" xml:space="preserve">
|
||||
<source>ISO 639-1 A2 Language code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages_item.lg_collate_locale" xml:space="preserve">
|
||||
<source>Collating locale:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages_item.lg_name_en" xml:space="preserve">
|
||||
<source>Name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages_item.lg_typo3" xml:space="preserve">
|
||||
<source>Typo3 language code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages_item.lg_sacred" xml:space="preserve">
|
||||
<source>Sacred language:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_languages_item.lg_constructed" xml:space="preserve">
|
||||
<source>Constructed language:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies.title" xml:space="preserve">
|
||||
<source>Currencies</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_iso_3" xml:space="preserve">
|
||||
<source>ISO 4217 A3 Currency code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_iso_nr" xml:space="preserve">
|
||||
<source>ISO 4217 Nr Currency code:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_name_en" xml:space="preserve">
|
||||
<source>Name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_sub_name_en" xml:space="preserve">
|
||||
<source>Sub name (EN):</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_symbol_left" xml:space="preserve">
|
||||
<source>Symbol left:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_symbol_right" xml:space="preserve">
|
||||
<source>Symbol right:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_thousands_point" xml:space="preserve">
|
||||
<source>Thousands point:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_decimal_point" xml:space="preserve">
|
||||
<source>Decimal point:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_decimal_digits" xml:space="preserve">
|
||||
<source>Decimal digits:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_sub_divisor" xml:space="preserve">
|
||||
<source>Divisor:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_sub_symbol_left" xml:space="preserve">
|
||||
<source>Sub symbol left:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="static_currencies_item.cu_sub_symbol_right" xml:space="preserve">
|
||||
<source>Sub symbol right:</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="deleted" xml:space="preserve">
|
||||
<source>Deleted</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2013-03-05T21:51:13Z" product-name="static_info_tables">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="mlang_tabs_tab" xml:space="preserve">
|
||||
<source>Static Info</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mlang_labels_tablabel" xml:space="preserve">
|
||||
<source>Static Info Tables Manager</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mlang_labels_tabdescr" xml:space="preserve">
|
||||
<source>Provides tools to manage static info tables and create language packs.</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables###LANG_ISO_CAMEL###\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\AbstractEntity;
|
||||
|
||||
/**
|
||||
* The Country model
|
||||
*/
|
||||
class Country extends AbstractEntity {
|
||||
/**
|
||||
* The ###LANG_NAME### short name
|
||||
* @var string
|
||||
*/
|
||||
protected $shortName###LANG_ISO_CAMEL### = '';
|
||||
|
||||
/**
|
||||
* Sets the ###LANG_NAME### short name.
|
||||
*
|
||||
* @param string $shortName###LANG_ISO_CAMEL###
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setShortName###LANG_ISO_CAMEL###($shortName###LANG_ISO_CAMEL###) {
|
||||
$this->shortName###LANG_ISO_CAMEL### = $shortName###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ###LANG_NAME### short name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getShortName###LANG_ISO_CAMEL###() {
|
||||
return $this->shortName###LANG_ISO_CAMEL###;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables###LANG_ISO_CAMEL###\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\AbstractEntity;
|
||||
|
||||
/**
|
||||
* The Country Zone model
|
||||
*/
|
||||
class CountryZone extends AbstractEntity {
|
||||
/**
|
||||
* ###LANG_NAME### name of the country zone
|
||||
* @var string
|
||||
*/
|
||||
protected $name###LANG_ISO_CAMEL### = '';
|
||||
|
||||
/**
|
||||
* Sets the ###LANG_NAME### name.
|
||||
*
|
||||
* @param string $name###LANG_ISO_CAMEL###
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setName###LANG_ISO_CAMEL###($name###LANG_ISO_CAMEL###) {
|
||||
$this->name###LANG_ISO_CAMEL### = $name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns ###LANG_NAME### name. If empty returns the localName.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName###LANG_ISO_CAMEL###() {
|
||||
if ($this->name###LANG_ISO_CAMEL### === '') {
|
||||
return $this->getLocalName();
|
||||
}
|
||||
return $this->name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables###LANG_ISO_CAMEL###\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\AbstractEntity;
|
||||
|
||||
/**
|
||||
* The Currency model
|
||||
*/
|
||||
class Currency extends AbstractEntity {
|
||||
/**
|
||||
* ###LANG_NAME### name of the currency
|
||||
* @var string
|
||||
*/
|
||||
protected $name###LANG_ISO_CAMEL### = '';
|
||||
|
||||
/**
|
||||
* ###LANG_NAME### name of the currency subdivision unit
|
||||
* @var string
|
||||
*/
|
||||
protected $subdivisionName###LANG_ISO_CAMEL### = '';
|
||||
|
||||
/**
|
||||
* Sets the ###LANG_NAME### name of the currency
|
||||
*
|
||||
* @param string $name###LANG_ISO_CAMEL###
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setName###LANG_ISO_CAMEL###($name###LANG_ISO_CAMEL###) {
|
||||
$this->name###LANG_ISO_CAMEL### = $name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ###LANG_NAME### name of the currency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName###LANG_ISO_CAMEL###() {
|
||||
return $this->name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ###LANG_NAME### name of the currency subdivision
|
||||
*
|
||||
* @param string $subdivisionName###LANG_ISO_CAMEL###
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setSubdivisionName###LANG_ISO_CAMEL###($subdivisionName###LANG_ISO_CAMEL###) {
|
||||
$this->subdivisionName###LANG_ISO_CAMEL### = $subdivisionName###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ###LANG_NAME### name of the currency subdivision
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSubdivisionName###LANG_ISO_CAMEL###() {
|
||||
return $this->subdivisionName###LANG_ISO_CAMEL###;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables###LANG_ISO_CAMEL###\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\AbstractEntity;
|
||||
|
||||
/**
|
||||
* The Language model
|
||||
*/
|
||||
class Language extends AbstractEntity {
|
||||
/**
|
||||
* ###LANG_NAME### name of the language
|
||||
* @var string
|
||||
*/
|
||||
protected $name###LANG_ISO_CAMEL### = '';
|
||||
|
||||
/**
|
||||
* Sets the ###LANG_NAME### name of the language
|
||||
*
|
||||
* @param string $name###LANG_NAME###
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setName###LANG_ISO_CAMEL###($name###LANG_ISO_CAMEL###) {
|
||||
$this->name###LANG_ISO_CAMEL### = $name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ###LANG_NAME### name of the language
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName###LANG_ISO_CAMEL###() {
|
||||
return $this->name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace SJBR\StaticInfoTables###LANG_ISO_CAMEL###\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2011-2012 Armin Rüdiger Vieweg <info@professorweb.de>
|
||||
* (c) 2013-2018 Stanislas Rolland <typo3(arobas)sjbr.ca>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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!
|
||||
***************************************************************/
|
||||
|
||||
use SJBR\StaticInfoTables\Domain\Model\AbstractEntity;
|
||||
|
||||
/**
|
||||
* The Territory model
|
||||
*/
|
||||
class Territory extends AbstractEntity {
|
||||
/**
|
||||
* ###LANG_NAME### name of the territory
|
||||
* @var string
|
||||
*/
|
||||
protected $name###LANG_ISO_CAMEL### = '';
|
||||
|
||||
/**
|
||||
* Sets the ###LANG_NAME### name of the territory
|
||||
*
|
||||
* @param string $name###LANG_ISO_CAMEL###
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setName###LANG_ISO_CAMEL###($name###LANG_ISO_CAMEL###) {
|
||||
$this->name###LANG_ISO_CAMEL### = $name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ###LANG_NAME### name of the territory
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName###LANG_ISO_CAMEL###() {
|
||||
return $this->name###LANG_ISO_CAMEL###;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
Domain/Model/Country
|
||||
Domain/Model/CountryZone
|
||||
Domain/Model/Currency
|
||||
Domain/Model/Language
|
||||
Domain/Model/Territory
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
return [
|
||||
\SJBR\StaticInfoTables\Domain\Model\Country::class => [
|
||||
'tableName' => 'static_countries',
|
||||
'properties' => [
|
||||
'shortName###LANG_ISO_CAMEL###' => [
|
||||
'fieldName' => 'cn_short_###LANG_ISO_LOWER###'
|
||||
]
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\CountryZone::class => [
|
||||
'tableName' => 'static_country_zones',
|
||||
'properties' => [
|
||||
'name###LANG_ISO_CAMEL###' => [
|
||||
'fieldName' => 'zn_name_###LANG_ISO_LOWER###'
|
||||
]
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\Currency::class => [
|
||||
'tableName' => 'static_currencies',
|
||||
'properties' => [
|
||||
'name###LANG_ISO_CAMEL###' => [
|
||||
'fieldName' => 'cu_name_###LANG_ISO_LOWER###'
|
||||
],
|
||||
'subdivisionName###LANG_ISO_CAMEL###' => [
|
||||
'fieldName' => 'cu_sub_name_###LANG_ISO_LOWER###'
|
||||
]
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\Language::class => [
|
||||
'tableName' => 'static_languages',
|
||||
'properties' => [
|
||||
'name###LANG_ISO_CAMEL###' => [
|
||||
'fieldName' => 'lg_name_###LANG_ISO_LOWER###'
|
||||
]
|
||||
]
|
||||
],
|
||||
\SJBR\StaticInfoTables\Domain\Model\Territory::class => [
|
||||
'tableName' => 'static_territories',
|
||||
'properties' => [
|
||||
'name###LANG_ISO_CAMEL###' => [
|
||||
'fieldName' => 'tr_name_###LANG_ISO_LOWER###'
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
# ***************************************************************************************
|
||||
# Translate currency labels in suggestions
|
||||
# ***************************************************************************************
|
||||
[siteLanguage("twoLetterIsoCode") == "###LANG_ISO_LOWER###"]
|
||||
TCEFORM.sys_language.static_lang_isocode.suggest.default.additionalSearchFields = lg_name_###LANG_ISO_LOWER###
|
||||
TCEFORM.sys_language.static_lang_isocode.suggest.default.orderBy = lg_name_###LANG_ISO_LOWER###
|
||||
TCEFORM.static_countries.cn_currency_uid.suggest.default.additionalSearchFields = cu_name_###LANG_ISO_LOWER###
|
||||
TCEFORM.static_countries.cn_currency_uid.suggest.default.orderBy = cu_name_###LANG_ISO_LOWER###
|
||||
[global]
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
\SJBR\StaticInfoTables\Configuration\Tca\Provider::addTcaColumnConfiguration(
|
||||
'static_info_tables_' . '###LANG_ISO_LOWER###',
|
||||
'static_countries',
|
||||
[
|
||||
'cn_short_en' => 'cn_short_' . '###LANG_ISO_LOWER###'
|
||||
]
|
||||
);
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
\SJBR\StaticInfoTables\Configuration\Tca\Provider::addTcaColumnConfiguration(
|
||||
'static_info_tables_' . '###LANG_ISO_LOWER###',
|
||||
'static_country_zones',
|
||||
[
|
||||
'zn_name_en' => 'zn_name_' . '###LANG_ISO_LOWER###'
|
||||
]
|
||||
);
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
\SJBR\StaticInfoTables\Configuration\Tca\Provider::addTcaColumnConfiguration(
|
||||
'static_info_tables_' . '###LANG_ISO_LOWER###',
|
||||
'static_currencies',
|
||||
[
|
||||
'cu_name_en' => 'cu_name_' . '###LANG_ISO_LOWER###',
|
||||
'cu_sub_name_en' => 'cu_sub_name_' . '###LANG_ISO_LOWER###'
|
||||
]
|
||||
);
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
\SJBR\StaticInfoTables\Configuration\Tca\Provider::addTcaColumnConfiguration(
|
||||
'static_info_tables_' . '###LANG_ISO_LOWER###',
|
||||
'static_languages',
|
||||
[
|
||||
'lg_name_en' => 'lg_name_' . '###LANG_ISO_LOWER###'
|
||||
]
|
||||
);
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
\SJBR\StaticInfoTables\Configuration\Tca\Provider::addTcaColumnConfiguration(
|
||||
'static_info_tables_' . '###LANG_ISO_LOWER###',
|
||||
'static_territories',
|
||||
[
|
||||
'tr_name_en' => 'tr_name_' . '###LANG_ISO_LOWER###'
|
||||
]
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2013-02-21T01:35:44Z" product-name="static_info_tables_###LANG_ISO_LOWER###">
|
||||
<header/>
|
||||
<body>
|
||||
###LANG_TCA_LABELS###
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
enable-background="new 0 0 50 50"
|
||||
height="50px"
|
||||
id="Layer_1"
|
||||
version="1.1"
|
||||
viewBox="0 0 50 50"
|
||||
width="50px"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="Extension.svg"><metadata
|
||||
id="metadata21"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs19" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="715"
|
||||
id="namedview17"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.72"
|
||||
inkscape:cx="-49.682203"
|
||||
inkscape:cy="25"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" /><rect
|
||||
height="50.642853"
|
||||
width="51.0592"
|
||||
id="rect3"
|
||||
style="fill:#00d2e7;fill-opacity:1"
|
||||
x="0.21187516"
|
||||
y="0.20799911" /><ellipse
|
||||
cx="25.953344"
|
||||
cy="24.682013"
|
||||
stroke-miterlimit="10"
|
||||
id="circle5"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-linecap:round;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none"
|
||||
rx="14.542303"
|
||||
ry="14.545803" /><ellipse
|
||||
cx="25.953344"
|
||||
cy="24.682013"
|
||||
rx="7.2711515"
|
||||
ry="14.545803"
|
||||
stroke-miterlimit="10"
|
||||
id="ellipse7"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-linecap:round;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none" /><path
|
||||
d="m 14.661845,34.038604 c 2.666694,-1.641858 6.734298,-2.689763 11.291492,-2.689763 4.494784,0 8.512699,1.019416 11.180001,2.621274"
|
||||
stroke-miterlimit="10"
|
||||
id="path9"
|
||||
style="fill:#00d2e7;fill-opacity:0;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" /><path
|
||||
d="m 37.24483,15.326029 c -2.666697,1.641253 -6.734298,2.689156 -11.291493,2.689156 -4.494177,0 -8.512701,-1.019418 -11.180001,-2.621275"
|
||||
stroke-miterlimit="10"
|
||||
id="path11"
|
||||
style="fill:#00d2e7;fill-opacity:0;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" /><line
|
||||
stroke-miterlimit="10"
|
||||
x1="11.411036"
|
||||
x2="40.49564"
|
||||
y1="24.682013"
|
||||
y2="24.682013"
|
||||
id="line13"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none" /><line
|
||||
stroke-miterlimit="10"
|
||||
x1="25.953344"
|
||||
x2="25.953344"
|
||||
y1="10.136208"
|
||||
y2="39.227814"
|
||||
id="line15"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none" /></svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "###VENDOR_NAME###/static-info-tables-###LANG_ISO_LOWER###",
|
||||
"description": "###LANG_NAME### (###LANG_ISO_LOWER###) language pack for the Static Info Tables providing localized names for countries, currencies and so on.",
|
||||
"type": "typo3-cms-extension",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"authors": [
|
||||
{
|
||||
"name": "###AUTHOR###",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
"TYPO3",
|
||||
"Static Info Tables"
|
||||
],
|
||||
"replace": {
|
||||
"###VENDOR_NAME###/static-info-tables-###LANG_ISO_LOWER###": "self.version",
|
||||
"typo3-ter/static-info-tables-###LANG_ISO_LOWER###": "self.version"
|
||||
},
|
||||
"require": {
|
||||
"typo3/cms-core": ">=###TYPO3_VERSION_MIN###,<###TYPO3_VERSION_MAX###",
|
||||
"sjbr/static-info-tables": "^###VERSION_BASE###"
|
||||
},
|
||||
"extra": {
|
||||
"typo3/cms": {
|
||||
"extension-key": "static_info_tables_###LANG_ISO_LOWER###"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Extension Manager configuration file for ext "static_info_tables_###LANG_ISO_LOWER###"
|
||||
*/
|
||||
$EM_CONF[$_EXTKEY] = [
|
||||
'title' => 'Static Info Tables (###LANG_ISO_LOWER###)',
|
||||
'description' => '###LANG_NAME### (###LANG_ISO_LOWER###) language pack for the Static Info Tables providing localized names for countries, currencies and so on.',
|
||||
'category' => 'misc',
|
||||
'version' => '###VERSION###',
|
||||
'state' => 'stable',
|
||||
'author' => '###AUTHOR###',
|
||||
'author_email' => '###AUTHOR_EMAIL###',
|
||||
'author_company' => '###AUTHOR_COMPANY###',
|
||||
'constraints' => [
|
||||
'depends' => [
|
||||
'typo3' => '###TYPO3_VERSION_RANGE###',
|
||||
'static_info_tables' => '###VERSION_BASE###-',
|
||||
],
|
||||
'conflicts' => [],
|
||||
'suggests' => [],
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
defined('TYPO3') or die();
|
||||
|
||||
call_user_func(
|
||||
function ($extKey) {
|
||||
// Configure translation of suggestions labels
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
|
||||
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extKey . '/Configuration/PageTSconfig/Suggest.tsconfig">'
|
||||
);
|
||||
},
|
||||
'static_info_tables_###LANG_ISO_LOWER###'
|
||||
);
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
CREATE TABLE static_countries (
|
||||
cn_short_###LANG_ISO_LOWER### varchar(50) DEFAULT '' NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE static_currencies (
|
||||
cu_name_###LANG_ISO_LOWER### varchar(50) DEFAULT '' NOT NULL,
|
||||
cu_sub_name_###LANG_ISO_LOWER### varchar(20) DEFAULT '' NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE static_languages (
|
||||
lg_name_###LANG_ISO_LOWER### varchar(50) DEFAULT '' NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE static_territories (
|
||||
tr_name_###LANG_ISO_LOWER### varchar(50) DEFAULT '' NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE static_country_zones (
|
||||
zn_name_###LANG_ISO_LOWER### varchar(50) DEFAULT '' NOT NULL
|
||||
);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
###LANG_SQL_UPDATE###
|
||||
@@ -0,0 +1,33 @@
|
||||
<f:be.container includeCssFiles="{0:'{f:uri.resource(path:\'StyleSheets/manager.css\')}'}">
|
||||
<div class="typo3-fullDoc">
|
||||
<div id="typo3-docheader">
|
||||
<div class="typo3-docheader-functions">
|
||||
<div class="left">
|
||||
<f:be.buttons.csh />
|
||||
<f:be.menus.actionMenu>
|
||||
<f:be.menus.actionMenuItem label="{f:translate(key: 'information')}" controller="Manager" action="information" />
|
||||
<f:be.menus.actionMenuItem label="{f:translate(key: 'newLanguagePack')}" controller="Manager" action="newLanguagePack" />
|
||||
<f:be.menus.actionMenuItem label="{f:translate(key: 'testForm')}" controller="Manager" action="testForm" />
|
||||
<f:be.menus.actionMenuItem label="{f:translate(key: 'sqlDumpNonLocalizedData')}" controller="Manager" action="sqlDumpNonLocalizedData" />
|
||||
</f:be.menus.actionMenu>
|
||||
</div>
|
||||
<div class="right">
|
||||
</div>
|
||||
</div>
|
||||
<div class="typo3-docheader-buttons">
|
||||
<div class="left">
|
||||
</div>
|
||||
<div class="right">
|
||||
<f:be.buttons.shortcut />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="typo3-docbody">
|
||||
<div id="typo3-inner-docbody">
|
||||
<h2><f:translate key="title">Static Info Tables Manager</f:translate></h2>
|
||||
<f:flashMessages />
|
||||
<f:render section="Content" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</f:be.container>
|
||||
@@ -0,0 +1,10 @@
|
||||
<f:form.validationResults for="{for}">
|
||||
<f:if condition="{validationResults.flattenedErrors}">
|
||||
<ul class="errors">
|
||||
<f:for each="{validationResults.errors}" as="error">
|
||||
<!--<li>{error.code}: {error}</li>-->
|
||||
<li><f:translate key="{error.code}">{error.code}</f:translate></li>
|
||||
</f:for>
|
||||
</ul>
|
||||
</f:if>
|
||||
</f:form.validationResults>
|
||||
@@ -0,0 +1,18 @@
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="iconButtons">
|
||||
</f:section>
|
||||
|
||||
<f:section name="Content">
|
||||
<h3>{f:translate(key: 'actionList')}</h3>
|
||||
<dl class="t3-overview-list">
|
||||
<f:for each="{actions}" as="action" key="key">
|
||||
<dt>
|
||||
<f:link.action action="{action.code}">
|
||||
<f:translate key="{action.title}" />
|
||||
</f:link.action>
|
||||
</dt>
|
||||
<dd><f:translate key="{action.description}" /></dd>
|
||||
</f:for>
|
||||
</dl>
|
||||
</f:section>
|
||||
@@ -0,0 +1,57 @@
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="Content">
|
||||
<h3>{f:translate(key: 'createLanguagePackTitle')}</h3>
|
||||
<f:form method="post" controller="Manager" action="createLanguagePack" name="languagePack" object="{languagePack}" class="sjbr-static-info-tables-manager">
|
||||
<fieldset>
|
||||
<dl>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-locale">{f:translate(key: 'language')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.select id="sjbr-static-info-tables-manager-locale" property="locale" options="{locales}" optionValueField="collatingLocale" optionLabelField="nameEn" />
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-version">{f:translate(key: 'version')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.textfield id="sjbr-static-info-tables-manager-version" property="version" size="50" />
|
||||
<f:render partial="FormErrors" arguments="{for: 'languagePack.version'}" />
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-vendorName">{f:translate(key: 'vendorName')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.textfield id="sjbr-static-info-tables-manager-vendorName" property="vendorName" size="50" />
|
||||
<f:render partial="FormErrors" arguments="{for: 'languagePack.vendorName'}" />
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-author">{f:translate(key: 'author')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.textfield id="sjbr-static-info-tables-manager-author" property="author" size="50" />
|
||||
<f:render partial="FormErrors" arguments="{for: 'languagePack.author'}" />
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-authorCompany">{f:translate(key: 'authorCompany')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.textfield id="sjbr-static-info-tables-manager-authorCompany" property="authorCompany" size="50" />
|
||||
<f:render partial="FormErrors" arguments="{for: 'languagePack.authorCompany'}" />
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-authorEmail">{f:translate(key: 'authorEmail')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.textfield id="sjbr-static-info-tables-manager-authorEmail" property="authorEmail" size="50" />
|
||||
<f:render partial="FormErrors" arguments="{for: 'languagePack.authorEmail'}" />
|
||||
</dd>
|
||||
<dt>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.submit class="submit" value="{f:translate(key: 'createLanguagePackSubmit')}" />
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</f:form>
|
||||
</f:section>
|
||||
@@ -0,0 +1,39 @@
|
||||
{namespace static=SJBR\StaticInfoTables\ViewHelpers}
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="Content">
|
||||
<h3>{f:translate(key: 'testFormTitle')}</h3>
|
||||
<f:form method="post" controller="Manager" action="testForm" name="testForm" class="sjbr-static-info-tables-manager">
|
||||
<fieldset>
|
||||
<dl>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-country">{f:translate(key: 'selectCountry')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<static:form.select id="sjbr-static-info-tables-manager-country" name="country" staticInfoTable="country" options="{}" value="{selectedCountry}" additionalAttributes="{onchange:'javascript:this.form.submit();'}"/>
|
||||
</dd>
|
||||
<f:if condition="{selectedCountry}">
|
||||
<f:if condition="{selectedCountry.countryZones}">
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-country-zone">{f:translate(key: 'selectCountryZone')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<static:form.select id="sjbr-static-info-tables-manager-country-zone" name="countryZone" staticInfoTable="countryZone" staticInfoTableSubselect="{country: '{selectedCountry.uid}'}" options="{}" value="{selectedCountryZone}" />
|
||||
</dd>
|
||||
</f:if>
|
||||
</f:if>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-language">{f:translate(key: 'selectLanguage')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<static:form.select id="sjbr-static-info-tables-manager-language" name="language" staticInfoTable="language" options="{}" value="{selectedLanguage}" />
|
||||
</dd>
|
||||
<dt>
|
||||
</dt>
|
||||
<dd>
|
||||
<f:form.submit class="submit" value="{f:translate(key: 'testFormSubmit')}" />
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</f:form>
|
||||
</f:section>
|
||||
@@ -0,0 +1,44 @@
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="Content">
|
||||
<h3>{f:translate(key: 'testFormResultTitle')}</h3>
|
||||
<dl class="sjbr-static-info-tables-manager">
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-country">{f:translate(key: 'countryLocalizedName')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong>{country.nameLocalized}</strong>
|
||||
<br /><strong>{country.isoCodeA3}</strong>
|
||||
</dd>
|
||||
<f:if condition="{countryZone}">
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-country-zone">{f:translate(key: 'countryZoneLocalizedName')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong>{countryZone.nameLocalized}</strong>
|
||||
<br /><strong>{countryZone.isoCode}</strong>
|
||||
</dd>
|
||||
</f:if>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-currency">{f:translate(key: 'currencyLocalizedName')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong>{currency.nameLocalized}</strong>
|
||||
<br /><strong>{currency.isoCodeA3}</strong>
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-language">{f:translate(key: 'languageLocalizedName')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong>{language.nameLocalized}</strong>
|
||||
<br /><strong>{language.isoCodeA2}<f:if condition="{language.countryIsoCodeA2}">_{language.countryIsoCodeA2}</f:if></strong>
|
||||
</dd>
|
||||
<dt>
|
||||
<label for="sjbr-static-info-tables-manager-territory">{f:translate(key: 'territoryLocalizedName')}:</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<strong>{territory.nameLocalized}</strong>
|
||||
<br /><strong>{territory.unCodeNumber}</strong>
|
||||
</dd>
|
||||
</dl>
|
||||
</f:section>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
enable-background="new 0 0 50 50"
|
||||
height="50px"
|
||||
id="Layer_1"
|
||||
version="1.1"
|
||||
viewBox="0 0 50 50"
|
||||
width="50px"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="Extension.svg"><metadata
|
||||
id="metadata21"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs19" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="715"
|
||||
id="namedview17"
|
||||
showgrid="false"
|
||||
inkscape:zoom="4.72"
|
||||
inkscape:cx="-49.682203"
|
||||
inkscape:cy="25"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" /><rect
|
||||
height="50.642853"
|
||||
width="51.0592"
|
||||
id="rect3"
|
||||
style="fill:#00d2e7;fill-opacity:1"
|
||||
x="0.21187516"
|
||||
y="0.20799911" /><ellipse
|
||||
cx="25.953344"
|
||||
cy="24.682013"
|
||||
stroke-miterlimit="10"
|
||||
id="circle5"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-linecap:round;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none"
|
||||
rx="14.542303"
|
||||
ry="14.545803" /><ellipse
|
||||
cx="25.953344"
|
||||
cy="24.682013"
|
||||
rx="7.2711515"
|
||||
ry="14.545803"
|
||||
stroke-miterlimit="10"
|
||||
id="ellipse7"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-linecap:round;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none" /><path
|
||||
d="m 14.661845,34.038604 c 2.666694,-1.641858 6.734298,-2.689763 11.291492,-2.689763 4.494784,0 8.512699,1.019416 11.180001,2.621274"
|
||||
stroke-miterlimit="10"
|
||||
id="path9"
|
||||
style="fill:#00d2e7;fill-opacity:0;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" /><path
|
||||
d="m 37.24483,15.326029 c -2.666697,1.641253 -6.734298,2.689156 -11.291493,2.689156 -4.494177,0 -8.512701,-1.019418 -11.180001,-2.621275"
|
||||
stroke-miterlimit="10"
|
||||
id="path11"
|
||||
style="fill:#00d2e7;fill-opacity:0;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" /><line
|
||||
stroke-miterlimit="10"
|
||||
x1="11.411036"
|
||||
x2="40.49564"
|
||||
y1="24.682013"
|
||||
y2="24.682013"
|
||||
id="line13"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none" /><line
|
||||
stroke-miterlimit="10"
|
||||
x1="25.953344"
|
||||
x2="25.953344"
|
||||
y1="10.136208"
|
||||
y2="39.227814"
|
||||
id="line15"
|
||||
style="fill:#00d2e7;stroke:#ffffff;stroke-width:1.812;stroke-miterlimit:10;stroke-opacity:1;fill-opacity:0;stroke-dasharray:none" /></svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 274 B |
@@ -0,0 +1,11 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
wdith="16"
|
||||
height="16">
|
||||
<g>
|
||||
<image x="0" y="0" width="16" height="16"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADjSURBVDhPtY8xCsJAEEV/ArZewMYiWHsMG08hKqkE9QApciC9gnWOkVbwBjp/dnazWSVEwQefTML8txv8lbZtnwwqdPkKKzVNI8Wqk8xQLW6XvMQaOGKDEw7YSeY4Y4uVnhyKvpRmiLqudYm4ZTldXqPysMDDG7hbmEBF9isfJP6jhrBMKgrC6RQxuhewkkv37iTvAt5EdwK9Mp9Led4txM9pXF2GWMBMbYEZJWBiSZ5lYWlQsEcZBLEkE8EYWCYce4KJzI+i0FMI5zR6A6NX5nyV+GsSP6fRtqFFn3hprOAHgBfdA2aUg91FWQAAAABJRU5ErkJggg=="/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 683 B |
@@ -0,0 +1,11 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
wdith="16"
|
||||
height="16">
|
||||
<g>
|
||||
<image x="0" y="0" width="16" height="16"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADjSURBVDhPtY8xCsJAEEV/ArZewMYiWHsMG08hKqkE9QApciC9gnWOkVbwBjp/dnazWSVEwQefTML8txv8lbZtnwwqdPkKKzVNI8Wqk8xQLW6XvMQaOGKDEw7YSeY4Y4uVnhyKvpRmiLqudYm4ZTldXqPysMDDG7hbmEBF9isfJP6jhrBMKgrC6RQxuhewkkv37iTvAt5EdwK9Mp9Led4txM9pXF2GWMBMbYEZJWBiSZ5lYWlQsEcZBLEkE8EYWCYce4KJzI+i0FMI5zR6A6NX5nyV+GsSP6fRtqFFn3hprOAHgBfdA2aUg91FWQAAAABJRU5ErkJggg=="/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 683 B |
@@ -0,0 +1,11 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
wdith="16"
|
||||
height="16">
|
||||
<g>
|
||||
<image x="0" y="0" width="16" height="16"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHySURBVDhPnZPBSxtBGMU/b4J/wULAsBCwhICEhbCUEGzYhiVpCAmLS0soVhKyKERqMDEKQdBDQQsN4kEvQrEUC6Vqte2hllxEqLZKqJ4E9aKnXHLw+JzZTdImipi+5e03szvvNzuzDLWjDnrkN+gJvaRBGqU0JZnJThkigUAhZpXQFSR4X8ggH+sTQZI8SKaGePsOuQjBdwGEPgQR/67j+Q/drNpaGK58D5SFPvgXvPC8csOTdcMRt8EZE9EruWrgLkJ4VUWUBabLw9g6X0RxbwJi1gZXwWFC9BUV838mkSg9Q2w9AnXZD2dGtACy1w19M4rMrwTWT4u4uNo3g/rHmBWu1ePKNvIHKTzdikFdUSD22yxAOKxA24gi9zuJo8pXnFR3rJlr5gDu0tkqZsppjLFx+jcNkuK2AJoe4Y0m8wBfO5+5Dvp5+RlThway7Ev1TQ2CTbAATGYIsFzvNy2BAc6ruyiUDYzuJRB8r9bGdczOtYbrtZttojAiQBzrxtB2HK/LWRYeRORTCP4lHwKhAB9n6sbs3PUl8Kq+Vcy/pH2JQn4jwTcvY3jE+AvgvgXS0ENZMp/1JbxwpkU4c46m941QC+TeaoT+G8DdEm4LwPVvsO1wk/ixJc9+5wA7ugM0zg6pnR6zq4fVJBn0gN0tEV0DzaZNeTLFLDYAAAAASUVORK5CYII="/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,11 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
wdith="16"
|
||||
height="16">
|
||||
<g>
|
||||
<image x="0" y="0" width="16" height="16"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD0SURBVDhPzVC7DcIwEH0W7hmAhpYJYAHEHAghoErER6KkSMkwsEfGSEHBDuHu7HNiJ6Si4ElPPp/fe3cJ/gEWmD8xGb9GFndjsTA2h8ENqKqqZlIdeEaGHXGNI/bIgQ0OWGJK5ZVaW6yozqjKcYGayrKs6dIEYeaHf4FOFaOaUg6hKAoRMZyYptO1Ze4N0AchgzdwW/gACfKf4nQB0iCJUO9sZtw4IEznIKZoAiJzc7otugG8yUBAQxYT1ZwE2PfD0HkiOkM3JAnQn+neI2gzCfEBzDCdKe8RgolPrcNfD5Pd6mxIIQ+xORL29TpoiwaFPwTwAW31AbaFOEzOAAAAAElFTkSuQmCC"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 703 B |
@@ -0,0 +1,11 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
wdith="16"
|
||||
height="16">
|
||||
<g>
|
||||
<image x="0" y="0" width="16" height="16"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADBSURBVDhPpZDRDYMwDEQ9DIPykfEYg99K3SD1c2LHBErV9qQzJPG9GKT+qVvAvu9mWSU862vADLkEzKFt26rIethz3QIsmELZrktAKSWaLMDtugyALrCdW1X5Zj5kgjZFBxiof0rvsTpCzb4mjFYAcTv9LYOszuHxbFOcAUwi9aG2rhkwzJnaw3cADAC/BfjP1EL4BMAA8AGA43aspcvePHgGcKObvjb6c1nMHz8hxkz2vTgDgHLT3IjyOjsAv6nWF4p+lbfy5QbsAAAAAElFTkSuQmCC"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 635 B |
@@ -0,0 +1,39 @@
|
||||
.sjbr-static-info-tables-manager dl {
|
||||
margin: 0;
|
||||
padding: 1em 0 0 0;
|
||||
}
|
||||
|
||||
.sjbr-static-info-tables-manager dt,
|
||||
.sjbr-static-info-tables-manager dd {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0 0 .5em 0;
|
||||
}
|
||||
|
||||
.sjbr-static-info-tables-manager dt {
|
||||
clear: left;
|
||||
margin-top: 5px;
|
||||
padding-right: 1em;
|
||||
text-align: right;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.sjbr-static-info-tables-manager dd {
|
||||
margin-top: 8px;
|
||||
text-align: left;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.sjbr-static-info-tables-manager dd input {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.sjbr-static-info-tables-manager dd label {
|
||||
margin-bottom: 3px;
|
||||
padding: 0 0 0 .5em;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.sjbr-static-info-tables-manager ul.errors li {
|
||||
font-weight: bold;
|
||||
}
|
||||
59
typo3conf/ext/static_info_tables/composer.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "sjbr/static-info-tables",
|
||||
"description": "Data and API for countries, languages and currencies for use in TYPO3 CMS.",
|
||||
"type": "typo3-cms-extension",
|
||||
"license": "GPL-2.0-or-later",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Stanislas Rolland",
|
||||
"homepage": "https://www.sjbr.ca",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "René Fritz",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"keywords": [
|
||||
"TYPO3",
|
||||
"Static Info Tables"
|
||||
],
|
||||
"homepage": "https://codeberg.org/sjbr/static-info-tables",
|
||||
"support": {
|
||||
"issues": "https://codeberg.org/sjbr/static-info-tables/issues"
|
||||
},
|
||||
"replace": {
|
||||
"typo3-ter/static-info-tables": "self.version"
|
||||
},
|
||||
"require": {
|
||||
"typo3/cms-backend": ">=11.5, <12.0",
|
||||
"typo3/cms-core": ">=11.5, <12.0",
|
||||
"typo3/cms-extbase": ">=11.5, <12.0",
|
||||
"typo3/cms-extensionmanager": ">=11.5, <12.0",
|
||||
"typo3/cms-fluid": ">=11.5, <12.0",
|
||||
"typo3/cms-frontend": ">=11.5, <12.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"SJBR\\StaticInfoTables\\": "Classes/"
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"Classes/Domain/Model/Country",
|
||||
"Classes/Domain/Model/CountryZone",
|
||||
"Classes/Domain/Model/Currency",
|
||||
"Classes/Domain/Model/Language",
|
||||
"Classes/Domain/Model/Territory"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"typo3/cms": {
|
||||
"extension-key": "static_info_tables"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"typo3/class-alias-loader": true,
|
||||
"typo3/cms-composer-installers": true
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
typo3conf/ext/static_info_tables/doc/manual.odt
Normal file
9
typo3conf/ext/static_info_tables/ext_autoload.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
||||
/*
|
||||
* Register necessary class names with autoloader
|
||||
*/
|
||||
$extensionPath = ExtensionManagementUtility::extPath('static_info_tables');
|
||||
return [
|
||||
'tx_staticinfotables_pi1' => $extensionPath . 'pi1/class.tx_staticinfotables_pi1.php',
|
||||
];
|
||||
3
typo3conf/ext/static_info_tables/ext_conf_template.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
# cat=enable; type=boolean; label=LLL:EXT:static_info_tables/Resources/Private/Language/locallang.xlf:enableStaticInfoTablesManager
|
||||
enableManager = 0
|
||||