Index: trunk/extensions/Storyboard/storyboard.js |
— | — | @@ -213,10 +213,30 @@ |
214 | 214 | |
215 | 215 | // TODO: add review controls |
216 | 216 | |
217 | | - $storyBody.append( |
218 | | - jQuery( "<div />" ).append( jQuery( "<button />" ).text( "edit" ).attr( "onclick", "window.location='" + story.modifyurl + "'" ) ) |
219 | | - ); |
| 217 | + var controlDiv = jQuery( "<div />" ); |
220 | 218 | |
| 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 | + |
221 | 241 | $storyboard.append( $storyBody ); |
222 | 242 | } |
223 | 243 | } |
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php |
— | — | @@ -134,13 +134,15 @@ |
135 | 135 | 'location' => $story->story_author_location, |
136 | 136 | 'imageurl' => $story->story_author_image, |
137 | 137 | 'imagehidden' => $story->story_image_hidden, |
138 | | - 'permalink' => SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL() |
| 138 | + 'permalink' => SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL(), |
139 | 139 | ); |
140 | 140 | |
141 | 141 | if ( $isReview ) { |
142 | 142 | $result['modifyurl'] = SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL( |
143 | 143 | 'action=edit&returnto=' . SpecialPage::getTitleFor( 'storyreview' )->getPrefixedText() |
144 | 144 | ); |
| 145 | + |
| 146 | + $result['state'] = (int)$params['state']; |
145 | 147 | } |
146 | 148 | |
147 | 149 | ApiResult::setContent( $result, ( is_null( $story->story_text ) ? '' : $story->story_text ) ); |
Index: trunk/extensions/Storyboard/Storyboard.php |
— | — | @@ -150,6 +150,10 @@ |
151 | 151 | 'storyboard-hideimage', |
152 | 152 | 'storyboard-imagedeletionconfirm', |
153 | 153 | 'storyboard-alreadyexistschange', |
| 154 | + 'edit', |
| 155 | + 'storyboard-unpublish', |
| 156 | + 'storyboard-publish', |
| 157 | + 'storyboard-hide', |
154 | 158 | ); |
155 | 159 | |
156 | 160 | $data = array(); |