Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | 'style' => "height: $height; width: $width;" |
39 | 39 | ) |
40 | 40 | ); |
41 | | - return array( $output, 'noparse' => 'true', 'isHTML' => 'true' ); |
| 41 | + return array( $output, 'noparse' => true, 'isHTML' => true ); |
42 | 42 | } |
43 | 43 | |
44 | 44 | } |
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | $output = self::getFrom( $parser, $args ); |
31 | 31 | } |
32 | 32 | |
33 | | - return $output; |
| 33 | + return array( $output, 'noparse' => true, 'isHTML' => true ); |
34 | 34 | |
35 | 35 | wfProfileOut( __METHOD__ ); |
36 | 36 | } |
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php |
— | — | @@ -28,6 +28,12 @@ |
29 | 29 | if ( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
30 | 30 | if ( $wgUser->isAllowed( 'storyreview' ) ) { |
31 | 31 | $this->saveStory(); |
| 32 | + |
| 33 | + // Redirect the user when the redirect parameter is set. |
| 34 | + if ( $wgRequest->getVal( 'returnto' ) ) { |
| 35 | + $titleObj = Title::newFromText( $wgRequest->getVal( 'returnto' ) ); |
| 36 | + $wgOut->redirect( $titleObj->getFullURL() ); |
| 37 | + } |
32 | 38 | } else { |
33 | 39 | $wgOut->addWikiMsg( 'storyboard-cantedit' ); |
34 | 40 | } |
— | — | @@ -98,13 +104,15 @@ |
99 | 105 | $wgOut->addWikiMsg( 'storyboard-unpublished' ); |
100 | 106 | |
101 | 107 | if ( $wgUser->isAllowed( 'storyreview' ) ) { |
102 | | - global $wgParser; |
103 | | - |
104 | | - $wgOut->addWikiMsgArray( |
105 | | - //$wgParser->recursiveTagParse( |
| 108 | + global $wgTitle; |
| 109 | + $wgOut->addHTML( // TODO: this still isn't working properly |
| 110 | + wfMsgHtml( |
106 | 111 | 'storyboard-canedit', |
107 | | - $this->getTitle()->getLocalURL( 'action=edit' ) |
108 | | - //) |
| 112 | + $wgUser->getSkin()->link( |
| 113 | + $wgTitle, |
| 114 | + strtolower( wfMsg( 'edit' ) ) |
| 115 | + ) |
| 116 | + ) |
109 | 117 | ); |
110 | 118 | } |
111 | 119 | } |
— | — | @@ -222,13 +230,16 @@ |
223 | 231 | $formBody .= Html::hidden( 'wpEditToken', $wgUser->editToken() ); |
224 | 232 | $formBody .= Html::hidden( 'storyId', $story->story_id ); |
225 | 233 | |
| 234 | + $returnToQuery = $wgRequest->getVal( 'returnto' ); |
| 235 | + if ( $returnToQuery ) $returnToQuery = 'returnto=' . $returnToQuery; |
| 236 | + |
226 | 237 | $formBody = Html::rawElement( |
227 | 238 | 'form', |
228 | 239 | array( |
229 | 240 | 'id' => 'storyform', |
230 | 241 | 'name' => 'storyform', |
231 | 242 | 'method' => 'post', |
232 | | - 'action' => $this->getTitle( $story->story_title )->getLocalURL(), |
| 243 | + 'action' => $this->getTitle( $story->story_title )->getLocalURL( $returnToQuery ), |
233 | 244 | ), |
234 | 245 | $formBody |
235 | 246 | ); |
Index: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php |
— | — | @@ -114,7 +114,8 @@ |
115 | 115 | $deleteImageMsg = htmlspecialchars( wfMsg( 'storyboard-deleteimage' ) ); |
116 | 116 | |
117 | 117 | // TODO: add some returnto feature here |
118 | | - $editUrl = SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL('action=edit'); |
| 118 | + global $wgTitle; |
| 119 | + $editUrl = SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL('action=edit&returnto=' . $wgTitle->getPrefixedText() ); |
119 | 120 | $editUrl = Xml::escapeJsString( $editUrl ); |
120 | 121 | |
121 | 122 | return <<<EOT |
Index: trunk/extensions/Storyboard/Storyboard.php |
— | — | @@ -59,7 +59,8 @@ |
60 | 60 | // Hooks |
61 | 61 | $wgHooks['ParserFirstCallInit'][] = 'efStoryboardParserFirstCallInit'; |
62 | 62 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efStoryboardSchemaUpdate'; |
63 | | -$wgHooks['SkinTemplateContentActions'][] = 'efStoryboardAddStoryEditAction'; |
| 63 | +$wgHooks['SkinTemplateTabs'][] = 'efStoryboardAddStoryEditAction'; |
| 64 | +$wgHooks['SkinTemplateNavigation'][] = 'efStoryboardAddStoryEditActionVector'; |
64 | 65 | |
65 | 66 | |
66 | 67 | /** |
— | — | @@ -97,10 +98,17 @@ |
98 | 99 | return true; |
99 | 100 | } |
100 | 101 | |
101 | | -function efStoryboardAddStoryEditAction( &$content_actions ) { |
102 | | - // TODO: currently not having any affect on Special:Story for some reason |
| 102 | +function efStoryboardAddStoryEditActionVector( &$sktemplate, &$links ) { |
| 103 | + $views_links = $links['views']; |
| 104 | + efStoryboardAddStoryEditAction( $sktemplate, $views_links ); |
| 105 | + $links['views'] = $views_links; |
| 106 | + |
| 107 | + return true; |
| 108 | +} |
| 109 | + |
| 110 | +function efStoryboardAddStoryEditAction( &$sktemplate, &$content_actions ) { |
103 | 111 | global $wgRequest, $wgRequest, $wgTitle; |
104 | | - |
| 112 | + |
105 | 113 | $action = $wgRequest->getText( 'action' ); |
106 | 114 | |
107 | 115 | if ( $wgTitle->equals( SpecialPage::getTitleFor( 'story' ) ) ) { |