diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-01-11 19:06:07 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-01-11 19:06:07 +0000 |
commit | a58285fd06c8113c45377c655dd43cef6337e815 (patch) | |
tree | dfe31d3d12652352fe44890b4811eda0728faefb /includes/ImageGallery.php | |
parent | 20194986f6638233732ba1fc3e838f117d3cc9ea (diff) |
Aktualisierung auf MediaWiki 1.9.0
Diffstat (limited to 'includes/ImageGallery.php')
-rw-r--r-- | includes/ImageGallery.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 7ff456b6..9d58b7f6 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -42,11 +42,20 @@ class ImageGallery } /** - * Set the caption + * Set the caption (as plain text) * * @param $caption Caption */ function setCaption( $caption ) { + $this->mCaption = htmlspecialchars( $caption ); + } + + /** + * Set the caption (as HTML) + * + * @param $caption Caption + */ + function setCaptionHtml( $caption ) { $this->mCaption = $caption; } @@ -134,20 +143,19 @@ class ImageGallery * */ function toHTML() { - global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse; + global $wgLang, $wgGenerateThumbnailOnParse; $sk = $this->getSkin(); $s = '<table class="gallery" cellspacing="0" cellpadding="0">'; if( $this->mCaption ) - $s .= '<td class="galleryheader" colspan="4"><big>' . htmlspecialchars( $this->mCaption ) . '</big></td>'; + $s .= '<td class="galleryheader" colspan="4"><big>' . $this->mCaption . '</big></td>'; $i = 0; foreach ( $this->mImages as $pair ) { $img =& $pair[0]; $text = $pair[1]; - $name = $img->getName(); $nt = $img->getTitle(); if( $nt->getNamespace() != NS_IMAGE ) { @@ -206,6 +214,13 @@ class ImageGallery return $s; } + + /** + * @return int Number of images in the gallery + */ + public function count() { + return count( $this->mImages ); + } } //class ?> |