*/
public static function linkKnown(
$target, $html = null, $customAttribs = array(),
- $query = array(), $options = array( 'known', 'noclasses' ) )
- {
+ $query = array(), $options = array( 'known', 'noclasses' )
+ ) {
return self::link( $target, $html, $customAttribs, $query, $options );
}
* @return String: HTML for an image, with links, wrappers, etc.
*/
public static function makeImageLink( /*Parser*/ $parser, Title $title, $file, $frameParams = array(),
- $handlerParams = array(), $time = false, $query = "", $widthOption = null )
- {
+ $handlerParams = array(), $time = false, $query = "", $widthOption = null
+ ) {
$res = null;
$dummy = new DummyLinker;
if ( !wfRunHooks( 'ImageBeforeProduceHTML', array( &$dummy, &$title,
'valign' => isset( $fp['valign'] ) ? $fp['valign'] : false,
'img-class' => $fp['class'] );
if ( isset( $fp['border'] ) ) {
- // TODO: BUG? Both values are identical
- $params['img-class'] .= ( $params['img-class'] !== '' ) ? ' thumbborder' : 'thumbborder';
+ $params['img-class'] .= ( $params['img-class'] !== '' ? ' ' : '' ) . 'thumbborder';
}
$params = self::getImageLinkMTOParams( $fp, $query, $parser ) + $params;
* @return mixed
*/
public static function makeThumbLinkObj( Title $title, $file, $label = '', $alt,
- $align = 'right', $params = array(), $framed = false, $manualthumb = "" )
- {
+ $align = 'right', $params = array(), $framed = false, $manualthumb = ""
+ ) {
$frameParams = array(
'alt' => $alt,
'caption' => $label,
* @return mixed
*/
public static function makeThumbLink2( Title $title, $file, $frameParams = array(),
- $handlerParams = array(), $time = false, $query = "" )
- {
+ $handlerParams = array(), $time = false, $query = ""
+ ) {
global $wgStylePath, $wgContLang;
$exists = $file && $file->exists();
if ( $page ) {
$url = wfAppendQuery( $url, array( 'page' => $page ) );
}
- if ( $manualthumb &&
- !isset( $fp['link-title'] ) &&
- !isset( $fp['link-url'] ) &&
- !isset( $fp['no-link'] ) ) {
+ if ( $manualthumb
+ && !isset( $fp['link-title'] )
+ && !isset( $fp['link-url'] )
+ && !isset( $fp['no-link'] ) ) {
$fp['link-url'] = $url;
}
$params = array(
'alt' => $fp['alt'],
'title' => $fp['title'],
- 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== '' ) ? $fp['class'] . ' thumbimage' : 'thumbimage'
+ 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== '' ? $fp['class'] . ' ' : '' ) . 'thumbimage'
);
$params = self::getImageLinkMTOParams( $fp, $query ) + $params;
$s .= $thumb->toHtml( $params );
* applicable.
*
* @param File $file
- * @param MediaOutput $thumb
+ * @param MediaTransformOutput $thumb
* @param array $hp image parameters
*/
- protected static function processResponsiveImages( $file, $thumb, $hp ) {
+ public static function processResponsiveImages( $file, $thumb, $hp ) {
global $wgResponsiveImages;
if ( $wgResponsiveImages ) {
$hp15 = $hp;
$thumb15 = $file->transform( $hp15 );
$thumb20 = $file->transform( $hp20 );
- if ( $thumb15->url !== $thumb->url ) {
- $thumb->responsiveUrls['1.5'] = $thumb15->url;
+ if ( $thumb15 && $thumb15->getUrl() !== $thumb->getUrl() ) {
+ $thumb->responsiveUrls['1.5'] = $thumb15->getUrl();
}
- if ( $thumb20->url !== $thumb->url ) {
- $thumb->responsiveUrls['2'] = $thumb20->url;
+ if ( $thumb20 && $thumb20->getUrl() !== $thumb->getUrl() ) {
+ $thumb->responsiveUrls['2'] = $thumb20->getUrl();
}
}
}
$target = Title::newFromText( $linkTarget );
if ( $target ) {
if ( $target->getText() == '' && $target->getInterwiki() === ''
- && !self::$commentLocal && self::$commentContextTitle )
- {
+ && !self::$commentLocal && self::$commentContextTitle
+ ) {
$newTarget = clone ( self::$commentContextTitle );
$newTarget->setFragment( '#' . $target->getFragment() );
$target = $newTarget;