http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88864

Revision: 88864
Author:   yaron
Date:     2011-05-25 23:10:27 +0000 (Wed, 25 May 2011)
Log Message:
-----------
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: 
trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php  
2011-05-25 23:09:45 UTC (rev 88863)
+++ trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_WikiPage.php  
2011-05-25 23:10:27 UTC (rev 88864)
@@ -165,9 +165,12 @@
                }
                if ( ( $linked === null ) || ( $linked === false ) || ( 
$this->m_outformat == '-' ) ) {
                        return $this->m_fixNamespace == NS_MAIN ? 
$this->getPrefixedText():$this->getText();
-               } elseif ( $this->m_dataitem->getNamespace() == NS_IMAGE ) { // 
embed images instead of linking to their page
-                        return '[[' . str_replace( "'", ''', 
$this->getPrefixedText() ) . '|' . $this->m_textform . 
'|frameless|border|text-top]]';
-               } else { // this takes care of all other cases, esp. it is 
right for Media:
+               } elseif ( $this->m_dataitem->getNamespace() == NS_FILE ) {
+                       // For images and other files, embed them and display
+                       // their name, instead of just displaying their name
+                       $fileName = str_replace( "'", ''', 
$this->getPrefixedText() );
+                        return '[[' . $fileName . '|' . $this->m_textform . 
'|frameless|border|text-top]]' . "<br />\n" . '[[:' . $fileName . '|' . 
$this->m_textform . ']]';
+               } else {
                        return '[[:' . str_replace( "'", '&#x0027;', 
$this->getPrefixedText() ) . '|' . $this->m_textform . ']]';
                }
        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to