r46602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46601‎ | r46602 | r46603 >
Date:17:17, 30 January 2009
Author:jojo
Status:resolved (Comments)
Tags:
Comment:
added Mathias' improvements to the Special page
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
@@ -82,12 +82,12 @@
8383 'coll-empty_collection' => 'Empty book',
8484 'coll-revision' => 'Revision: $1',
8585 'coll-save_collection_title' => 'Save and share your book',
86 - 'coll-save_collection_text' => 'Choose a location:',
 86+ 'coll-save_collection_text' => 'Choose a storage location for your book:',
8787 'coll-login_to_save' => 'If you want to save books for later use, please [[Special:UserLogin|log in or create an account]].',
8888 'coll-personal_collection_label' => 'Personal book:',
8989 'coll-community_collection_label' => 'Community book:',
9090 'coll-save_collection' => 'Save book',
91 - 'coll-save_category' => 'Books are saved in the category [[:Category:{{MediaWiki:Coll-bookscategory}}|{{MediaWiki:Coll-bookscategory}}]].',
 91+ 'coll-save_category' => 'All books are saved in the category [[:Category:{{MediaWiki:Coll-bookscategory}}|{{MediaWiki:Coll-bookscategory}}]].',
9292 'coll-overwrite_title' => 'Page exists.
9393 Overwrite?',
9494 'coll-overwrite_text' => 'A page with the name [[:$1]] already exists.
@@ -1004,12 +1004,12 @@
10051005 'coll-empty_collection' => 'Leeres Buch',
10061006 'coll-revision' => 'Version: $1',
10071007 'coll-save_collection_title' => 'Speichere und teile dein Buch',
1008 - 'coll-save_collection_text' => 'Wähle einen Ort:',
 1008+ 'coll-save_collection_text' => 'Wähle einen Speicherort für dein Buch:',
10091009 'coll-login_to_save' => 'Wenn du Bücher speichern möchtest, [[Special:UserLogin|melde dich bitte an oder erstelle ein Benutzerkonto]].',
10101010 'coll-personal_collection_label' => 'Persönliches Buch:',
10111011 'coll-community_collection_label' => 'Gemeinschaftliches Buch:',
10121012 'coll-save_collection' => 'Buch speichern',
1013 - 'coll-save_category' => 'Bücher werden in der Kategorie [[:Category:{{MediaWiki:Coll-bookscategory}}|{{MediaWiki:Coll-bookscategory}}]] gespeichert.',
 1013+ 'coll-save_category' => 'Alle Bücher werden der Kategorie [[:Category:{{MediaWiki:Coll-bookscategory}}|{{MediaWiki:Coll-bookscategory}}]] zugeordnet.',
