Modified Image Gallery
This change involves adding a 'nocols' (number of columns) argument to a wiki gallery. Note the patches need a bit of clean-up due to the fact that the only other wiki available for comparison (when they were made) were slighly different versions.
<diff>--- ../../oldWiki/includes/Parser.php 2006-10-13 17:06:32.000000000 -0700 +++ ./Parser.php 2007-03-08 21:54:50.000000000 -0800 @@ -4221,6 +4059,9 @@
if( isset( $params['caption'] ) ) $ig->setCaption( $params['caption'] );
+ if( isset( $params['nocols'] ) ) + $ig->setNumcols( $params['nocols'] ); +
$lines = explode( "\n", $text ); foreach ( $lines as $line ) { # match lines like these:
</diff>
<diff>--- ../../oldWiki/includes/ImageGallery.php 2006-10-13 17:06:35.000000000 -0700 +++ ./ImageGallery.php 2007-03-14 14:51:18.000000000 -0700 @@ -18,6 +18,7 @@
var $mImages, $mShowBytes, $mShowFilename; var $mCaption = false; var $mSkin = false;
+ var $mNumCols = 4;
/** * Is the gallery on a wiki page (i.e. not a special page)
@@ -50,12 +51,22 @@
$this->mCaption = $caption; }
+ /** + * Set the number of columns + * @param $caption Caption + $this->mNumCols = ord($nocols) - ord('0'); + */ + function setNumcols( $nocols ) { + sscanf( $nocols, "%d", $this->mNumCols ); + } + +
/** * Instruct the class to use a specific skin for rendering * * @param $skin Skin object */
- function useSkin( $skin ) { + function useSkin( &$skin ) {
$this->mSkin =& $skin; }
@@ -82,7 +93,6 @@
*/ function add( $image, $html= ) { $this->mImages[] = array( &$image, $html );
- wfDebug( "ImageGallery::add " . $image->getName() . "\n" );
} /**
@@ -136,11 +146,11 @@
function toHTML() { global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse;
- $sk = $this->getSkin(); + $sk =& $this->getSkin();
$s = '' . htmlspecialchars( $this->mCaption ) . ' | '; + $s .= 'mNumCols) . '">' . htmlspecialchars( $this->mCaption ) . ' | ';
' . $thumbhtml
. ' ' . "\n" . $textlink . $text . $nb
. " | \n";
- $s .= ($i%4==3) ? '
</diff>