r88876 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88875‎ | r88876 | r88877 >
Date:00:57, 26 May 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 29144) Move action=dublincore and action=creativecommons to extensions

Add back links for metadata in <head>
Modified paths:
  • /trunk/extensions/CreativeCommonsRdf/CreativeCommonsRdf.php (modified) (history)
  • /trunk/extensions/DublinCoreRdf/DublinCoreRdf.php (modified) (history)
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/Metadata.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -18,6 +18,10 @@
1919 * LogReader and LogViewer classes (deprecated in 1.14) have now been removed
2020 * (bug 26033) Added $wgArticleCountMethod to select the method to use to say
2121 whether a page is an article or not. $wgUseCommaCount is now deprecated.
 22+* $wgEnableDublinCoreRdf and $wgEnableCreativeCommonsRdf no longer work in core,
 23+ and the functionality has been moved to the relevant extensions. See
 24+ http://www.mediawiki.org/wiki/Extension:DublinCoreRdf and
 25+ http://www.mediawiki.org/wiki/Extension:CreativeCoreRdf as appropriate
2226
2327 === New features in 1.19 ===
2428 * (bug 28916) A way to to toggle mw.config legacy globals settings from
Index: trunk/phase3/includes/OutputPage.php
@@ -307,7 +307,7 @@
308308 *
309309 * @return String
310310 */
311 - private function getMetadataAttribute() {
 311+ public function getMetadataAttribute() {
312312 # note: buggy CC software only reads first "meta" link
313313 static $haveMeta = false;
314314 if ( $haveMeta ) {
Index: trunk/phase3/includes/Metadata.php
@@ -1,6 +1,5 @@
22 <?php
33 /**
4 - * Provides CreativeCommons metadata
54 *
65 * Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
76 *
@@ -35,9 +34,6 @@
3635
3736 public abstract function show();
3837
39 - /**
40 - *
41 - */
4238 protected function setup() {
4339 global $wgOut, $wgRequest;
4440
@@ -55,9 +51,6 @@
5652 }
5753 }
5854
59 - /**
60 - *
61 - */
6255 protected function reallyFullUrl() {
6356 return $this->mArticle->getTitle()->getFullURL();
6457 }
Index: trunk/extensions/CreativeCommonsRdf/CreativeCommonsRdf.php
@@ -9,6 +9,7 @@
1010 );
1111
1212 $wgHooks['MediaWikiPerformAction'][] = 'efCreativeCommonsRdfPreformAction';
 13+$wgHooks['BeforePageDisplay'][] = 'efCreativeCommonsRdfBeforePageDisplay';
1314
1415 $wgAutoloadClasses['CreativeCommonsRdf'] = $dir . 'CreativeCommonsRdf_body.php';
1516
@@ -20,4 +21,20 @@
2122 $rdf = new CreativeCommonsRdf( $article );
2223 $rdf->show();
2324 return false;
 25+}
 26+
 27+/**
 28+ * @param $out OutputPage
 29+ * @param $skin Skin
 30+ * @return bool
 31+ */
 32+function efCreativeCommonsRdfBeforePageDisplay( $out, $skin ) {
 33+ $out->addHeadItem( 'creativecommons',
 34+ Html::element( 'link', array(
 35+ 'rel' => $out->getMetadataAttribute(),
 36+ 'title' => 'Creative Commons',
 37+ 'type' => 'application/rdf+xml',
 38+ 'href' => $out->getTitle()->getLocalURL( 'action=creativecommons' ) )
 39+ ));
 40+ return true;
2441 }
\ No newline at end of file
Index: trunk/extensions/DublinCoreRdf/DublinCoreRdf.php
@@ -8,7 +8,8 @@
99 'descriptionmsg' => "Dublin Core RDF-metadata"
1010 );
1111
12 -$wgHooks['MediaWikiPerformAction'][] = 'efDublinCorePerformAction';
 12+$wgHooks['MediaWikiPerformAction'][] = 'efDublinCoreBeforePageDisplay';
 13+$wgHooks['BeforePageDisplay'][] = 'efCreativeCommonsRdfBeforePageDisplay';
1314
1415 $wgAutoloadClasses['DublinCoreRdf'] = $dir . 'DublinCoreRdf_body.php';
1516
@@ -20,4 +21,20 @@
2122 $rdf = new DublinCoreRdf( $article );
2223 $rdf->show();
2324 return false;
 25+}
 26+
 27+/**
 28+ * @param $out OutputPage
 29+ * @param $skin Skin
 30+ * @return bool
 31+ */
 32+function efDublinCoreBeforePageDisplay( $out, $skin ) {
 33+ $out->addHeadItem( 'dublincore',
 34+ Html::element( 'link', array(
 35+ 'rel' => $out->getMetadataAttribute(),
 36+ 'title' => 'Dublin Core',
 37+ 'type' => 'application/rdf+xml',
 38+ 'href' => $out->getTitle()->getLocalURL( 'action=dublincore' ) )
 39+ ));
 40+ return true;
2441 }
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88868* (bug 29144) Move action=dublincore and action=creativecommons to extensions...reedy23:55, 25 May 2011
r88873* (bug 29144) Move action=dublincore and action=creativecommons to extensions...reedy00:08, 26 May 2011

Status & tagging log