From b19b41f71757a4e0b31097dfcfd9dc3dcd69ea02 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Wed, 5 Jan 2005 22:07:44 +0000 Subject: [PATCH] BUG#1124 Make gallery valid XHTML 1.0 Make MonoBook.php valid XHTML 1.0 (tagline) Move image gallery CSS code from PHP to CSS file --- includes/ImageGallery.php | 42 ++++++++++++++++++++---------------- skins/MonoBook.php | 4 ++-- skins/amethyst/main.css | 30 ++++++++++++++++++++++++++ skins/chick/main.css | 29 +++++++++++++++++++++++++ skins/common/common.css | 30 ++++++++++++++++++++++++++ skins/common/commonPrint.css | 30 ++++++++++++++++++++++++++ skins/monobook/main.css | 29 +++++++++++++++++++++++++ 7 files changed, 173 insertions(+), 21 deletions(-) diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 7f49a793b6..9e141c02ff 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -30,7 +30,7 @@ class ImageGallery } /** - * Add an image at the end of the gallery. + * Add an image to the gallery. * * @param Image $image Image object that is added to the gallery * @param string $html Additional HTML text to be shown. The name and size of the image are always shown. @@ -38,17 +38,18 @@ class ImageGallery function add( $image, $html='' ) { $this->mImages[] = array( &$image, $html ); } - + /** - * Add an image at the beginning of the gallery. - * - * @param Image $image Image object that is added to the gallery - * @param string $html Additional HTML text to be shown. The name and size of the image are always shown. - */ + * Add an image at the beginning of the gallery. + * + * @param Image $image Image object that is added to the gallery + * @param string $html Additional HTML text to be shown. The name and size of the image are always shown. + */ function insert( $image, $html='' ) { array_unshift( $this->mImages, array( &$image, $html ) ); } + /** * isEmpty() returns false iff the gallery doesn't contain any images */ @@ -91,7 +92,7 @@ class ImageGallery $sk = $wgUser->getSkin(); - $s = ''; + $s = '
'; $i = 0; foreach ( $this->mImages as $pair ) { $img =& $pair[0]; @@ -102,8 +103,8 @@ class ImageGallery // Not an image. Just print the name and skip. if ( $nt->getNamespace() != NS_IMAGE ) { - $s .= '' . (($i%4==3) ? "\n" : ''); + $s .= '' . (($i%4==3) ? "\n" : ''); $i++; continue; @@ -129,15 +130,18 @@ class ImageGallery '' ; $s .= ($i%4==0) ? '' : ''; - $thumb = $img->getThumbnail(120,120); - $s .= '\n" . (($i%4==3) ? "\n" : ''); - + $thumb = $img->getThumbnail( 120, 120 ); + $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2; + $s .= '\n"; + $s .= ($i%4==3) ? '' : ''; $i++; } if( $i %4 != 0 ) { diff --git a/skins/MonoBook.php b/skins/MonoBook.php index 29bd147ab5..ba1d50f4b6 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -185,8 +185,8 @@ class MonoBookTemplate extends QuickTemplate { data['copyright' ]) { ?>data['about' ]) { ?>
  • html('about') ?>
  • data['disclaimer']) { ?>
  • html('disclaimer') ?>
  • + data['tagline']) { ?>
  • data['tagline'] ?>
  • - data['tagline']) { ?>
  • data['tagline'] ?>
  • html('reporttime') ?> @@ -196,4 +196,4 @@ class MonoBookTemplate extends QuickTemplate { } } -?> \ No newline at end of file +?> diff --git a/skins/amethyst/main.css b/skins/amethyst/main.css index e696f49f09..6f96de8005 100644 --- a/skins/amethyst/main.css +++ b/skins/amethyst/main.css @@ -981,3 +981,33 @@ span.minoreditletter { color:black; background-color:#C5FFE6; } + +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +div.gallerybox { + border: 1px solid #cccccc; + margin: 2px; + background-color:#f9f9f9; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} + diff --git a/skins/chick/main.css b/skins/chick/main.css index 4e798bbdf5..c31aca520d 100755 --- a/skins/chick/main.css +++ b/skins/chick/main.css @@ -445,3 +445,32 @@ span.minoreditletter { background-color:#C5FFE6; } +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +div.gallerybox { + border: 1px solid #cccccc; + margin: 2px; + background-color:#f9f9f9; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} + diff --git a/skins/common/common.css b/skins/common/common.css index 95c68b2071..108eef7504 100644 --- a/skins/common/common.css +++ b/skins/common/common.css @@ -225,3 +225,33 @@ span.minoreditletter { color:black; background-color:#C5FFE6; } + +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +div.gallerybox { + border: 1px solid #cccccc; + margin: 2px; + background-color:#f9f9f9; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} + diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 491d9e70d3..ce4b35de12 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -229,3 +229,33 @@ div.townBox dl dd { } #siteNotice { display: none; } + +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +div.gallerybox { + border: 1px solid #cccccc; + margin: 2px; + background-color:#f9f9f9; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} + diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 05ac91f658..8b386a65c1 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -950,3 +950,32 @@ span.minoreditletter { color:black; background-color:#C5FFE6; } + +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +div.gallerybox { + border: 1px solid #cccccc; + margin: 2px; + background-color:#f9f9f9; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} -- 2.20.1