Index: trunk/extensions/TimedMediaHandler/TranscodeStatusTable.php |
— | — | @@ -7,7 +7,15 @@ |
8 | 8 | * |
9 | 9 | */ |
10 | 10 | 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 | + |
12 | 20 | public static function getHTML( $file ){ |
13 | 21 | global $wgUser, $wgOut; |
14 | 22 | |
— | — | @@ -16,7 +24,7 @@ |
17 | 25 | |
18 | 26 | $o = '<h2>' . wfMsgHtml( 'timedmedia-status-header' ) . '</h2>'; |
19 | 27 | // 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' ) ); |
21 | 29 | |
22 | 30 | $o.= Xml::openElement( 'table', array( 'class' => 'wikitable transcodestatus' ) ) . "\n" |
23 | 31 | . '<tr>' |
— | — | @@ -82,7 +90,7 @@ |
83 | 91 | // Check for error: |
84 | 92 | if( !is_null( $state['time_error'] ) ){ |
85 | 93 | 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( |
87 | 95 | 'title' => wfMsgHtml('timedmedia-error-on', $state['time_error'] ), |
88 | 96 | 'class' => 'errorlink', |
89 | 97 | 'data-error' => $state['error'] |
Index: trunk/extensions/TimedMediaHandler/TimedMediaHandler.hooks.php |
— | — | @@ -84,7 +84,9 @@ |
85 | 85 | |
86 | 86 | // Exclude transcoded assets from normal thumbnail purging |
87 | 87 | // ( 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 | + } |
89 | 91 | |
90 | 92 | // Also add the .log file ( used in two pass encoding ) |
91 | 93 | // ( probably should move in-progress encodes out of web accessible directory ) |
— | — | @@ -109,6 +111,9 @@ |
110 | 112 | |
111 | 113 | // Add transcode status to video asset pages: |
112 | 114 | $wgHooks[ 'ImagePageAfterImageLinks' ][] = 'TimedMediaHandlerHooks::checkForTranscodeStatus'; |
| 115 | + |
| 116 | + // for MediaWiki 1.17 compatibility |
| 117 | + TranscodeStatusTable::getLinker(); |
113 | 118 | |
114 | 119 | return true; |
115 | 120 | } |