r46759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46758‎ | r46759 | r46760 >
Date:10:40, 3 February 2009
Author:jojo
Status:deferred
Tags:
Comment:
move download button up. display alternative text if there is only one format.
Modified paths:
  • /trunk/extensions/Collection/Collection.i18n.php (modified) (history)
  • /trunk/extensions/Collection/Collection.templates.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.i18n.php
@@ -52,6 +52,7 @@
5353 'coll-your_book' => 'Your book',
5454 'coll-download_title' => 'Download',
5555 'coll-download_text' => 'To download an offline version choose a format and click the button.',
 56+ 'coll-download_as_text' => 'To download an offline version in $1 format click the button.',
5657 'coll-download' => 'Download',
5758 'coll-format_label' => 'Format:',
5859 'coll-remove' => 'Remove',
@@ -996,6 +997,7 @@
997998 'coll-your_book' => 'Dein Buch',
998999 'coll-download_title' => 'Herunterladen',
9991000 'coll-download_text' => 'Um eine Offline-Version herunterzuladen, wähle ein Format und klicke auf die Schaltfläche.',
 1001+ 'coll-download_as_text' => 'Um eine Offline-Version im Format $1 herunterzuladen, klicke auf die Schaltfläche.',
10001002 'coll-download' => 'Herunterladen',
10011003 'coll-format_label' => 'Format:',
10021004 'coll-remove' => 'Entfernen',
Index: trunk/extensions/Collection/Collection.templates.php
@@ -72,24 +72,34 @@
7373
7474 <div style="margin-bottom: 10px; padding: 10px; border: 1px solid #aaa; background-color: #f9f9f9;">
7575 <h2><span class="mw-headline"><?php $this->msg('coll-download_title') ?></span></h2>
76 - <?php $this->msgWiki('coll-download_text') ?>
 76+ <?php if (count($this->data['formats']) == 1) {
 77+ $writer = array_rand($this->data['formats']);
 78+ echo $GLOBALS['wgParser']->parse(
 79+ wfMsgNoTrans('coll-download_as_text', $this->data['formats'][$writer]),
 80+ $GLOBALS['wgTitle'],
 81+ $GLOBALS['wgOut']->parserOptions(),
 82+ true
 83+ )->getText();
 84+ $buttonLabel = wfMsgHtml('coll-download_as', htmlspecialchars($this->data['formats'][$writer]));
 85+ } else {
 86+ $this->msgWiki('coll-download_text');
 87+ $buttonLabel = wfMsgHtml('coll-download');
 88+ } ?>
7789 <form id="downloadForm" action="<?php echo htmlspecialchars(SkinTemplate::makeSpecialUrlSubpage('Book', 'render/')) ?>" method="post">
78 - <?php if (count($this->data['formats']) == 1) {
79 - $writer = array_rand($this->data['formats']);
80 - $buttonLabel = wfMsgHtml('coll-download_as', htmlspecialchars($this->data['formats'][$writer]));
81 - ?>
 90+ <table style="width:100%; background-color: transparent;"><tr><td><tbody><tr><td>
 91+ <?php if (count($this->data['formats']) == 1) { ?>
8292 <input type="hidden" name="writer" value="<?php echo htmlspecialchars($writer) ?>" />
83 - <?php } else {
84 - $buttonLabel = wfMsgHtml('coll-download');
85 - ?>
86 - <label for="formatSelect"><?php $this->msg('coll-format_label') ?></label>
87 - <select id="formatSelect" name="writer">
88 - <?php foreach ($this->data['formats'] as $writer => $name) { ?>
89 - <option value="<?php echo htmlspecialchars($writer) ?>"><?php echo htmlspecialchars($name) ?></option>
90 - <?php } ?>
91 - </select>
 93+ <?php } else { ?>
 94+ <label for="formatSelect"><?php $this->msg('coll-format_label') ?></label>
 95+ <select id="formatSelect" name="writer">
 96+ <?php foreach ($this->data['formats'] as $writer => $name) { ?>
 97+ <option value="<?php echo htmlspecialchars($writer) ?>"><?php echo htmlspecialchars($name) ?></option>
 98+ <?php } ?>
 99+ </select>
92100 <?php } ?>
93 - <table style="width:100%; background-color: transparent;"><tr><td style="text-align:right"><input id="downloadButton" type="submit" value="<?php echo $buttonLabel ?>"<?php if (count($this->data['collection']['items']) == 0) { ?> disabled="disabled"<?php } ?> /></td></tr></table>
 101+ </td><td style="text-align:right">
 102+ <input id="downloadButton" type="submit" value="<?php echo $buttonLabel ?>"<?php if (count($this->data['collection']['items']) == 0) { ?> disabled="disabled"<?php } ?> />
 103+ </td></tr></tbody></table>
94104 </form>
95105 </div>
96106

Status & tagging log