From a58285fd06c8113c45377c655dd43cef6337e815 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 11 Jan 2007 19:06:07 +0000 Subject: Aktualisierung auf MediaWiki 1.9.0 --- includes/ImagePage.php | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'includes/ImagePage.php') diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 908dd5cc..43b99130 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -71,13 +71,13 @@ class ImagePage extends Article { $this->imageHistory(); $this->imageLinks(); if( $exif ) { - global $wgStylePath; + global $wgStylePath, $wgStyleVersion; $expand = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-expand' ) ) ); $collapse = htmlspecialchars( wfEscapeJsString( wfMsg( 'metadata-collapse' ) ) ); $wgOut->addHTML( "

" . wfMsgHtml( 'metadata' ) . "

\n" ); $wgOut->addWikiText( $this->makeMetadataTable( $exif ) ); $wgOut->addHTML( - "\n" . + "\n" . "\n" ); } } else { @@ -142,6 +142,7 @@ class ImagePage extends Article { $fields = array(); $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) ); foreach( $lines as $line ) { + $matches = array(); if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) { $fields[] = $matches[1]; } @@ -169,12 +170,8 @@ class ImagePage extends Article { $full_url = $this->img->getURL(); $anchoropen = ''; $anchorclose = ''; + $sizeSel = intval( $wgUser->getOption( 'imagesize') ); - if( $wgUser->getOption( 'imagesize' ) == '' ) { - $sizeSel = User::getDefaultOption( 'imagesize' ); - } else { - $sizeSel = intval( $wgUser->getOption( 'imagesize' ) ); - } if( !isset( $wgImageLimits[$sizeSel] ) ) { $sizeSel = User::getDefaultOption( 'imagesize' ); } @@ -247,7 +244,7 @@ class ImagePage extends Article { $wgOut->addHTML( '' ); + htmlspecialchars( $this->img->getTitle()->getPrefixedText() ).'" />' . $anchorclose . '' ); if ( $this->img->isMultipage() ) { $count = $this->img->pageCount(); @@ -300,9 +297,15 @@ class ImagePage extends Article { if ($showLink) { $filename = wfEscapeWikiText( $this->img->getName() ); + // Hacky workaround: for some reason we use the incorrect MIME type + // image/svg for SVG. This should be fixed internally, but at least + // make the displayed type right. + $mime = $this->img->getMimeType(); + if ($mime == 'image/svg') $mime = 'image/svg+xml'; + $info = wfMsg( 'fileinfo', ceil($this->img->getSize()/1024.0), - $this->img->getMimeType() ); + $mime ); global $wgContLang; $dirmark = $wgContLang->getDirMark(); @@ -333,7 +336,7 @@ END } else { # Image does not exist - $title = Title::makeTitle( NS_SPECIAL, 'Upload' ); + $title = SpecialPage::getTitleFor( 'Upload' ); $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'), 'wpDestFile=' . urlencode( $this->img->getName() ) ); $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) ); @@ -348,7 +351,7 @@ END if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) { $sk = $wgUser->getSkin(); - $title = Title::makeTitle( NS_SPECIAL, 'Upload' ); + $title = SpecialPage::getTitleFor( 'Upload' ); $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'), array( 'wpDestFile' => urlencode( $this->img->getName() ))); $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link); @@ -365,7 +368,7 @@ END function getUploadUrl() { global $wgServer; - $uploadTitle = Title::makeTitle( NS_SPECIAL, 'Upload' ); + $uploadTitle = SpecialPage::getTitleFor( 'Upload' ); return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) ); } @@ -530,15 +533,10 @@ END * @param $reason User provided reason for deletion. */ function doDelete( $reason ) { - global $wgOut, $wgRequest, $wgUseSquid; - global $wgPostCommitUpdateList; - - $fname = 'ImagePage::doDelete'; + global $wgOut, $wgRequest; $oldimage = $wgRequest->getVal( 'oldimage' ); - $dbw =& wfGetDB( DB_MASTER ); - if ( !is_null( $oldimage ) ) { if ( strlen( $oldimage ) < 16 ) { $wgOut->showUnexpectedValueError( 'oldimage', htmlspecialchars($oldimage) ); -- cgit v1.2.3-54-g00ecf