Index: trunk/extensions/Storyboard/specials/Story/Story_body.php |
— | — | @@ -90,7 +90,8 @@ |
91 | 91 | 'story_text', |
92 | 92 | 'story_created', |
93 | 93 | 'story_modified', |
94 | | - 'story_state' |
| 94 | + 'story_state', |
| 95 | + 'story_lang_code', |
95 | 96 | ), |
96 | 97 | array( 'story_title' => $title ) |
97 | 98 | ); |
— | — | @@ -116,6 +117,7 @@ |
117 | 118 | elseif ( !$isEdit ) { |
118 | 119 | $wgOut->addWikiMsg( 'storyboard-storyunpublished' ); |
119 | 120 | |
| 121 | + // FIXME: subpage in link broken |
120 | 122 | if ( $wgUser->isAllowed( 'storyreview' ) ) { |
121 | 123 | global $wgTitle; |
122 | 124 | $wgOut->addWikiMsg( |
— | — | @@ -217,13 +219,33 @@ |
218 | 220 | 'name' => 'storystate', |
219 | 221 | 'id' => 'storystate' |
220 | 222 | ), |
221 | | - '<option value="' . Storyboard_STORY_UNPUBLISHED . '">' . wfMsg( 'storyboard-option-unpublished' ) . '</option>' . |
222 | | - '<option value="' . Storyboard_STORY_PUBLISHED . '">' . wfMsg( 'storyboard-option-published' ) . '</option>' . |
223 | | - '<option value="' . Storyboard_STORY_HIDDEN . '">' . wfMsg( 'storyboard-option-hidden' ) . '</option>' |
| 223 | + '<option value="' . Storyboard_STORY_UNPUBLISHED . '">' . htmlspecialchars( wfMsg( 'storyboard-option-unpublished' ) ) . '</option>' . |
| 224 | + '<option value="' . Storyboard_STORY_PUBLISHED . '">' . htmlspecialchars( wfMsg( 'storyboard-option-published' ) ) . '</option>' . |
| 225 | + '<option value="' . Storyboard_STORY_HIDDEN . '">' . htmlspecialchars( wfMsg( 'storyboard-option-hidden' ) ) . '</option>' |
224 | 226 | ) . |
225 | 227 | '</td></tr>'; |
226 | 228 | |
| 229 | + $languages = Language::getLanguageNames( false ); |
| 230 | + ksort( $languages ); |
| 231 | + |
| 232 | + $options = array(); |
| 233 | + foreach ( $languages as $code => $name ) { |
| 234 | + $display = wfBCP47( $code ) . ' - ' . $name; |
| 235 | + $options[$display] = $code; |
| 236 | + } |
| 237 | + |
| 238 | + $languageSelector = new HTMLSelectField( array( |
| 239 | + 'name' => 'language', |
| 240 | + 'options' => $options |
| 241 | + ) ); |
| 242 | + |
227 | 243 | $formBody .= '<tr>' . |
| 244 | + Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-language' ) ) . |
| 245 | + '<td>' . |
| 246 | + $languageSelector->getInputHTML( $story->story_lang_code ) . |
| 247 | + '</td></tr>'; |
| 248 | + |
| 249 | + $formBody .= '<tr>' . |
228 | 250 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-authorname' ) ) . |
229 | 251 | '<td>' . |
230 | 252 | Html::input( |
— | — | @@ -404,6 +426,7 @@ |
405 | 427 | 'story_text' => $wgRequest->getText( 'storytext' ), |
406 | 428 | 'story_modified' => $dbw->timestamp( time() ), |
407 | 429 | 'story_state' => $wgRequest->getIntOrNull( 'storystate' ), |
| 430 | + 'story_lang_code' => $wgRequest->getText( 'wplanguage' ) |
408 | 431 | ), |
409 | 432 | array( |
410 | 433 | 'story_id' => $wgRequest->getText( 'storyId' ), |