Compare commits

..

23 Commits

Author SHA1 Message Date
276420017d Add some more Hungarian translations 2021-10-22 17:18:02 +02:00
1ac18b9d4c Add list of available licenses without their links 2021-10-21 15:38:00 +02:00
08385bef21 Add a list of all allowed language codes 2021-10-21 14:08:56 +02:00
3e58dce1e3 Add allowed value set for closer location (e.g. for archeological
objects)
2021-10-21 01:38:17 +02:00
ee24739002 Add missing newlines between constants in MDEventsSet and
MDRequirementsSet
2021-10-11 15:11:15 +02:00
ca5be31efb Add generic other name variants to list of accepted name variant types 2021-10-10 14:08:06 +02:00
7718cd3aa2 Update translation files 2021-10-09 17:08:38 +02:00
fecf25d72c Add translation option to MDResearchStatusSet 2021-10-09 15:05:45 +02:00
35b713f1c9 Add controlled list of research status (for now for actors) 2021-10-09 14:07:35 +02:00
4daf580355 Add controlled list of conservation status 2021-10-07 16:08:31 +02:00
c3dfdbb5ac Add civil name as a name variant type
Close #6
2021-10-06 13:05:28 +02:00
913fcbbaea Add artist name as an actor variant type 2021-09-24 17:45:12 +02:00
7f6c723095 Add actor name variant type "nickname" 2021-09-24 10:49:01 +02:00
db240f9d3d Add MDActorVariantTypesSet for controlling variant types for actor names 2021-08-19 00:44:15 +02:00
ce35fd35cd Add new constant MDRequirementsSet::MAX_AGE_AFTER_USER_INVITE to
streamline max age of unvalidated accounts before automatic deletion
2021-07-27 16:37:46 +02:00
1b1d2cb6eb Add kalliope to MDObjectSyndicationSet 2021-07-25 10:30:05 +02:00
a2753781f9 Add SMB-digital to MDObjectSyndicationSet 2021-07-23 16:02:34 +02:00
c06729f477 Add expected mime types for different types of contents in
MDRequirementsSet
2021-07-20 03:33:30 +02:00
d5bc140889 Add MDRequirementsSet to list commonly used requirements 2021-07-20 00:12:34 +02:00
1905450776 Fix typing bug 2021-07-15 17:13:08 +02:00
3ea3a9f2c0 Fix bug in and add validity check in MDObjectSyndicationSet 2021-07-15 16:56:54 +02:00
c4ac0f0fb4 Add class MDObjectSyndicationSet to list other repositories for museum
objects
2021-07-15 14:27:23 +02:00
e208308c8d Add marking type "glued" 2021-07-12 15:34:59 +02:00
11 changed files with 485 additions and 1 deletions

2
l18n

Submodule l18n updated: b4a7e98654...98087dfab7

View File

