r88864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88863‎ | r88864 | r88865 >
Date:23:10, 25 May 2011
Author:yaron
Status:deferred
Tags:
Comment:
Changed display of images and other files to also show the name of the file, not just display its thumbnail - seems like a better general solution, especially for the 'gallery' format, but also in other cases
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php
@@ -165,9 +165,12 @@
166166 }
167167 if ( ( $linked === null ) || ( $linked === false ) || ( $this->m_outformat == '-' ) ) {
168168 return $this->m_fixNamespace == NS_MAIN ? $this->getPrefixedText():$this->getText();
169 - } elseif ( $this->m_dataitem->getNamespace() == NS_IMAGE ) { // embed images instead of linking to their page
170 - return '[[' . str_replace( "'", ''', $this->getPrefixedText() ) . '|' . $this->m_textform . '|frameless|border|text-top]]';
171 - } else { // this takes care of all other cases, esp. it is right for Media:
 169+ } elseif ( $this->m_dataitem->getNamespace() == NS_FILE ) {
 170+ // For images and other files, embed them and display
 171+ // their name, instead of just displaying their name
 172+ $fileName = str_replace( "'", ''', $this->getPrefixedText() );
 173+ return '[[' . $fileName . '|' . $this->m_textform . '|frameless|border|text-top]]' . "<br />\n" . '[[:' . $fileName . '|' . $this->m_textform . ']]';
 174+ } else {
172175 return '[[:' . str_replace( "'", '&#x0027;', $this->getPrefixedText() ) . '|' . $this->m_textform . ']]';
173176 }
174177 }

Status & tagging log