openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit e6246ac6809db6fd58ca2596d64b68b67bae5cc1
parent f9ecd556a0686684b54c60db891eddf037ad2ac2
Author: Jan Dankert <develop@jandankert.de>
Date:   Sun, 28 Nov 2021 23:18:53 +0100

Refactoring: Extracting default config to action class (do not know if this is good)

Diffstat:
Mmodules/cms/action/LanguageAction.class.php | 139+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/cms/base/DefaultConfig.class.php | 141++-----------------------------------------------------------------------------
2 files changed, 142 insertions(+), 138 deletions(-)

diff --git a/modules/cms/action/LanguageAction.class.php b/modules/cms/action/LanguageAction.class.php @@ -35,6 +35,145 @@ use util\exception\SecurityException; */ class LanguageAction extends BaseAction { + const LANGUAGE_LIST = + [ + 'AA' => 'Afar', + 'AB' => 'Abkhazian', + 'AF' => 'Afrikaans', + 'AM' => 'Amharic', + 'AR' => 'Arabic', + 'AS' => 'Assamese', + 'AY' => 'Aymara', + 'AZ' => 'Azerbaijani', + 'BA' => 'Bashkir', + 'BE' => 'Byelorussian', + 'BG' => 'Bulgarian', + 'BH' => 'Bihari', + 'BI' => 'Bislama', + 'BN' => 'Bengali', + 'BO' => 'Tibetan', + 'BR' => 'Breton', + 'CA' => 'Catalan', + 'CO' => 'Corsican', + 'CS' => 'Czech', + 'CY' => 'Welsh', + 'DA' => 'Danish', + 'DE' => 'German', + 'DZ' => 'Bhutani', + 'EL' => 'Greek', + 'EN' => 'English', + 'EO' => 'Esperanto', + 'ES' => 'Spanish', + 'ET' => 'Estonian', + 'EU' => 'Basque', + 'FA' => 'Persian', + 'FI' => 'Finnish', + 'FJ' => 'Fiji', + 'FO' => 'Faeroese', + 'FR' => 'French', + 'FY' => 'Frisian', + 'GA' => 'Irish', + 'GD' => 'Gaelic', + 'GL' => 'Galician', + 'GN' => 'Guarani', + 'GU' => 'Gujarati', + 'HA' => 'Hausa', + 'HI' => 'Hindi', + 'HR' => 'Croatian', + 'HU' => 'Hungarian', + 'HY' => 'Armenian', + 'IA' => 'Interlingua', + 'IE' => 'Interlingue', + 'IK' => 'Inupiak', + 'IN' => 'Indonesian', + 'IS' => 'Icelandic', + 'IT' => 'Italian', + 'IW' => 'Hebrew', + 'JA' => 'Japanese', + 'JI' => 'Yiddish', + 'JW' => 'Javanese', + 'KA' => 'Georgian', + 'KK' => 'Kazakh', + 'KL' => 'Greenlandic', + 'KM' => 'Cambodian', + 'KN' => 'Kannada', + 'KO' => 'Korean', + 'KS' => 'Kashmiri', + 'KU' => 'Kurdish', + 'KY' => 'Kirghiz', + 'LA' => 'Latin', + 'LN' => 'Lingala', + 'LO' => 'Laothian', + 'LT' => 'Lithuanian', + 'LV' => 'Latvian', + 'MG' => 'Malagasy', + 'MI' => 'Maori', + 'MK' => 'Macedonian', + 'ML' => 'Malayalam', + 'MN' => 'Mongolian', + 'MO' => 'Moldavian', + 'MR' => 'Marathi', + 'MS' => 'Malay', + 'MT' => 'Maltese', + 'MY' => 'Burmese', + 'NA' => 'Nauru', + 'NE' => 'Nepali', + 'NL' => 'Dutch', + 'NO' => 'Norwegian', + 'OC' => 'Occitan', + 'OM' => 'Oromo', + 'OR' => 'Oriya', + 'PA' => 'Punjabi', + 'PL' => 'Polish', + 'PS' => 'Pashto', + 'PT' => 'Portuguese', + 'QU' => 'Quechua', + 'RM' => 'Rhaeto-Romance', + 'RN' => 'Kirundi', + 'RO' => 'Romanian', + 'RU' => 'Russian', + 'RW' => 'Kinyarwanda', + 'SA' => 'Sanskrit', + 'SD' => 'Sindhi', + 'SG' => 'Sangro', + 'SH' => 'Serbo-Croatian', + 'SI' => 'Singhalese', + 'SK' => 'Slovak', + 'SL' => 'Slovenian', + 'SM' => 'Samoan', + 'SN' => 'Shona', + 'SO' => 'Somali', + 'SQ' => 'Albanian', + 'SR' => 'Serbian', + 'SS' => 'Siswati', + 'ST' => 'Sesotho', + 'SU' => 'Sudanese', + 'SV' => 'Swedish', + 'SW' => 'Swahili', + 'TA' => 'Tamil', + 'TE' => 'Tegulu', + 'TG' => 'Tajik', + 'TH' => 'Thai', + 'TI' => 'Tigrinya', + 'TK' => 'Turkmen', + 'TL' => 'Tagalog', + 'TN' => 'Setswana', + 'TO' => 'Tonga', + 'TR' => 'Turkish', + 'TS' => 'Tsonga', + 'TT' => 'Tatar', + 'TW' => 'Twi', + 'UK' => 'Ukrainian', + 'UR' => 'Urdu', + 'UZ' => 'Uzbek', + 'VI' => 'Vietnamese', + 'VO' => 'Volapuk', + 'WO' => 'Wolof', + 'XH' => 'Xhosa', + 'YO' => 'Yoruba', + 'ZH' => 'Chinese', + ]; + /** * Zu bearbeitende Sprache, wird im Kontruktor instanziiert * @type Language diff --git a/modules/cms/base/DefaultConfig.class.php b/modules/cms/base/DefaultConfig.class.php @@ -4,6 +4,8 @@ namespace cms\base; +use cms\action\LanguageAction; + /** * Default configuration. */ @@ -39,144 +41,7 @@ class DefaultConfig { 'auto_reload' => true, 'session_destroy_on_config_reload' => true, ], - 'countries' => - [ - 'AA' => 'Afar', - 'AB' => 'Abkhazian', - 'AF' => 'Afrikaans', - 'AM' => 'Amharic', - 'AR' => 'Arabic', - 'AS' => 'Assamese', - 'AY' => 'Aymara', - 'AZ' => 'Azerbaijani', - 'BA' => 'Bashkir', - 'BE' => 'Byelorussian', - 'BG' => 'Bulgarian', - 'BH' => 'Bihari', - 'BI' => 'Bislama', - 'BN' => 'Bengali', - 'BO' => 'Tibetan', - 'BR' => 'Breton', - 'CA' => 'Catalan', - 'CO' => 'Corsican', - 'CS' => 'Czech', - 'CY' => 'Welsh', - 'DA' => 'Danish', - 'DE' => 'German', - 'DZ' => 'Bhutani', - 'EL' => 'Greek', - 'EN' => 'English', - 'EO' => 'Esperanto', - 'ES' => 'Spanish', - 'ET' => 'Estonian', - 'EU' => 'Basque', - 'FA' => 'Persian', - 'FI' => 'Finnish', - 'FJ' => 'Fiji', - 'FO' => 'Faeroese', - 'FR' => 'French', - 'FY' => 'Frisian', - 'GA' => 'Irish', - 'GD' => 'Gaelic', - 'GL' => 'Galician', - 'GN' => 'Guarani', - 'GU' => 'Gujarati', - 'HA' => 'Hausa', - 'HI' => 'Hindi', - 'HR' => 'Croatian', - 'HU' => 'Hungarian', - 'HY' => 'Armenian', - 'IA' => 'Interlingua', - 'IE' => 'Interlingue', - 'IK' => 'Inupiak', - 'IN' => 'Indonesian', - 'IS' => 'Icelandic', - 'IT' => 'Italian', - 'IW' => 'Hebrew', - 'JA' => 'Japanese', - 'JI' => 'Yiddish', - 'JW' => 'Javanese', - 'KA' => 'Georgian', - 'KK' => 'Kazakh', - 'KL' => 'Greenlandic', - 'KM' => 'Cambodian', - 'KN' => 'Kannada', - 'KO' => 'Korean', - 'KS' => 'Kashmiri', - 'KU' => 'Kurdish', - 'KY' => 'Kirghiz', - 'LA' => 'Latin', - 'LN' => 'Lingala', - 'LO' => 'Laothian', - 'LT' => 'Lithuanian', - 'LV' => 'Latvian', - 'MG' => 'Malagasy', - 'MI' => 'Maori', - 'MK' => 'Macedonian', - 'ML' => 'Malayalam', - 'MN' => 'Mongolian', - 'MO' => 'Moldavian', - 'MR' => 'Marathi', - 'MS' => 'Malay', - 'MT' => 'Maltese', - 'MY' => 'Burmese', - 'NA' => 'Nauru', - 'NE' => 'Nepali', - 'NL' => 'Dutch', - 'NO' => 'Norwegian', - 'OC' => 'Occitan', - 'OM' => 'Oromo', - 'OR' => 'Oriya', - 'PA' => 'Punjabi', - 'PL' => 'Polish', - 'PS' => 'Pashto', - 'PT' => 'Portuguese', - 'QU' => 'Quechua', - 'RM' => 'Rhaeto-Romance', - 'RN' => 'Kirundi', - 'RO' => 'Romanian', - 'RU' => 'Russian', - 'RW' => 'Kinyarwanda', - 'SA' => 'Sanskrit', - 'SD' => 'Sindhi', - 'SG' => 'Sangro', - 'SH' => 'Serbo-Croatian', - 'SI' => 'Singhalese', - 'SK' => 'Slovak', - 'SL' => 'Slovenian', - 'SM' => 'Samoan', - 'SN' => 'Shona', - 'SO' => 'Somali', - 'SQ' => 'Albanian', - 'SR' => 'Serbian', - 'SS' => 'Siswati', - 'ST' => 'Sesotho', - 'SU' => 'Sudanese', - 'SV' => 'Swedish', - 'SW' => 'Swahili', - 'TA' => 'Tamil', - 'TE' => 'Tegulu', - 'TG' => 'Tajik', - 'TH' => 'Thai', - 'TI' => 'Tigrinya', - 'TK' => 'Turkmen', - 'TL' => 'Tagalog', - 'TN' => 'Setswana', - 'TO' => 'Tonga', - 'TR' => 'Turkish', - 'TS' => 'Tsonga', - 'TT' => 'Tatar', - 'TW' => 'Twi', - 'UK' => 'Ukrainian', - 'UR' => 'Urdu', - 'UZ' => 'Uzbek', - 'VI' => 'Vietnamese', - 'VO' => 'Volapuk', - 'WO' => 'Wolof', - 'XH' => 'Xhosa', - 'YO' => 'Yoruba', - 'ZH' => 'Chinese', - ], + 'countries' => LanguageAction::LANGUAGE_LIST, 'database' => [ ],