commit ec1fe24aabc267b85d754c7279511d2d7f060223 Author: Joshua Ramon Enslin Date: Wed Aug 5 22:58:26 2020 +0200 Initial. 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; + + } + +}