10141014 'coll-overwrite_title' => 'Seite vorhanden, überschreiben?',
10151015 'coll-overwrite_text' => 'Eine Seite mit dem Namen [[:$1]] ist bereits vorhanden. Möchtest du sie durch dein Buch ersetzen?',
10161016 'coll-yes' => 'Ja',
Index: trunk/extensions/Collection/Collection.templates.php
@@ -62,8 +62,9 @@
6363 <?php foreach ($this->data['podpartners'] as $partner => $partnerData) { ?>
6464 <form action="<?php echo htmlspecialchars(SkinTemplate::makeSpecialUrlSubpage('Book', 'post_zip/')) ?>" method="get">
6565 <input type="hidden" name="partner" value="<?php echo htmlspecialchars($partner) ?>"/>
66 - <input type="submit" value="<?php echo wfMsgHtml('coll-order_from_pp', htmlspecialchars($partnerData['name'])) ?>" class="order" <?php if (count($this->data['collection']['items']) == 0) { ?> disabled="disabled"<?php } ?> />
67 - <a href="<?php echo htmlspecialchars($partnerData['url']) ?>" target="_blank"><?php echo wfMsgHtml('coll-about_pp', htmlspecialchars($partnerData['name'])) ?>&nbsp;<img src="<?php echo htmlspecialchars($partnerData['logourl']) ?>" alt="<?php echo htmlspecialchars($partnerData['name']) ?>"/></a>
 66+ <table style="width:100%; background-color: transparent;"><tr><td><a href="<?php echo htmlspecialchars($partnerData['url']) ?>" target="_blank"><?php echo wfMsgHtml('coll-about_pp', htmlspecialchars($partnerData['name'])) ?>&nbsp;<img src="<?php echo htmlspecialchars($partnerData['logourl']) ?>" alt="<?php echo htmlspecialchars($partnerData['name']) ?>"/></a></td>
 67+ <td style="text-align:right"><input type="submit" value="<?php echo wfMsgHtml('coll-order_from_pp', htmlspecialchars($partnerData['name'])) ?>" class="order" <?php if (count($this->data['collection']['items']) == 0) { ?> disabled="disabled"<?php } ?> /></td></tr></table>
 68+
6869 </form>
6970 <?php } ?>
7071 </div>
@@ -88,7 +89,7 @@
8990 <?php } ?>
9091 </select>
9192 <?php } ?>
92 - <input id="downloadButton" type="submit" value="<?php echo $buttonLabel ?>"<?php if (count($this->data['collection']['items']) == 0) { ?> disabled="disabled"<?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>
9394 </form>
9495 </div>
9596
@@ -96,16 +97,29 @@
9798 <h2><span class="mw-headline"><?php $this->msg('coll-save_collection_title') ?></span></h2>
9899 <?php if ($GLOBALS['wgUser']->isLoggedIn()) { ?>
99100 <?php $this->msgWiki('coll-save_collection_text') ?>
 101+ <?php
 102+ $searchscript = $GLOBALS['wgServer'] . $GLOBALS['wgScript'] . '?title=Special%3APrefixindex&from=';
 103+ $bookname = wfMsg('coll-collections');
 104+ $communityCollNS = $GLOBALS['wgCommunityCollectionNamespace'];
 105+ ?>
100106 <form id="saveForm" action="<?php echo htmlspecialchars(SkinTemplate::makeSpecialUrlSubpage('Book', 'save_collection/')) ?>" method="post">
 107+ <table style="width:100%; background-color: transparent;"><tr><td>
101108 <input id="personalCollType" type="radio" name="colltype" value="personal" checked="checked" />
102 - <label for="personalCollType"><?php $this->msg('coll-personal_collection_label') ?></label>
103 - <label for="personalCollTitle"><?php echo htmlspecialchars($GLOBALS['wgUser']->getUserPage()->getPrefixedText() . '/' . wfMsgForContent('coll-collections') . '/') ?></label>
104 - <input id="personalCollTitle" type="text" name="pcollname" /><br />
 109+ <label for="personalCollTitle"><?php echo '<a href="' . $searchscript . $GLOBALS['wgUser']->getName() . '/' . $bookname . '%2F&namespace=2">'.htmlspecialchars($GLOBALS['wgUser']->getUserPage()->getPrefixedText() . '/' . wfMsgForContent('coll-collections') . '/').'</a>' ?></label>
 110+ </td>
 111+ <td style="text-align:right;">
 112+ <input id="personalCollTitle" type="text" name="pcollname" />
 113+ </td></tr>
 114+ <tr><td>
105115 <input id="communityCollType" type="radio" name="colltype" value="community" />
106 - <label for="communityCollType"><?php $this->msg('coll-community_collection_label') ?></label>
107 - <label for="communityCollTitle"><?php echo htmlspecialchars(Title::makeTitle($GLOBALS['wgCommunityCollectionNamespace'], wfMsgForContent('coll-collections'))->getPrefixedText() . '/') ?></label>
108 - <input id="communityCollTitle" type="text" name="ccollname" disabled="disabled" /><br />
 116+ <label for="communityCollTitle"><?php echo '<a href="' . $searchscript . $bookname . '%2F&namespace='.$communityCollNS.'">' . htmlspecialchars(Title::makeTitle($GLOBALS['wgCommunityCollectionNamespace'], wfMsgForContent('coll-collections'))->getPrefixedText() . '/') . '</a>' ?></label>
 117+ </td>
 118+ <td style="text-align:right;">
 119+ <input id="communityCollTitle" type="text" name="ccollname" disabled="disabled" />
 120+ </td>
 121+ </tr><td>&nbsp;</td><td style="text-align:right;">
109122 <input id="saveButton" type="submit" value="<?php $this->msg('coll-save_collection') ?>"<?php if (count($this->data['collection']['items']) == 0) { ?> disabled="disabled"<?php } ?> />
 123+ </tr></table>
110124 </form>
111125
112126 <?php } else {

Comments

#Comment by Brion VIBBER (talk | contribs)   17:44, 30 January 2009

Bad XHTML output -- needs escaping and proper URL generation to begin with.

#Comment by Jbeigel (talk | contribs)   12:28, 3 June 2009

Sorry for not responding for so long: This should be fixed by now (makeSpecialUrl(), correct XHTML etc.)

Status & tagging log