コード例 #1
0
	/**
	 * Small convenience function to display a (clickable) logo
	 * @param $project Project name
	 * @return String
	 */
	public function makeLogo( $project, $clickable = true, $width = 25, $height = '', $url = '', $args = array() ) {
		$projectForFile = preg_replace('/ /', '-', strtolower( $project ) );
		$imageobj = wfFindFile( wfMsg( 'wminc-logo-' . $projectForFile ) );
		$useUrl = $url ? $url : IncubatorTest::getSubdomain( 'www', IncubatorTest::getProject( $project, false, true ) );
		if ( !$imageobj ) { # image not found
			if( !$clickable ) {
				return $logo; // FIXME: $logo is undefined
			}
			return Linker::makeExternalLink( $useUrl, $project, false );
		}
		if( $clickable ) {
			$args['link-url'] = $useUrl;
		} else {
			$args['no-link'] = true;
		}
		$handlerParams['width'] = $width;
		if( $height ) {
			$handlerParams['height'] = $height;
		}
		return Linker::makeImageLink2( $this->mTitle, $imageobj,
			array( 'alt' => $project, 'caption' => $project ) + $args, $handlerParams
		);
	}