r91945 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91944‎ | r91945 | r91946 >
Date:10:50, 12 July 2011
Author:questpc
Status:deferred
Tags:
Comment:
Small patch to make current Extension:TimedMediaHandler compatible to MediaWiki 1.17.
Modified paths:
  • /trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/TranscodeStatusTable.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/TranscodeStatusTable.php
@@ -7,7 +7,15 @@
88 *
99 */
1010 class TranscodeStatusTable {
11 -
 11+
 12+ public static $linker;
 13+
 14+ public static function getLinker() {
 15+ if ( is_null( self::$linker ) ) {
 16+ self::$linker = new Linker();
 17+ }
 18+ }
 19+
1220 public static function getHTML( $file ){
1321 global $wgUser, $wgOut;
1422
@@ -16,7 +24,7 @@
1725
1826 $o = '<h2>' . wfMsgHtml( 'timedmedia-status-header' ) . '</h2>';
1927 // Give the user a purge page link
20 - $o.= Linker::link( $file->getTitle(), wfMsg('timedmedia-update-status'), array(), array( 'action'=> 'purge' ) );
 28+ $o.= self::$linker->link( $file->getTitle(), wfMsg('timedmedia-update-status'), array(), array( 'action'=> 'purge' ) );
2129
2230 $o.= Xml::openElement( 'table', array( 'class' => 'wikitable transcodestatus' ) ) . "\n"
2331 . '<tr>'
@@ -82,7 +90,7 @@
8391 // Check for error:
8492 if( !is_null( $state['time_error'] ) ){
8593 if( !is_null( $state['error'] ) ){
86 - $showErrorLink = Linker::link( $file->getTitle(), wfMsg('timedmedia-show-error'), array(
 94+ $showErrorLink = self::$linker->link( $file->getTitle(), wfMsg('timedmedia-show-error'), array(
8795 'title' => wfMsgHtml('timedmedia-error-on', $state['time_error'] ),
8896 'class' => 'errorlink',
8997 'data-error' => $state['error']
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php
@@ -84,7 +84,9 @@
8585
8686 // Exclude transcoded assets from normal thumbnail purging
8787 // ( a maintenance script could handle transcode asset purging)
88 - $wgExcludeFromThumbnailPurge = array_merge( $wgExcludeFromThumbnailPurge, $wgTmhFileExtensions );
 88+ if ( isset( $wgExcludeFromThumbnailPurge ) ) {
 89+ $wgExcludeFromThumbnailPurge = array_merge( $wgExcludeFromThumbnailPurge, $wgTmhFileExtensions );
 90+ }
8991
9092 // Also add the .log file ( used in two pass encoding )
9193 // ( probably should move in-progress encodes out of web accessible directory )
@@ -109,6 +111,9 @@
110112
111113 // Add transcode status to video asset pages:
112114 $wgHooks[ 'ImagePageAfterImageLinks' ][] = 'TimedMediaHandlerHooks::checkForTranscodeStatus';
 115+
 116+ // for MediaWiki 1.17 compatibility
 117+ TranscodeStatusTable::getLinker();
113118
114119 return true;
115120 }

Status & tagging log