From 77ae0327c1f7aa84b6b7828afbd2a96930babdcc Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Fri, 12 Mar 2021 20:35:49 +0100 Subject: [PATCH] Add controlled lists of recording types and external hosting options --- l18n | 2 +- src/MDExternalHostingSet.php | 20 ++++++++++++++++++++ src/MDRecordingTypesSet.php | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/MDExternalHostingSet.php create mode 100644 src/MDRecordingTypesSet.php diff --git a/l18n b/l18n index 2c74a45..7d645af 160000 --- a/l18n +++ b/l18n @@ -1 +1 @@ -Subproject commit 2c74a458f34b8d1976fe18361fe10ea535a94d00 +Subproject commit 7d645afa2b7b6c88066adb4d76d79107635f55ab diff --git a/src/MDExternalHostingSet.php b/src/MDExternalHostingSet.php new file mode 100644 index 0000000..7b54003 --- /dev/null +++ b/src/MDExternalHostingSet.php @@ -0,0 +1,20 @@ + + */ +declare(strict_types = 1); + +/** + * Class containing available external sources. + */ +final class MDExternalHostingSet extends MDValueSet { + + const DEFAULT_EXTERNAL_HOSTING = 'Archive.org'; + + const EXTERNAL_SOURCES = [ + 'Archive.org', + ]; + +} diff --git a/src/MDRecordingTypesSet.php b/src/MDRecordingTypesSet.php new file mode 100644 index 0000000..8a716c2 --- /dev/null +++ b/src/MDRecordingTypesSet.php @@ -0,0 +1,32 @@ + + */ +declare(strict_types = 1); + +/** + * Class containing available recording types. + */ +final class MDRecordingTypesSet extends MDValueSet { + + const DEFAULT_RECORDING_TYPE = 'audio'; + + const RECORDING_TYPES = [ + 'audio', + 'video', + ]; + + /** + * Gets a list of the entries in a translated version. + * + * @param MDTlLoader $tlLoader Translation loader. + * + * @return array + */ + public static function getSortedList(MDTlLoader $tlLoader):array { + return parent::getTlSortedList($tlLoader, self::RECORDING_TYPES, "recording_types_set", "recording_types_set"); + + } +}