* (bug 29144) Move action=dublincore and action=creativecommons to extensions
authorSam Reed <reedy@users.mediawiki.org>
Wed, 25 May 2011 23:55:15 +0000 (23:55 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 25 May 2011 23:55:15 +0000 (23:55 +0000)
Moved dublincore out to extension

includes/AutoLoader.php
includes/DefaultSettings.php
includes/Metadata.php
includes/OutputPage.php
includes/Wiki.php
maintenance/language/messages.inc

index d79a77f..965c085 100644 (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',
index a6868b0..bde197d 100644 (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();
index 5f9a13b..5168262 100644 (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(){
index 186ca77..1ab62d9 100644 (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
index 07007f3..6c17a48 100644 (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' ) );
index fa8c571..7194236 100644 (file)
@@ -2489,7 +2489,6 @@ $wgMessageStructure = array(
                'group-bureaucrat.js',
        ),
        'metadata_cc' => array(
-               'nodublincore',
                'nocreativecommons',
                'notacceptable',
        ),