Compare commits
23 Commits
0f6a49c2f9
...
276420017d
Author | SHA1 | Date | |
---|---|---|---|
276420017d
|
|||
1ac18b9d4c
|
|||
08385bef21
|
|||
3e58dce1e3
|
|||
ee24739002
|
|||
ca5be31efb
|
|||
7718cd3aa2
|
|||
fecf25d72c
|
|||
35b713f1c9
|
|||
4daf580355
|
|||
c3dfdbb5ac
|
|||
913fcbbaea
|
|||
7f6c723095
|
|||
db240f9d3d
|
|||
ce35fd35cd
|
|||
1b1d2cb6eb
|
|||
a2753781f9
|
|||
c06729f477
|
|||
d5bc140889
|
|||
1905450776
|
|||
3ea3a9f2c0
|
|||
c4ac0f0fb4
|
|||
e208308c8d
|
2
l18n
2
l18n
Submodule l18n updated: b4a7e98654...98087dfab7
40
src/MDActorVariantTypesSet.php
Normal file
40
src/MDActorVariantTypesSet.php
Normal 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");
|
||||
|
||||
}
|
||||
}
|
32
src/MDCloserLocationTypesSet.php
Normal file
32
src/MDCloserLocationTypesSet.php
Normal 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");
|
||||
|
||||
}
|
||||
}
|
21
src/MDConservationStatusSet.php
Normal file
21
src/MDConservationStatusSet.php
Normal 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'
|
||||
];
|
||||
|
||||
}
|
@@ -62,12 +62,16 @@ final class MDEventsSet extends MDValueSet {
|
||||
];
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
const EVENTS_NO_PRODUCTION = [21];
|
||||
|
||||
// Array enthält Ereignistypen, die auf Korrespondenzen hinweisen
|
||||
const EVENTS_CORRESPONDENCE = [11, 13];
|
||||
|
||||
|
@@ -11,6 +11,198 @@ declare(strict_types = 1);
|
||||
*/
|
||||
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 = [
|
||||
'aa' => 'Afar-áf',
|
||||
'ab' => 'аҧсуа бызшәа',
|
||||
|
@@ -14,6 +14,23 @@ final class MDLicensesSet extends MDValueSet {
|
||||
const DEFAULT_LICENSE_IMGS = '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 = [
|
||||
|
||||
'CC BY-NC-SA' => 'https://creativecommons.org/licenses/by-nc-sa/4.0/',
|
||||
|
@@ -20,6 +20,7 @@ final class MDMarkingTypesSet extends MDValueSet {
|
||||
'overprint',
|
||||
'embossing',
|
||||
'handwritten',
|
||||
'glued',
|
||||
];
|
||||
|
||||
/**
|
||||
|
93
src/MDObjectSyndicationSet.php
Normal file
93
src/MDObjectSyndicationSet.php
Normal 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
50
src/MDRequirementsSet.php
Normal 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'];
|
||||
|
||||
}
|
34
src/MDResearchStatusSet.php
Normal file
34
src/MDResearchStatusSet.php
Normal 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");
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user