This commit is contained in:
Joshua Ramon Enslin 2020-08-05 22:58:26 +02:00 committed by Stefan Rohde-Enslin
commit ec1fe24aab
2 changed files with 49 additions and 0 deletions

5
README.md Normal file
View File

@ -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.

44
src/MDLicensesSet.php Normal file
View File

@ -0,0 +1,44 @@
<?PHP
/**
* Contains a class of available licenses.
*/
/**
* Class containing static functions for getting available licenses on md.
*/
class MDLicensesSet {
const AVAILABLE_LICENSES = [
'CC BY-NC-SA' => '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;
}
}