r64897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64896‎ | r64897 | r64898 >
Date:19:33, 10 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
* Fixed i18n issues (follow up to r64798)
* Added state selection control on story edit form
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.i18n.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/Story/Story_body.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/Storyboard.i18n.php
@@ -20,33 +20,37 @@
2121 'right-storyreview' => 'Review, edit, publish, and hide stories',
2222 'specialpages-group-contribution' => 'Contribution',
2323
 24+ // Story states
 25+ 'storyboard-unpublished' => 'Unpublished',
 26+ 'storyboard-published' => 'Published',
 27+ 'storyboard-hidden' => 'Hidden',
 28+ 'storyboard-unpublish' => 'Unpublish',
 29+ 'storyboard-publish' => 'Publish',
 30+ 'storyboard-hide' => 'Hide',
 31+
2432 // Special:Story
2533 'story' => 'Story',
26 - 'storyboard-submittedbyon' => 'Submitted by $1 on $2.', // FIXME: split $2 in a para for date and time
 34+ 'storyboard-submittedbyon' => 'Submitted by $1 on $2, $3.',
2735 'storyboard-viewstories' => 'View stories',
2836 'storyboard-nosuchstory' => 'The story you requested does not exist.
2937 It might have been removed.',
30 - 'storyboard-unpublished' => 'The story you requested has not been published yet.',
 38+ 'storyboard-storyunpublished' => 'The story you requested has not been published yet.',
3139 'storyboard-nostorytitle' => 'You need to specify the title or id of the story you want to view.',
3240 'storyboard-cantedit' => 'You are not allowed to edit stories.',
3341 'storyboard-canedit' => 'You can $1 and publish this story.',
34 - 'storyboard-ispublished' => 'This story has been published and is publicly visible.',
35 - 'storyboard-ishidden' => 'This story has been hidden from the story review interface.',
36 - 'storyboard-createdandmodified' => 'Created on $1 and last modified on $2', // FIXME: split $2 in a para for date and time
 42+ 'storyboard-createdandmodified' => 'Created on $1, $2 and last modified on $3, $4',
3743 'storyboard-authorname' => 'Author name',
3844 'storyboard-authorlocation' => 'Author location',
3945 'storyboard-authoroccupation' => 'Author occupation',
4046 'storyboard-authoremail' => 'Author e-mail address',
4147 'storyboard-thestory' => 'The story',
 48+ 'storyboard-storystate' => 'Story state',
4249
4350 // Special:StorySubmission
4451 'storyboard-submissioncomplete' => 'Submission complete',
4552
4653 // Story review
47 - 'storyreview' => 'Story review',
48 - 'storyboard-publish' => 'Publish',
49 - 'storyboard-reviewed' => 'Reviewed',
50 - 'storyboard-unreviewed' => 'Unreviewed',
 54+ 'storyreview' => 'Story review',
5155 'storyboard-hideimage' => 'Hide image',
5256 'storyboard-unhideimage' => 'Show image',
5357 'storyboard-deleteimage' => 'Delete image',
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php
@@ -45,6 +45,7 @@
4646 $width = StoryboardUtils::getDimension( $args, 'width', $egStoryboardWidth );
4747 $height = StoryboardUtils::getDimension( $args, 'height', $egStoryboardHeight );
4848
 49+ // TODO: use this value in the js
