Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php |
— | — | @@ -165,9 +165,12 @@ |
166 | 166 | } |
167 | 167 | if ( ( $linked === null ) || ( $linked === false ) || ( $this->m_outformat == '-' ) ) { |
168 | 168 | 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 { |
172 | 175 | return '[[:' . str_replace( "'", ''', $this->getPrefixedText() ) . '|' . $this->m_textform . ']]'; |
173 | 176 | } |
174 | 177 | } |