Compare commits
22 Commits
276420017d
...
70dea64c3c
Author | SHA1 | Date | |
---|---|---|---|
70dea64c3c
|
|||
987ebc99ed
|
|||
f64d34d577
|
|||
249d42339d
|
|||
d9c03d78cd
|
|||
f6c5808817
|
|||
3387c5a292
|
|||
793a8e08ad
|
|||
01435df405
|
|||
d061814751
|
|||
e3c77bb556
|
|||
ae49dc2aa4
|
|||
eefba3ddc2
|
|||
e1681976c4
|
|||
af10f52738
|
|||
91bf28ae96
|
|||
0ff654b3f9
|
|||
dacebedd48
|
|||
783fe29fc9
|
|||
16f0621a9a
|
|||
262972eb54
|
|||
9801f1a35f
|
2
l18n
2
l18n
Submodule l18n updated: 98087dfab7...4e3afcf35c
38
src/MDAppointmentAttendanceModeSet.php
Normal file
38
src/MDAppointmentAttendanceModeSet.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Contains a class for controlling the list of available attendance modes
|
||||||
|
* to appointment / event.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing available attendance modes.
|
||||||
|
*/
|
||||||
|
final class MDAppointmentAttendanceModeSet extends MDValueSet {
|
||||||
|
|
||||||
|
const MODES = [
|
||||||
|
'offline',
|
||||||
|
'online',
|
||||||
|
'mixed',
|
||||||
|
];
|
||||||
|
|
||||||
|
const MODES_TO_SCHEMA_ORG = [
|
||||||
|
'offline' => 'https://schema.org/OfflineEventAttendanceMode',
|
||||||
|
'online' => 'https://schema.org/OnlineEventAttendanceMode',
|
||||||
|
'mixed' => 'https://schema.org/MixedEventAttendanceMode',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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::MODES, "appointment_attendance_modes", "appointment_attendance_modes");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
31
src/MDAppointmentContributorsSet.php
Normal file
31
src/MDAppointmentContributorsSet.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Contains a class for controlling the list of available contributor types
|
||||||
|
* to appointment / event.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing available contributor roles.
|
||||||
|
*/
|
||||||
|
final class MDAppointmentContributorsSet extends MDValueSet {
|
||||||
|
|
||||||
|
const AVAILABLE_ROLES = [
|
||||||
|
'organizer',
|
||||||
|
'presenter',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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::AVAILABLE_ROLES, "appointment_contributor_roles", "appointment_contributor_roles");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
39
src/MDAppointmentStatusSet.php
Normal file
39
src/MDAppointmentStatusSet.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Contains a class for controlling the list of available statuses to appointment / event.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing available status.
|
||||||
|
*/
|
||||||
|
final class MDAppointmentStatusSet extends MDValueSet {
|
||||||
|
|
||||||
|
const STATUS = [
|
||||||
|
'scheduled',
|
||||||
|
'cancelled',
|
||||||
|
'moved_online',
|
||||||
|
'postponed',
|
||||||
|
];
|
||||||
|
|
||||||
|
const STATUS_TO_SCHEMA_ORG = [
|
||||||
|
'scheduled' => 'https://schema.org/EventScheduled',
|
||||||
|
'cancelled' => 'https://schema.org/EventCancelled',
|
||||||
|
'moved_online' => 'https://schema.org/EventMovedOnline',
|
||||||
|
'postponed' => 'https://schema.org/EventPostponed',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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::STATUS, "appointment_status", "appointment_status");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
21
src/MDBlockedMailserverSet.php
Normal file
21
src/MDBlockedMailserverSet.php
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Contains a class listing blocked mailservers. Mail servers may e.g. be blocked
|
||||||
|
* for not accepting mails from @museum-digital.de.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains a class listing blocked mailservers. Mail servers may e.g. be blocked
|
||||||
|
* for not accepting mails from @museum-digital.de.
|
||||||
|
*/
|
||||||
|
final class MDBlockedMailserverSet extends MDValueSet {
|
||||||
|
|
||||||
|
const BLOCKED_DOMAINS = [
|
||||||
|
"@magenta.de",
|
||||||
|
"@t-online.de",
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
34
src/MDExhibitionContributorsSet.php
Normal file
34
src/MDExhibitionContributorsSet.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Contains a class for controlling the list of available contributor types
|
||||||
|
* to exhibitions.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing available contributor roles.
|
||||||
|
*/
|
||||||
|
final class MDExhibitionContributorsSet extends MDValueSet {
|
||||||
|
|
||||||
|
const AVAILABLE_ROLES = [
|
||||||
|
'concept',
|
||||||
|
'curator',
|
||||||
|
'design',
|
||||||
|
'coordinator',
|
||||||
|
'protagonist',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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::AVAILABLE_ROLES, "exhibition_contributor_roles", "exhibition_contributor_roles");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -19,7 +19,17 @@ final class MDMarkingTypesSet extends MDValueSet {
|
|||||||
'stamp',
|
'stamp',
|
||||||
'overprint',
|
'overprint',
|
||||||
'embossing',
|
'embossing',
|
||||||
|
'embroidered',
|
||||||
'handwritten',
|
'handwritten',
|
||||||
|
'screwed',
|
||||||
|
'burnt_in',
|
||||||
|
'riveted',
|
||||||
|
'nailed',
|
||||||
|
'punched',
|
||||||
|
'hallmarked',
|
||||||
|
'scarified',
|
||||||
|
'cast',
|
||||||
|
'sewn',
|
||||||
'glued',
|
'glued',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
81
src/MDNodaRepositoriesSet.php
Normal file
81
src/MDNodaRepositoriesSet.php
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* Class containing lists of repositories, tags, places, and actors can be linked with.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing lists of repositories, tags, places, and actors can be linked with.
|
||||||
|
*/
|
||||||
|
final class MDNodaRepositoriesSet extends MDValueSet {
|
||||||
|
|
||||||
|
const REPOSITORIES_ACTOR = [
|
||||||
|
'allgemein',
|
||||||
|
'bne',
|
||||||
|
'bnf',
|
||||||
|
'edition humboldt digital',
|
||||||
|
'gnd',
|
||||||
|
'iconclass',
|
||||||
|
'lcsh',
|
||||||
|
'loc',
|
||||||
|
'MBL',
|
||||||
|
'NDB/ADB',
|
||||||
|
'ndl',
|
||||||
|
'ndp-ikmk',
|
||||||
|
'nomisma',
|
||||||
|
'npg',
|
||||||
|
'orcid',
|
||||||
|
'pim',
|
||||||
|
'rkd',
|
||||||
|
'ulan',
|
||||||
|
'viaf',
|
||||||
|
'wikidata',
|
||||||
|
'Wikipedia',
|
||||||
|
];
|
||||||
|
|
||||||
|
const REPOSITORIES_PLACE = [
|
||||||
|
'allgemein',
|
||||||
|
'bne',
|
||||||
|
'bnf',
|
||||||
|
'cona',
|
||||||
|
'gnd',
|
||||||
|
'lcsh',
|
||||||
|
'loc',
|
||||||
|
'ndl',
|
||||||
|
'ndp-ikmk',
|
||||||
|
'nomisma',
|
||||||
|
'npg',
|
||||||
|
'osm',
|
||||||
|
'pleiades',
|
||||||
|
'rkd',
|
||||||
|
'viaf',
|
||||||
|
'wikidata',
|
||||||
|
'Wikipedia',
|
||||||
|
];
|
||||||
|
|
||||||
|
const REPOSITORIES_TAG = [
|
||||||
|
'aat',
|
||||||
|
'ackerbau',
|
||||||
|
'allgemein',
|
||||||
|
'bne',
|
||||||
|
'bnf',
|
||||||
|
'gnd',
|
||||||
|
'grobsystematik',
|
||||||
|
'iconclass',
|
||||||
|
'lcsh',
|
||||||
|
'loc',
|
||||||
|
'mindat.org',
|
||||||
|
'moebeltypologie',
|
||||||
|
'ndl',
|
||||||
|
'nomisma',
|
||||||
|
'npg',
|
||||||
|
'oberbegriffsdatei',
|
||||||
|
'rkd',
|
||||||
|
'viaf',
|
||||||
|
'wikidata',
|
||||||
|
'Wikipedia',
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
@ -23,6 +23,9 @@ final class MDRequirementsSet {
|
|||||||
// Object images need to be at least 500 px wide
|
// Object images need to be at least 500 px wide
|
||||||
const MIN_OBJECT_IMAGE_HEIGHT = 540;
|
const MIN_OBJECT_IMAGE_HEIGHT = 540;
|
||||||
|
|
||||||
|
const TIME_EARLIEST_YEAR = -6000000000;
|
||||||
|
const TIME_LATEST_YEAR = 2099;
|
||||||
|
|
||||||
const MIMETYPES_USER_PROFILE_IMG = ['image/jpeg', 'image/jpg'];
|
const MIMETYPES_USER_PROFILE_IMG = ['image/jpeg', 'image/jpg'];
|
||||||
|
|
||||||
const MIMETYPES_OBJECT_IMAGE = ['image/jpeg', 'image/jpg'];
|
const MIMETYPES_OBJECT_IMAGE = ['image/jpeg', 'image/jpg'];
|
||||||
@ -47,4 +50,6 @@ final class MDRequirementsSet {
|
|||||||
const MIMETYPES_CATALOGUE_WORK_IMAGE = ['image/jpeg', 'image/jpg'];
|
const MIMETYPES_CATALOGUE_WORK_IMAGE = ['image/jpeg', 'image/jpg'];
|
||||||
const MIMETYPES_CATALOGUE_OBJECT_SUMMARY_IMAGE = ['image/jpeg', 'image/jpg'];
|
const MIMETYPES_CATALOGUE_OBJECT_SUMMARY_IMAGE = ['image/jpeg', 'image/jpg'];
|
||||||
|
|
||||||
|
const EXTENSIONS_THREE_D_ZIP = ['obj', 'mtl', 'jpg', 'jpeg', 'png'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ final class MDSourceTypeSet extends MDValueSet {
|
|||||||
'book',
|
'book',
|
||||||
'phdthesis',
|
'phdthesis',
|
||||||
'electronical',
|
'electronical',
|
||||||
|
'patent',
|
||||||
|
'unpublished',
|
||||||
'misc',
|
'misc',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -14,6 +14,63 @@ final class MDUnitsSet extends MDValueSet {
|
|||||||
const UNITS_LENGTH = ['', 'm', 'dm', 'cm', 'mm'];
|
const UNITS_LENGTH = ['', 'm', 'dm', 'cm', 'mm'];
|
||||||
const UNITS_WEIGHT = ['', 't', 'kg', 'g'];
|
const UNITS_WEIGHT = ['', 't', 'kg', 'g'];
|
||||||
|
|
||||||
|
const UNITS_LENGTH_TO_MILLIMETER = [
|
||||||
|
'm' => 1000,
|
||||||
|
'dm' => 100,
|
||||||
|
'cm' => 10,
|
||||||
|
'mm' => 1,
|
||||||
|
];
|
||||||
|
|
||||||
|
const UNITS_WEIGHT_TO_GRAMM = [
|
||||||
|
't' => 1000000,
|
||||||
|
'kg' => 1000,
|
||||||
|
'g' => 1,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a given length to millimeters.
|
||||||
|
*
|
||||||
|
* @param mixed $value Input value to convert.
|
||||||
|
* @param string $unit Length unit of the value to convert.
|
||||||
|
*
|
||||||
|
* @return float|null
|
||||||
|
*/
|
||||||
|
public static function convertLengthToMillimeter(mixed $value, string $unit):float|null {
|
||||||
|
|
||||||
|
if (!isset(self::UNITS_LENGTH_TO_MILLIMETER[$unit])) return null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
$number = MD_STD_IN::sanitize_float($value);
|
||||||
|
return floatval($number * self::UNITS_LENGTH_TO_MILLIMETER[$unit]);
|
||||||
|
}
|
||||||
|
catch (MDgenericInvalidInputsException $e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a given weight to gramm.
|
||||||
|
*
|
||||||
|
* @param mixed $value Input value to convert.
|
||||||
|
* @param string $unit Weight unit of the value to convert.
|
||||||
|
*
|
||||||
|
* @return float|null
|
||||||
|
*/
|
||||||
|
public static function convertWeightToGramm(mixed $value, string $unit):float|null {
|
||||||
|
|
||||||
|
if (!isset(self::UNITS_WEIGHT_TO_GRAMM[$unit])) return null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
$number = MD_STD_IN::sanitize_float($value);
|
||||||
|
return floatval($number * self::UNITS_WEIGHT_TO_GRAMM[$unit]);
|
||||||
|
}
|
||||||
|
catch (MDgenericInvalidInputsException $e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a translated list of length units.
|
* Returns a translated list of length units.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user