r66101 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66100‎ | r66101 | r66102 >
Date:13:22, 9 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Re-added state changing controls to storyreview
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)
  • /trunk/extensions/Storyboard/api/ApiQueryStories.php (modified) (history)
  • /trunk/extensions/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/storyboard.js
@@ -213,10 +213,30 @@
214214
215215 // TODO: add review controls
216216
217 - $storyBody.append(
218 - jQuery( "<div />" ).append( jQuery( "<button />" ).text( "edit" ).attr( "onclick", "window.location='" + story.modifyurl + "'" ) )
219 - );
 217+ var controlDiv = jQuery( "<div />" );
220218
 219+ if ( story.state != 0 ) {
 220+ controlDiv.append(
 221+ jQuery( "<button />" ).text( stbMsg( "storyboard-unpublish" ) )
 222+ );
 223+ }
 224+
 225+ if ( story.state != 1 ) {
 226+ controlDiv.append(
 227+ jQuery( "<button />" ).text( stbMsg( "storyboard-publish" ) )
 228+ );
 229+ }
 230+
 231+ if ( story.state != 2 ) {
 232+ controlDiv.append(
 233+ jQuery( "<button />" ).text( stbMsg( "storyboard-hide" ) )
 234+ );
 235+ }
 236+
 237+ controlDiv.append( jQuery( "<button />" ).text( stbMsg( "edit" ) ).attr( "onclick", "window.location='" + story.modifyurl + "'" ) );
 238+
 239+ $storyBody.append( controlDiv );
 240+
221241 $storyboard.append( $storyBody );
222242 }
223243 }
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php
@@ -134,13 +134,15 @@
135135 'location' => $story->story_author_location,
136136 'imageurl' => $story->story_author_image,
137137 'imagehidden' => $story->story_image_hidden,
138 - 'permalink' => SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL()
 138+ 'permalink' => SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL(),
139139 );
140140
141141 if ( $isReview ) {
142142 $result['modifyurl'] = SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL(
143143 'action=edit&returnto=' . SpecialPage::getTitleFor( 'storyreview' )->getPrefixedText()
144144 );
 145+
 146+ $result['state'] = (int)$params['state'];
145147 }
146148
147149 ApiResult::setContent( $result, ( is_null( $story->story_text ) ? '' : $story->story_text ) );
Index: trunk/extensions/Storyboard/Storyboard.php
@@ -150,6 +150,10 @@
151151 'storyboard-hideimage',
152152 'storyboard-imagedeletionconfirm',
153153 'storyboard-alreadyexistschange',
 154+ 'edit',
 155+ 'storyboard-unpublish',
 156+ 'storyboard-publish',
 157+ 'storyboard-hide',
154158 );
155159
156160 $data = array();

Status & tagging log