4950 $languages = Language::getLanguageNames();
5051 if ( array_key_exists( 'language', $args ) && array_key_exists( $args['language'], $languages ) ) {
5152 $language = $args['language'];
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
@@ -48,7 +48,6 @@
4949 * @return HTML
5050 *
5151 * TODO: Fix the validation for the story title
52 - * TODO: use HTMLForm
5352 */
5453 private static function getFrom( Parser $parser, array $args ) {
5554 global $wgUser, $wgStyleVersion, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen;
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php
@@ -116,7 +116,7 @@
117117 $this->showStory( $story );
118118 }
119119 elseif ( !$isEdit ) {
120 - $wgOut->addWikiMsg( 'storyboard-unpublished' );
 120+ $wgOut->addWikiMsg( 'storyboard-storyunpublished' );
121121
122122 if ( $wgUser->isAllowed( 'storyreview' ) ) {
123123 global $wgTitle;
@@ -169,7 +169,8 @@
170170 'storyboard-submittedbyon',
171171 'parsemag',
172172 $story->story_author_name,
173 - $wgLang->timeanddate( $story->story_created )
 173+ $wgLang->time( $story->story_created ),
 174+ $wgLang->date( $story->story_created )
174175 ) )
175176 );
176177
@@ -190,10 +191,10 @@
191192 * @param $story
192193 *
193194 * TODO: Fix the validation for the story title
194 - * TODO: use HTMLForm
195195 */
196196 private function showStoryForm( $story ) {
197 - global $wgOut, $wgLang, $wgRequest, $wgUser, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen;
 197+ global $wgOut, $wgLang, $wgRequest, $wgUser, $wgJsMimeType;
 198+ global $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen;
198199
199200 $wgOut->setPageTitle( $story->story_title );
200201
@@ -214,7 +215,24 @@
215216
216217 $formBody = "<table width='$width'>";
217218
 219+ // The current value will be selected on page load with jQuery.
218220 $formBody .= '<tr>' .
 221+ '<td width="100%"><label for="storystate">' .
 222+ htmlspecialchars( wfMsg( 'storyboard-storystate' ) ) .
 223+ '</label></td><td>' .
 224+ Html::rawElement(
 225+ 'select',
 226+ array(
 227+ 'name' => 'storystate',
 228+ 'id' => 'storystate'
 229+ ),
 230+ '<option value="' . Storyboard_STORY_UNPUBLISHED . '">' . wfMsg( 'storyboard-unpublished' ) . '</option>' .
 231+ '<option value="' . Storyboard_STORY_PUBLISHED . '">' . wfMsg( 'storyboard-published' ) . '</option>' .
 232+ '<option value="' . Storyboard_STORY_HIDDEN . '">' . wfMsg( 'storyboard-hidden' ) . '</option>'
 233+ ) .
 234+ '</td></tr>';
 235+
 236+ $formBody .= '<tr>' .
219237 Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-authorname' ) ) .
220238 '<td>' .
221239 Html::input(
@@ -305,15 +323,15 @@
306324 $story->story_text
307325 ) .
308326 '</td></tr>';
309 -
310 - // TODO: fix this to work with new state field
311 - $checked = $story->story_state = Storyboard_STORY_PUBLISHED ? 'checked ' : '';
312 - $formBody .= '<tr><td colspan="2"><input type="checkbox" name="published" ' . $checked . '/>&nbsp;' .
313 - htmlspecialchars( wfMsg( 'storyboard-ispublished' ) ) .
314 - '</td></tr>';
 327+
 328+ $cancelLink = $wgUser->getSkin()->makeKnownLink(
 329+ $this->getTitle( $story->story_title )->getPrefixedText(),
 330+ wfMsgExt( 'cancel', array('parseinline') )
 331+ );
315332
316333 $formBody .= '<tr><td colspan="2">' .
317334 Html::input( '', wfMsg( 'htmlform-submit' ), 'submit', array( 'id' => 'storysubmission-button' ) ) .
 335+ "&nbsp;&nbsp;<span class='editHelp'>$cancelLink</span>" .
318336 '</td></tr>';
319337
320338 $formBody .= '</table>';
@@ -325,11 +343,13 @@
326344 htmlspecialchars( wfMsgExt(
327345 'storyboard-createdandmodified',
328346 'parsemag',
329 - $wgLang->timeanddate( $story->story_created ),
330 - $wgLang->timeanddate( $story->story_modified )
 347+ $wgLang->time( $story->story_created ),
 348+ $wgLang->date( $story->story_created ),
 349+ $wgLang->time( $story->story_modified ),
 350+ $wgLang->date( $story->story_modified )
331351 ) ) .
332352 '</legend>' . $formBody . '</fieldset>';
333 -
 353+
334354 $query = "id=$story->story_id";
335355
336356 $returnTo = $wgRequest->getVal( 'returnto' );
@@ -349,6 +369,10 @@
350370 $wgOut->addHTML( $formBody );
351371
352372 $wgOut->addInlineScript( <<<EOT
 373+jQuery(document).ready(function() {
 374+ jQuery("#storystate option[value='$story->story_state']").attr('selected', 'selected');
 375+});
 376+
353377 addOnloadHook(
354378 function() {
355379 stbValidateStory( document.getElementById('storytext'), $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' )
@@ -398,7 +422,7 @@
399423 'story_title' => $wgRequest->getText( 'storytitle' ),
400424 'story_text' => $wgRequest->getText( 'storytext' ),
401425 'story_modified' => $dbw->timestamp( time() ),
402 - 'story_state' => $wgRequest->getIntOrNull( 'state' ),
 426+ 'story_state' => $wgRequest->getIntOrNull( 'storystate' ),
403427 ),
404428 array(
405429 'story_id' => $wgRequest->getText( 'storyId' ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64798L10n updates to source messages, i18n FIXMEs.siebrand13:06, 9 April 2010

Status & tagging log