* (bug 29144) Move action=dublincore and action=creativecommons to extensions

Moved dublincore out to extension
This commit is contained in:
Sam Reed 2011-05-25 23:55:15 +00:00
parent e6db788e30
commit 27c3b22bff
6 changed files with 4 additions and 60 deletions

View file

@ -53,7 +53,6 @@ $wgAutoloadLocalClasses = array(
'DiffHistoryBlob' => 'includes/HistoryBlob.php',
'DjVuImage' => 'includes/DjVuImage.php',
'DoubleReplacer' => 'includes/StringUtils.php',
'DublinCoreRdf' => 'includes/Metadata.php',
'DummyLinker' => 'includes/Linker.php',
'Dump7ZipOutput' => 'includes/Export.php',
'DumpBZip2Output' => 'includes/Export.php',

View file

@ -4407,7 +4407,6 @@ $wgUseTagFilter = true;
*/
/** RDF metadata toggles */
$wgEnableDublinCoreRdf = false;
$wgEnableCreativeCommonsRdf = false;
/** Override for copyright metadata.
@ -5040,7 +5039,7 @@ $wgActions = array(
);
/**
* Array of disabled article actions, e.g. view, edit, dublincore, delete, etc.
* Array of disabled article actions, e.g. view, edit, delete, etc.
* @deprecated since 1.18; just set $wgActions['action'] = false instead
*/
$wgDisabledActions = array();

View file

@ -1,6 +1,6 @@
<?php
/**
* Provides DublinCore and CreativeCommons metadata
* Provides CreativeCommons metadata
*
* Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
*
@ -198,42 +198,6 @@ abstract class RdfMetaData {
}
}
class DublinCoreRdf extends RdfMetaData {
public function show(){
if( $this->setup() ){
$this->prologue();
$this->basics();
$this->epilogue();
}
}
/**
* begin of the page
*/
protected function prologue() {
$url = htmlspecialchars( $this->reallyFullUrl() );
print <<<PROLOGUE
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE rdf:RDF PUBLIC "-//DUBLIN CORE//DCMES DTD 2002/07/31//EN" "http://dublincore.org/documents/2002/07/31/dcmes-xml/dcmes-xml-dtd.dtd">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<rdf:Description rdf:about="{$url}">
PROLOGUE;
}
/**
* end of the page
*/
protected function epilogue() {
print <<<EPILOGUE
</rdf:Description>
</rdf:RDF>
EPILOGUE;
}
}
class CreativeCommonsRdf extends RdfMetaData {
public function show(){

View file

@ -2703,7 +2703,7 @@ class OutputPage {
global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI,
$wgSitename, $wgVersion, $wgHtml5, $wgMimeType,
$wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes,
$wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf,
$wgEnableCreativeCommonsRdf,
$wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgContLang,
$wgRightsPage, $wgRightsUrl;
@ -2844,15 +2844,6 @@ class OutputPage {
'href' => $this->getTitle()->getLocalURL( 'action=creativecommons' ) )
);
}
if ( $wgEnableDublinCoreRdf ) {
$tags[] = Html::element( 'link', array(
'rel' => $this->getMetadataAttribute(),
'title' => 'Dublin Core',
'type' => 'application/rdf+xml',
'href' => $this->getTitle()->getLocalURL( 'action=dublincore' ) )
);
}
}
# Language variants

View file

@ -407,7 +407,7 @@ class MediaWiki {
*/
private function performAction( $article ) {
global $wgSquidMaxage, $wgUseExternalEditor,
$wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf;
$wgEnableCreativeCommonsRdf;
wfProfileIn( __METHOD__ );
@ -450,14 +450,6 @@ class MediaWiki {
case 'deletetrackback':
$article->$act();
break;
case 'dublincore':
if ( !$wgEnableDublinCoreRdf ) {
wfHttpError( 403, 'Forbidden', wfMsg( 'nodublincore' ) );
} else {
$rdf = new DublinCoreRdf( $article );
$rdf->show();
}
break;
case 'creativecommons':
if ( !$wgEnableCreativeCommonsRdf ) {
wfHttpError( 403, 'Forbidden', wfMsg( 'nocreativecommons' ) );

View file

@ -2489,7 +2489,6 @@ $wgMessageStructure = array(
'group-bureaucrat.js',
),
'metadata_cc' => array(
'nodublincore',
'nocreativecommons',
'notacceptable',
),