redirects to the redirect table
* Add links to page and file deletion forms to edit predefined delete reasons
* (bug 13269) Added MediaWiki:Uploadfooter to the bottom of Special:Upload
+* (bug 2815) Search results for media files now use thumb instead of text extract
=== Bug fixes in 1.13 ===
if (!$t->userCanRead()) {
return "<li>{$link}</li>\n";
}
+
+ $extract = $size = '';
+ // Include a thumbnail for media files...
+ if( $t->getNamespace() == NS_IMAGE ) {
+ $img = wfFindFile( $t );
+ if( $img ) {
+ $thumb = $img->getThumbnail( 120, 120 );
+ if( $thumb ) {
+ $extract = '<table>' .
+ '<tr>' .
+ '<td width="120" align="center">' .
+ $sk->makeKnownLinkObj( $t, $thumb->toHtml() ) .
+ '</td>' .
+ '<td>' .
+ $link .
+ '<br />' .
+ $img->getLongDesc() .
+ '</td>' .
+ '</tr>' .
+ '</table>';
+ wfProfileOut( $fname );
+ return "<li><div>{$extract}</div></li>\n";
+ }
+ }
+ }
+
+ $extract = $this->extractText( $t, $terms, $contextlines, $contextchars );
+ wfProfileOut( $fname );
+ return "<li>{$link} {$extract}</li>\n";
+ }
+
+ private function extractText( $t, $terms, $contextlines, $contextchars ) {
+ global $wgLang, $wgContLang;
+ $fname = __METHOD__;
+
$revision = Revision::newFromTitle( $t );
$text = $revision->getText();
$size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
$lineno = 0;
- $extract = '';
+ $extract = "($size)";
wfProfileIn( "$fname-extract" );
foreach ( $lines as $line ) {
if ( 0 == $contextlines ) {
$extract .= "<br /><small>{$lineno}: {$line}</small>\n";
}
wfProfileOut( "$fname-extract" );
- wfProfileOut( $fname );
- return "<li>{$link} ({$size}){$extract}</li>\n";
+
+ return $extract;
}
function powerSearchBox( $term ) {