From: Sam Reed Date: Thu, 26 May 2011 00:08:16 +0000 (+0000) Subject: * (bug 29144) Move action=dublincore and action=creativecommons to extensions X-Git-Tag: 1.31.0-rc.0~29934 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=00707e04a662a3c490239fc0130483bc0e6319c0;p=lhc%2Fweb%2Fwiklou.git * (bug 29144) Move action=dublincore and action=creativecommons to extensions Moved CreativeCommonsRDF out to extension --- diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 965c0857d2..3f0fc684a0 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -49,7 +49,6 @@ $wgAutoloadLocalClasses = array( 'ConfEditorToken' => 'includes/ConfEditor.php', 'Cookie' => 'includes/Cookie.php', 'CookieJar' => 'includes/Cookie.php', - 'CreativeCommonsRdf' => 'includes/Metadata.php', 'DiffHistoryBlob' => 'includes/HistoryBlob.php', 'DjVuImage' => 'includes/DjVuImage.php', 'DoubleReplacer' => 'includes/StringUtils.php', diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index bde197d6ce..7047bfb6d7 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4406,9 +4406,6 @@ $wgUseTagFilter = true; * @{ */ -/** RDF metadata toggles */ -$wgEnableCreativeCommonsRdf = false; - /** Override for copyright metadata. * TODO: these options need documentation */ diff --git a/includes/Metadata.php b/includes/Metadata.php index 5168262120..a7e76f90b4 100644 --- a/includes/Metadata.php +++ b/includes/Metadata.php @@ -198,86 +198,3 @@ abstract class RdfMetaData { } } -class CreativeCommonsRdf extends RdfMetaData { - - public function show(){ - if( $this->setup() ){ - global $wgRightsUrl; - - $url = $this->reallyFullUrl(); - - $this->prologue(); - $this->subPrologue('Work', $url); - - $this->basics(); - if( $wgRightsUrl ){ - $url = htmlspecialchars( $wgRightsUrl ); - print "\t\t\n"; - } - - $this->subEpilogue('Work'); - - if( $wgRightsUrl ){ - $terms = $this->getTerms( $wgRightsUrl ); - if( $terms ){ - $this->subPrologue( 'License', $wgRightsUrl ); - $this->license( $terms ); - $this->subEpilogue( 'License' ); - } - } - } - - $this->epilogue(); - } - - protected function prologue() { - echo << - - -PROLOGUE; - } - - protected function subPrologue( $type, $url ){ - $url = htmlspecialchars( $url ); - echo "\t\n"; - } - - protected function subEpilogue($type) { - echo "\t\n"; - } - - protected function license($terms) { - - foreach( $terms as $term ){ - switch( $term ) { - case 're': - $this->term('permits', 'Reproduction'); break; - case 'di': - $this->term('permits', 'Distribution'); break; - case 'de': - $this->term('permits', 'DerivativeWorks'); break; - case 'nc': - $this->term('prohibits', 'CommercialUse'); break; - case 'no': - $this->term('requires', 'Notice'); break; - case 'by': - $this->term('requires', 'Attribution'); break; - case 'sa': - $this->term('requires', 'ShareAlike'); break; - case 'sc': - $this->term('requires', 'SourceCode'); break; - } - } - } - - protected function term( $term, $name ){ - print "\t\t\n"; - } - - protected function epilogue() { - echo "\n"; - } -} diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 1ab62d94aa..26e416cbe7 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2703,7 +2703,6 @@ class OutputPage { global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI, $wgSitename, $wgVersion, $wgHtml5, $wgMimeType, $wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes, - $wgEnableCreativeCommonsRdf, $wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang, $wgRightsPage, $wgRightsUrl; @@ -2828,24 +2827,6 @@ class OutputPage { ) ); } - # Metadata links - # - Creative Commons - # See http://wiki.creativecommons.org/Extend_Metadata. - # - Dublin Core - # Use hreflang to specify canonical and alternate links - # See http://www.google.com/support/webmasters/bin/answer.py?answer=189077 - if ( $this->isArticleRelated() ) { - # note: buggy CC software only reads first "meta" link - if ( $wgEnableCreativeCommonsRdf ) { - $tags[] = Html::element( 'link', array( - 'rel' => $this->getMetadataAttribute(), - 'title' => 'Creative Commons', - 'type' => 'application/rdf+xml', - 'href' => $this->getTitle()->getLocalURL( 'action=creativecommons' ) ) - ); - } - } - # Language variants if ( !$wgDisableLangConversion && $wgCanonicalLanguageLinks && $wgContLang->hasVariants() ) { diff --git a/includes/Wiki.php b/includes/Wiki.php index 6c17a48688..8ef1d911d8 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -406,8 +406,7 @@ class MediaWiki { * @param $article Article */ private function performAction( $article ) { - global $wgSquidMaxage, $wgUseExternalEditor, - $wgEnableCreativeCommonsRdf; + global $wgSquidMaxage, $wgUseExternalEditor; wfProfileIn( __METHOD__ ); @@ -450,14 +449,6 @@ class MediaWiki { case 'deletetrackback': $article->$act(); break; - case 'creativecommons': - if ( !$wgEnableCreativeCommonsRdf ) { - wfHttpError( 403, 'Forbidden', wfMsg( 'nocreativecommons' ) ); - } else { - $rdf = new CreativeCommonsRdf( $article ); - $rdf->show(); - } - break; case 'submit': if ( session_id() == '' ) { // Send a cookie so anons get talk message notifications diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 7194236f23..b86b3ccad9 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2489,7 +2489,6 @@ $wgMessageStructure = array( 'group-bureaucrat.js', ), 'metadata_cc' => array( - 'nocreativecommons', 'notacceptable', ), 'attribution' => array(