@@ -0,0 +1,40 @@
<?PHP
/**
* Class containing available types for actor name variants. E.g. birth names,
* married names, etc.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class containing available types for actor name variants. E.g. birth names,
* married names, etc.
*/
final class MDActorVariantTypesSet extends MDValueSet {
const ACTOR_VARIANT_TYPES = [
'',
'birth_name',
'civil_name',
'married_name',
'monastic_name',
'pseudonym',
'regnal_name',
'nickname',
'artist_name',
'generic_other_name',
];
/**
* Returns a translated list of name variants.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getActorVariantTypesTLed(MDTlLoader $tlLoader):array {
return parent::getTlUnsortedList($tlLoader, self::ACTOR_VARIANT_TYPES, "actor_variant_types_set", "actor_variant_types_set");
}
}

View File

@@ -0,0 +1,32 @@
<?PHP
/**
* Contains a class of available types of closer locations.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class containing available types of closer locations.
*/
final class MDCloserLocationTypesSet extends MDValueSet {
const CLOSER_LOCATION_TYPES = [
"0", // ''
"1", // Place of recording
"2", // Place of finding
"3", // Previous place
];
/**
* Gets a list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array {
return parent::getTlSortedList($tlLoader, self::CLOSER_LOCATION_TYPES, "closer_location_types_set", "closer_location_types_set");
}
}

View File

@@ -0,0 +1,21 @@
<?PHP
/**
* Contains a class for controlling the list of available recording types and sources.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class containing available units for weights, lengths etc.
*/
final class MDConservationStatusSet extends MDValueSet {
const STATUS_LEVELS = [
1 => '',
34 => 'markedBad',
67 => 'markedMedium',
100 => 'markedGood'
];
}

View File

@@ -62,12 +62,16 @@ final class MDEventsSet extends MDValueSet {
]; ];
const EVENTS_PRODUCTION = [1, 7, 9, 10, 19, 20, 26, 38, 39]; const EVENTS_PRODUCTION = [1, 7, 9, 10, 19, 20, 26, 38, 39];
// Array enthält solche Ereignisse, die nach der Herstellung passiert sein müssen // Array enthält solche Ereignisse, die nach der Herstellung passiert sein müssen
const EVENTS_POST_PRODUCTION = [2, 3, 6, 8, 11, 13, 14, 15, 32, 34, 37, 40, 41, 42, 43, 44, 45, 46, 47]; const EVENTS_POST_PRODUCTION = [2, 3, 6, 8, 11, 13, 14, 15, 32, 34, 37, 40, 41, 42, 43, 44, 45, 46, 47];
// Array enthält solche Ereignisse, die vor der Herstellung passiert sein müssen // Array enthält solche Ereignisse, die vor der Herstellung passiert sein müssen
const EVENTS_PRE_PRODUCTION = [4, 12, 25, 29, 30, 31, 35]; const EVENTS_PRE_PRODUCTION = [4, 12, 25, 29, 30, 31, 35];
// Array enthält solche Ereignisse, die sich auf Objekte beziehen, die nicht hergestellt wurden // Array enthält solche Ereignisse, die sich auf Objekte beziehen, die nicht hergestellt wurden
const EVENTS_NO_PRODUCTION = [21]; const EVENTS_NO_PRODUCTION = [21];
// Array enthält Ereignistypen, die auf Korrespondenzen hinweisen // Array enthält Ereignistypen, die auf Korrespondenzen hinweisen
const EVENTS_CORRESPONDENCE = [11, 13]; const EVENTS_CORRESPONDENCE = [11, 13];

View File

@@ -11,6 +11,198 @@ declare(strict_types = 1);
*/ */
final class MDLanguagesSet { final class MDLanguagesSet {
const AVAILABLE_LANGUAGES_SHORT = [
'aa',
'ab',
'ae',
'af',
'ak',
'am',
'an',
'ar',
'as',
'av',
'ay',
'az',
'ba',
'be',
'bg',
'bh',
'bi',
'bm',
'bn',
'bo',
'br',
'bs',
'ca',
'ce',
'ch',
'co',
'cr',
'cs',
'cu',
'cv',
'cy',
'da',
'de',
'dsb',
'dv',
'dz',
'ee',
'egy',
'el',
'en',
'eo',
'es',
'et',
'eu',
'fa',
'ff',
'fi',
'fj',
'fo',
'fr',
'fy',
'ga',
'gd',
'gl',
'gn',
'grc',
'gu',
'gv',
'ha',
'he',
'hi',
'ho',
'hr',
'hsb',
'ht',
'hu',
'hy',
'hz',
'ia',
'id',
'ie',
'ig',
'ii',
'ik',
'io',
'is',
'it',
'iu',
'ja',
'jv',
'ka',
'kg',
'ki',
'kj',
'kk',
'kl',
'km',
'kn',
'ko',
'kr',
'ks',
'ku',
'kv',
'kw',
'ky',
'la',
'lb',
'lg',
'li',
'ln',
'lo',
'lt',
'lu',
'lv',
'mg',
'mh',
'mi',
'mk',
'ml',
'mn',
'mr',
'ms',
'mt',
'my',
'na',
'nb',
'nd',
'ne',
'ng',
'nl',
'nn',
'no',
'nr',
'nv',
'ny',
'oc',
'oj',
'om',
'or',
'os',
'pa',
'pi',
'pl',
'ps',
'pt',
'qu',
'rm',
'rn',
'ro',
'ru',
'rw',
'sa',
'sc',
'sd',
'se',
'sg',
'si',
'sk',
'sl',
'sm',
'sn',
'so',
'sq',
'sr',
'ss',
'st',
'su',
'sv',
'sw',
'ta',
'te',
'tg',
'th',
'ti',
'tk',
'tl',
'tn',
'to',
'tr',
'ts',
'tt',
'tw',
'ty',
'ug',
'uk',
'ur',
'uz',
've',
'vi',
'vo',
'wa',
'wen',
'wo',
'xh',
'yi',
'yo',
'za',
'zh',
'zu',
];
const AVAILABLE_LANGUAGES = [ const AVAILABLE_LANGUAGES = [
'aa' => 'Afar-áf', 'aa' => 'Afar-áf',
'ab' => 'аҧсуа бызшәа', 'ab' => 'аҧсуа бызшәа',

View File

@@ -14,6 +14,23 @@ final class MDLicensesSet extends MDValueSet {
const DEFAULT_LICENSE_IMGS = 'CC BY-NC-SA'; const DEFAULT_LICENSE_IMGS = 'CC BY-NC-SA';
const DEFAULT_LICENSE_METADATA = 'CC BY-NC-SA'; const DEFAULT_LICENSE_METADATA = 'CC BY-NC-SA';
const AVAILABLE_LICENSES_NAMES = [
'CC BY-NC-SA',
'CC BY-NC-ND',
'CC BY-NC',
'CC BY-ND',
'CC BY-SA',
'CC BY',
'CC0',
'RR-F',
'RR-P',
'RR-R',
'Public Domain Mark',
'Orphan Work',
];
const AVAILABLE_LICENSES = [ const AVAILABLE_LICENSES = [
'CC BY-NC-SA' => 'https://creativecommons.org/licenses/by-nc-sa/4.0/', 'CC BY-NC-SA' => 'https://creativecommons.org/licenses/by-nc-sa/4.0/',

View File

@@ -20,6 +20,7 @@ final class MDMarkingTypesSet extends MDValueSet {
'overprint', 'overprint',
'embossing', 'embossing',
'handwritten', 'handwritten',
'glued',
]; ];
/** /**

View File

@@ -0,0 +1,93 @@
<?PHP
/**
* Contains a class listing central object repositories which may share contents
* with museum-digital.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class listing syndication sources.
*/
final class MDObjectSyndicationSet extends MDValueSet {
const REPOSITORIES = [
'ddb' => [
'url' => 'https://www.deutsche-digitale-bibliothek.de/',
'object_prefix' => 'https://www.deutsche-digitale-bibliothek.de/item/',
'org_prefix' => 'https://www.deutsche-digitale-bibliothek.de/organization/',
'id_is_int' => false,
],
'europeana' => [
'url' => 'https://www.europeana.eu/',
'object_prefix' => 'https://www.europeana.eu/en/item/',
'org_prefix' => null,
'id_is_int' => false,
],
'smb-digital' => [
'url' => 'http://www.smb-digital.de/',
'object_prefix' => 'http://www.smb-digital.de/eMuseumPlus?service=ExternalInterface&module=collection&objectId=',
'org_prefix' => null,
'id_is_int' => true,
],
'kalliope-verbund' => [
'url' => 'https://kalliope-verbund.info/',
'object_prefix' => 'https://kalliope-verbund.info/',
'org_prefix' => 'https://kalliope-verbund.info/isil?isil.id=',
'id_is_int' => false,
],
];
/**
* Returns a correctly formed search URL for a given object in a given
* repository, optionally naming the institution.
*
* @param string $repo Repository to search in.
* @param string $instId Remote ID of the institution to search for.
* @param string $search_value Search string.
*
* @return string
*/
public static function getSearchUrlForObject(string $repo, string $instId, string $search_value):string {
switch ($repo) {
case 'ddb':
return "https://www.deutsche-digitale-bibliothek.de/searchresults?query=" . \urlencode($search_value) . "&facetValues[]=" . \urlencode("provider_id=" . $instId);
default:
throw new MDpageParameterNotFromListException("Search URLs can only be generated for the following repositories: ddb");
}
}
/**
* Function for checking the availability of a provided repository in the
* list of known repositories.
*
* @param string $repo Repository name to check.
*
* @return string|boolean
*/
final public static function checkRepositoryIsKnown(string $repo) {
if (isset(self::REPOSITORIES[$repo])) {
return $repo;
}
return false;
}
/**
* Gets a sorted list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array {
return parent::getTlSortedList($tlLoader, array_keys(self::REPOSITORIES), "syndication_repos", "syndication_repos");
}
}

50
src/MDRequirementsSet.php Normal file
View File

@@ -0,0 +1,50 @@
<?PHP
/**
* Class containing requirements for museum-digital generally.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class containing requirements for museum-digital generally.
*/
final class MDRequirementsSet {
// Newly created user account invites need to be accepted within
// the given timespan. If they are not, the account will be ignored
// and deleted.
// 60 * 60 * 24 * 6 = 518400. 6 days.
const MAX_AGE_AFTER_USER_INVITE = 518400;
// Object images need to be at least 500 px wide
const MIN_OBJECT_IMAGE_WIDTH = 540;
// Object images need to be at least 500 px wide
const MIN_OBJECT_IMAGE_HEIGHT = 540;
const MIMETYPES_USER_PROFILE_IMG = ['image/jpeg', 'image/jpg'];
const MIMETYPES_OBJECT_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_OBJECT_PDF = ['application/pdf'];
const MIMETYPES_OBJECT_PROVENANCE_REPORT = ['application/pdf'];
const MIMETYPES_OBJECT_RESTORATION_REPORT = ['application/pdf', 'image/jpeg', 'image/png'];
const MIMETYPES_OBJECT_CONDITION_REPORT = ['application/pdf', 'image/jpeg', 'image/png'];
const MIMETYPES_COLLECTION_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_INSTITUTION_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_EXHIBITION_IMAGE = ['image/jpeg', 'image/jpg', 'image/png'];
const MIMETYPES_ARTICLE_ASSET = ['image/jpeg', 'image/jpg', 'image/png'];
const MIMETYPES_APPOINTMENT_IMAGE = ['image/jpeg', 'image/jpg', 'image/png'];
const MIMETYPES_APPOINTMENT_DOC_ASSET = ['application/pdf', 'image/jpeg', 'image/jpg', 'image/png'];
const MIMETYPES_PODCAST_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_PODCAST_EPISODE_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_TOUR_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_CATALOGUE_WORK_IMAGE = ['image/jpeg', 'image/jpg'];
const MIMETYPES_CATALOGUE_OBJECT_SUMMARY_IMAGE = ['image/jpeg', 'image/jpg'];
}

View File

@@ -0,0 +1,34 @@
<?PHP
/**
* Research status.
*
* @see https://tools.ietf.org/html/rfc2426
* @see https://tools.ietf.org/html/rfc6350
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Class containing available place types.
*/
final class MDResearchStatusSet extends MDValueSet {
const RESEARCH_STATUS = [
'bad',
'medium',
'good',
];
/**
* Returns a translated list of research status.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getResearchStatusTLed(MDTlLoader $tlLoader):array {
return parent::getTlUnsortedList($tlLoader, self::RESEARCH_STATUS, "research_status", "research_status");
}
}