-/* private */ function dcPageOrString($name, $page, $str) {
- $nt = Title::newFromText($page);
-
- if (!$nt || $nt->getArticleID() == 0) {
- dcElement($name, $str);
- } else {
- dcPage($name, $nt);
+ foreach ($ccVersions as $version) {
+ foreach ($ccLicenses as $license) {
+ if( $version == '2.0' && substr( $license, 0, 2) != 'by' ) {
+ # 2.0 dropped the non-attribs licenses
+ continue;
+ }
+ $lurl = "http://creativecommons.org/licenses/{$license}/{$version}/";
+ $knownLicenses[$lurl] = explode('-', $license);
+ $knownLicenses[$lurl][] = 're';
+ $knownLicenses[$lurl][] = 'di';
+ $knownLicenses[$lurl][] = 'no';
+ if (!in_array('nd', $knownLicenses[$lurl])) {
+ $knownLicenses[$lurl][] = 'de';
+ }
+ }
+ }
+
+ /* Handle the GPL and LGPL, too. */
+
+ $knownLicenses['http://creativecommons.org/licenses/GPL/2.0/'] =
+ array('de', 're', 'di', 'no', 'sa', 'sc');
+ $knownLicenses['http://creativecommons.org/licenses/LGPL/2.1/'] =
+ array('de', 're', 'di', 'no', 'sa', 'sc');
+ $knownLicenses['http://www.gnu.org/copyleft/fdl.html'] =
+ array('de', 're', 'di', 'no', 'sa', 'sc');
+
+ return $knownLicenses;