r50481 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50480‎ | r50481 | r50482 >
Date:14:01, 11 May 2009
Author:jan
Status:deferred (Comments)
Tags:
Comment:
* Add form for create
* Add new messages
Modified paths:
  • /trunk/extensions/Poll/Poll.i18n.php (modified) (history)
  • /trunk/extensions/Poll/Poll_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Poll/Poll_body.php
@@ -22,6 +22,10 @@
2323 if ( $action == "vote" ) {
2424 $this->vote();
2525 }
 26+
 27+ if ( $action == "submit" ) {
 28+ $this->submit();
 29+ }
2630 }
2731
2832 public function create() {
@@ -38,7 +42,18 @@
3943 $wgOut->addWikiMsg( 'poll-create-block-error' );
4044 }
4145 else {
42 -
 46+ $wgOut->addHtml( '<form action="index.php?action=submit" method="post">' );
 47+ $wgOut->addHtml( '<table style="border: 0px;">' );
 48+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-question' ).':</td><td><input type="text" name="poll_name"></td></tr>' );
 49+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-alternative' ).' 1:</td><td><input type="text" name="poll_alternative_1"></td></tr>' );
 50+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-alternative' ).' 2:</td><td><input type="text" name="poll_alternative_2"></td></tr>' );
 51+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-alternative' ).' 3:</td><td><input type="text" name="poll_alternative_3"></td></tr>' );
 52+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-alternative' ).' 4:</td><td><input type="text" name="poll_alternative_4"></td></tr>' );
 53+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-alternative' ).' 5:</td><td><input type="text" name="poll_alternative_5"></td></tr>' );
 54+ $wgOut->addHtml( '<tr><td>'.wfMsg( 'poll-alternative' ).' 6:</td><td><input type="text" name="poll_alternative_6"></td></tr>' );
 55+ $wgOut->addHtml( '<tr><td><input type="submit" value="'.wfMsg( 'poll-submit' ).'"></td></tr>' );
 56+ $wgOut->addHtml( '</table>' );
 57+ $wgOut->addHtml( '</form>' );
4358 }
4459 }
4560
@@ -59,4 +74,8 @@
6075
6176 }
6277 }
 78+
 79+ public function submit() {
 80+ global $wgRequest, $wgOut, $wgUser;
 81+ }
6382 }
Index: trunk/extensions/Poll/Poll.i18n.php
@@ -10,8 +10,8 @@
1111
1212
1313 $messages['en'] = array(
14 - 'poll' => 'Polls',
15 - 'poll-desc' => 'Add a [[Special:Poll|special page]] for using polls',
 14+ 'poll' => 'List of the Polls',
 15+ 'poll-desc' => 'Add a [[Special:Poll|special page]] for using polls',
1616 'poll-title-create' => 'Create a new poll',
1717 'poll-title-vote' => 'Voting page',
1818 'poll-title-score' => 'Score',
@@ -19,16 +19,22 @@
2020 'poll-create-block-error' => 'You are not allowed to create a new poll because you use a blocked user',
2121 'poll-vote-right-error' => 'You are not allowed to vote(needed right: poll-vote)',
2222 'poll-vote-block-error' => 'You are not allowed to vote because you use a blocked user',
 23+ 'poll-alternative' => 'Alternative',
 24+ 'poll-question' => 'Question',
 25+ 'poll-submit' => 'Submit',
2326 );
2427
2528 $messages['de'] = array(
26 - 'poll' => 'Umfragen',
 29+ 'poll' => 'Liste der Umfragen',
2730 'poll-desc' => 'Erstellt eine [[Special:Poll|Spezialsite]], um Umfragen zu nutzen',
2831 'poll-title-create' => 'Eine neue Umfrage erstellen',
2932 'poll-title-vote' => 'Abstimmen',
3033 'poll-title-score' => 'Auswertung',
31 - 'poll-create-right-error' => 'Leider darfst du keine neue Umfrage erstellen(ben�tige Gruppenberechttigung: poll-create)',
 34+ 'poll-create-right-error' => 'Leider darfst du keine neue Umfrage erstellen(ben&ouml;tige Gruppenberechttigung: poll-create)',
3235 'poll-create-block-error' => 'Leider darfst du keine neue Umfrage erstellen, weil du einen gesperten Benutzer benutzt',
33 - 'poll-vote-right-error' => 'Leider darfst du nicht abstimmen(ben�tige Gruppenberechttigung: poll-vote)',
 36+ 'poll-vote-right-error' => 'Leider darfst du nicht abstimmen(ben&ouml;tige Gruppenberechttigung: poll-vote)',
3437 'poll-vote-block-error' => 'Leider darfst du nicht abstimmen, weil du einen gesperten Benutzer benutzt',
 38+ 'poll-alternative' => 'Antwortm&ouml;glichkeit',
 39+ 'poll-question' => 'Frage',
 40+ 'poll-submit' => 'Absenden',
3541 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r50486r50481 Fix messagesjan14:55, 11 May 2009

Comments

#Comment by Raymond (talk | contribs)   14:27, 11 May 2009

1 Fixme:

Use UTF-8 for the messages. HTML entities are not necessary.

1 Suggestion:

Please consider to use the Xml::functions (Xml::openeElement(), Xml::closeElement(), Xml::input() etc) for input forms.

#Comment by Jan Luca (talk | contribs)   15:18, 11 May 2009

See r50488 for XML

Status & tagging log