* Allow setting the skin object that ImageGallery will use; needed during parse operations (the skin must come from the ParserOptions, not $wgUser)
* Prod a few skin files and increment some cache-smashers
preference.
* Make sure '~~~' '~~~~' '~~~~~' are removed in Nickname preference.
* Rename "ipusuccess" to "unblocked", change the format (now wiki text)
+* (bug 2316) Add "caption" attribute to <gallery> tag
+* Allow setting the skin object that ImageGallery will use; needed during parse
+ operations (the skin must come from the ParserOptions, not $wgUser)
== Compatibility ==
$wgOut->setRobotpolicy( 'noindex,nofollow' );
$wgOut->addHTML( '<h2>' . htmlspecialchars( $newComment ) . "</h2>\n<hr />\n" );
+ #$this->updateArticle( $target->getText(), $newComment, 1, $this->mTitle->userIsWatching(), $bot );
$this->updateArticle( $target->getText(), $newComment, 1, $this->mTitle->userIsWatching(), $bot );
$wgOut->returnToMain( false );
class ImageGallery
{
var $mImages, $mShowBytes, $mShowFilename;
+ var $mCaption = false;
+ var $mSkin = false;
/**
* Is the gallery on a wiki page (i.e. not a special page)
function setParsing( $val = true ) {
$this->mParsing = $val;
}
+
+ /**
+ * Set the caption
+ * What's passed is used as HTML so don't do anything stupid
+ *
+ * @param $caption Caption
+ */
+ function setCaption( $caption ) {
+ $this->mCaption = $caption;
+ }
+
+ /**
+ * Instruct the class to use a specific skin for rendering
+ *
+ * @param $skin Skin object
+ */
+ function useSkin( &$skin ) {
+ $this->mSkin =& $skin;
+ }
+
+ /**
+ * Return the skin that should be used
+ *
+ * @return Skin object
+ */
+ function getSkin() {
+ if( !$this->mSkin ) {
+ global $wgUser;
+ $skin =& $wgUser->getSkin();
+ } else {
+ $skin =& $this->mSkin;
+ }
+ return $skin;
+ }
/**
* Add an image to the gallery.
*
*/
function toHTML() {
- global $wgLang, $wgUser, $wgIgnoreImageErrors;
+ global $wgLang, $wgIgnoreImageErrors;
- $sk = $wgUser->getSkin();
+ $sk =& $this->getSkin();
$s = '<table class="gallery" cellspacing="0" cellpadding="0">';
+ if( $this->mCaption )
+ $s .= '<td class="galleryheader" colspan="4"><big>' . $this->mCaption . '</big></td>';
+
$i = 0;
foreach ( $this->mImages as $pair ) {
$img =& $pair[0];
$output = MathRenderer::renderMath( $content );
break;
case 'gallery':
- $output = $this->renderImageGallery( $content );
+ $output = $this->renderImageGallery( $content, $params );
break;
default:
if( isset( $this->mTagHooks[$tagName] ) ) {
* labeled 'The number "1"' and
* 'A tree'.
*/
- function renderImageGallery( $text ) {
+ function renderImageGallery( $text, $params ) {
$ig = new ImageGallery();
$ig->setShowBytes( false );
$ig->setShowFilename( false );
$ig->setParsing();
- $lines = explode( "\n", $text );
+ $ig->useSkin( $this->mOptions->getSkin() );
+ if( isset( $params['caption'] ) )
+ $ig->setCaption( $this->replaceInternalLinks( $params['caption'] ) );
+
+ $lines = explode( "\n", $text );
foreach ( $lines as $line ) {
# match lines like these:
# Image:someimage.jpg|This is some image
class SkinCologneBlue extends Skin {
function getStylesheet() {
- return "common/cologneblue.css?1";
+ return "common/cologneblue.css?2";
}
function getSkinName() {
return "cologneblue";
<meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
<?php $this->html('headlinks') ?>
<title><?php $this->text('pagetitle') ?></title>
- <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?8"; /*]]>*/</style>
+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?9"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
<!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
-@import url("common.css?1");
+@import url("common.css?2");
body { margin: 0px; padding: 0px; color: black; }
#specialform { display: inline; }
a.stub, #quickbar a.stub { color:#772233; text-decoration:none; }
a.new, #quickbar a.new { color: #CC2200; }
h2, h3, h4, h5, h6 { margin-bottom: 0; }
-small { font-size: 75%; }
-
+small { font-size: 75%; }
\ No newline at end of file
#jump-to-nav {
display: none;
+}
+
+table.gallery td.galleryheader {
+ text-align: center;
+ font-weight: bold;
}
\ No newline at end of file
border: solid 2px white;
}
+table.gallery td.galleryheader {
+ text-align: center;
+ font-weight: bold;
+}
+
div.gallerybox {
margin: 2px;
width: 150px;