From ec1fe24aabc267b85d754c7279511d2d7f060223 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Wed, 5 Aug 2020 22:58:26 +0200 Subject: [PATCH] Initial. --- README.md | 5 +++++ src/MDLicensesSet.php | 44 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 README.md create mode 100644 src/MDLicensesSet.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..c75211a --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +Lists of available value sets in MD +============================================ + +This repository contains a PHP file listing all licenses available to set at +museum-digital. diff --git a/src/MDLicensesSet.php b/src/MDLicensesSet.php new file mode 100644 index 0000000..3a6a5cf --- /dev/null +++ b/src/MDLicensesSet.php @@ -0,0 +1,44 @@ + 'https://creativecommons.org/licenses/by-nc-sa/4.0/', + 'CC BY-NC-ND' => 'https://creativecommons.org/licenses/by-nc-nd/4.0/', + 'CC BY-NC' => 'https://creativecommons.org/licenses/by-nc/4.0/', + 'CC BY-ND' => 'https://creativecommons.org/licenses/by-nd/4.0/', + 'CC BY-SA' => 'https://creativecommons.org/licenses/by-sa/4.0/', + 'CC BY' => 'https://creativecommons.org/licenses/by/4.0/', + 'CC0' => 'https://creativecommons.org/publicdomain/zero/1.0/', + 'RR-F' => 'https://www.europeana.eu/rights/rr-f/', + 'RR-P' => 'https://www.europeana.eu/rights/rr-p/', + 'RR-R' => 'https://www.europeana.eu/rights/rr-r/', + 'Public Domain Mark' => 'https://creativecommons.org/publicdomain/mark/1.0/', + 'Orphan Work' => '', + + ]; + + /** + * Function for checking the availability of a provided license at + * museum-digital. + * If the license is available, the corresponding URL is returned. Else, false + * is returned. + * + * @param string $license License to check. + * + * @return string|boolean + */ + final public static function checkLicenseAvailable(string $license) { + if (isset(self::AVAILABLE_LICENSES[$license])) return self::AVAILABLE_LICENSES[$license]; + return false; + + } + +}