* deprecated makeMediaLink() to makeMediaLinkObj

* add FIXME where I was not able to replace a deprecated method
* add doxygen @deprecated where wfDeprecated() was present, but not the doc

Should conclude replacing or tagging remaining deprecated Linker::make*Link*() in core. Linking to r51559 for code review
This commit is contained in:
Siebrand Mazeland 2009-06-13 13:41:48 +00:00
parent 30ea75c648
commit 74e9732dae
2 changed files with 9 additions and 1 deletions

View file

@ -337,6 +337,7 @@ class Linker {
global $wgUser;
$threshold = intval( $wgUser->getOption( 'stubthreshold' ) );
$colour = ( $size < $threshold ) ? 'stub' : '';
// FIXME: replace deprecated makeColouredLinkObj by link()
return $this->makeColouredLinkObj( $nt, $colour, $text, $query, $trail, $prefix );
}
@ -1046,7 +1047,8 @@ class Linker {
if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) {
# Media link; trail not supported.
$linkRegexp = '/\[\[(.*?)\]\]/';
$thelink = $this->makeMediaLink( $submatch[1], "", $text );
$title = Title::makeTitleSafe( NS_FILE, $submatch[1] );
$thelink = $this->makeMediaLinkObj( $title, $text );
} else {
# Other kind of link
if( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {
@ -1740,6 +1742,7 @@ class Linker {
} else $style = '';
return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix, '', $style );
}
/** Obsolete alias */
function makeImage( $url, $alt = '' ) {
wfDeprecated( __METHOD__ );
@ -1795,6 +1798,7 @@ class Linker {
* Used to generate section edit links that point to "other" pages
* (sections that are really part of included pages).
*
* @deprecated use Linker::doEditSectionLink()
* @param $title Title string.
* @param $section Integer: section number.
*/
@ -1805,6 +1809,7 @@ class Linker {
}
/**
* @deprecated use Linker::doEditSectionLink()
* @param $nt Title object.
* @param $section Integer: section number.
* @param $hint Link String: title, or default if omitted or empty

View file

@ -634,6 +634,7 @@ class UploadForm {
if( $file->exists() ) {
$dlink = $sk->linkKnown( $file->getTitle() );
if ( $file->allowInlineDisplay() ) {
// FIXME: replace deprecated makeImageLinkObj by link()
$dlink2 = $sk->makeImageLinkObj( $file->getTitle(), wfMsgExt( 'fileexists-thumb', 'parseinline' ),
$file->getName(), $align, array(), false, true );
} elseif ( !$file->allowInlineDisplay() && $file->isSafeFile() ) {
@ -659,6 +660,7 @@ class UploadForm {
# It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
$dlink = $sk->linkKnown( $nt_lc );
if ( $file_lc->allowInlineDisplay() ) {
// FIXME: replace deprecated makeImageLinkObj by link()
$dlink2 = $sk->makeImageLinkObj( $nt_lc, wfMsgExt( 'fileexists-thumb', 'parseinline' ),
$nt_lc->getText(), $align, array(), false, true );
} elseif ( !$file_lc->allowInlineDisplay() && $file_lc->isSafeFile() ) {
@ -684,6 +686,7 @@ class UploadForm {
# Check if an image without leading '180px-' (or similiar) exists
$dlink = $sk->linkKnown( $nt_thb );
if ( $file_thb->allowInlineDisplay() ) {
// FIXME: replace deprecated makeImageLinkObj by link()
$dlink2 = $sk->makeImageLinkObj( $nt_thb,
wfMsgExt( 'fileexists-thumb', 'parseinline' ),
$nt_thb->getText(), $align, array(), false, true );