public static function ImageOverlayLinkBegin($dummy, \Title $target, &$text, &$customAttribs, &$query, &$options, &$ret) {
	    global $wgDIQAImageOverlayWhitelist;
	    global $wgDIQADownloadWhitelist;
	       
	    if (!self::isImage($target->mNamespace)) {
	        // don't rewrite links not pointing to images
	        return true; 
	    }
	    
        $file = wfFindFile($target);
        if ( !$file ) { 
            // don't rewrite links to non-existing files
            return true; 
        }
	    
        $ext = $file->getExtension();
	    if ( in_array( $ext, $wgDIQAImageOverlayWhitelist )) { 
	        // open in overlay
	        $ret = Html::rawElement ( 
	            'a', 
	            array ( 'href' => $file->getFullURL(), 'class' => 'imageOverlay' ), 
	            self::getDisplayTitle($target) );
	        return false;
	    }
	    
	    if ( in_array( $ext, $wgDIQADownloadWhitelist )) { 
	        // download
	        $ret = Html::rawElement ( 
	            'a', 
	            array ( 'href' => $file->getFullURL() ), 
	            self::getDisplayTitle($target) );
            return false;
	    }
	    
	    // don't rewrite links to files with inappropriate extensions
	    return true; 
	}
public static function ImageOverlayLinkBegin($dummy, \Title $target, &$text, &$customAttribs, &$query, &$options, &$ret) {
	    global $wgDIQAImageOverlayWhitelist;
	    global $wgDIQADownloadWhitelist;
	       
	    if (!self::isImage($target->mNamespace)) {
	        // don't rewrite links not pointing to images
	        return true; 
	    }
	    
        $file = wfFindFile($target);
        if ( !$file ) { 
            // don't rewrite links to non-existing files
            return true; 
        }
	    
        $ext = $file->getExtension();
	    if ( in_array( $ext, $wgDIQAImageOverlayWhitelist )) { 
	        // open in overlay
	        $ret = Html::rawElement ( 
	            'a', 
	            array ( 'href' => $file->getFullURL(), 'class' => 'imageOverlay' ), 
	            self::getDisplayTitle($target) );
	        return false;
	    }
	    
	    if ( in_array( $ext, $wgDIQADownloadWhitelist )) { 
	        // download
	        $ret = Html::rawElement ( 
	            'a', 
	            array ( 'href' => $file->getFullURL() ), 
	            self::getDisplayTitle($target) );
            return false;
	    }
	    
	    // don't rewrite links to files with inappropriate extensions
	    return true; 
	}
public static function ImageOverlayLinkBegin ( $ dummy , \ Title $ target , & $ text , & $ customAttribs , & $ query , & $ options , & $ ret ) { global $ wgDIQAImageOverlayWhitelist ; global $ wgDIQADownloadWhitelist ; if ( ! self :: isImage ( $ target -> mNamespace ) ) { // don't rewrite links not pointing to images return true ; } $ file = wfFindFile ( $ target ) ; if ( ! $ file ) { // don't rewrite links to non-existing files return true ; } $ ext = $ file -> getExtension ( ) ; if ( in_array ( $ ext , $ wgDIQAImageOverlayWhitelist ) ) { // open in overlay $ ret = Html :: rawElement ( 'a' , array ( 'href' => $ file -> getFullURL ( ) , 'class' => 'imageOverlay' ) , self :: getDisplayTitle ( $ target ) ) ; return false ; } if ( in_array ( $ ext , $ wgDIQADownloadWhitelist ) ) { // download $ ret = Html :: rawElement ( 'a' , array ( 'href' => $ file -> getFullURL ( ) ) , self :: getDisplayTitle ( $ target ) ) ; return false ; } // don't rewrite links to files with inappropriate extensions return true ; }
Rewrites links to images in order to open them into a overlay
@param unknown $dummy
@param \Title $target
@param unknown $text
@param unknown $customAttribs
@param unknown $query
@param unknown $options
@param unknown $ret
@return boolean
Rewrites links to images in order to open them into a overlay