Index: trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationTemplates.php |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | */ |
7 | 7 | class ArticleCreationTemplates { |
8 | 8 | |
9 | | - public static function getLandingPage() { |
| 9 | + public static function getLandingPage( $page ) { |
10 | 10 | $action = wfMessage( 'ac-action-indicator' )->escaped(); |
11 | 11 | |
12 | 12 | global $wgUser, $wgArticleCreationButtons; |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | $buttons = $wgArticleCreationButtons['logged-in']; |
19 | 19 | } |
20 | 20 | |
21 | | - $buttons = self::formatButtons( $buttons ); |
| 21 | + $buttons = self::formatButtons( $buttons, $page ); |
22 | 22 | |
23 | 23 | $html = <<<HTML |
24 | 24 | <span class="article-creation-heading">$action</span> |
— | — | @@ -29,21 +29,22 @@ |
30 | 30 | return $html; |
31 | 31 | } |
32 | 32 | |
33 | | - public static function formatButtons( $description ) { |
| 33 | + public static function formatButtons( $description, $page ) { |
34 | 34 | $buttons = ''; |
35 | 35 | |
36 | 36 | foreach ( $description as $button => $info ) { |
37 | 37 | $buttons .= self::formatButton( |
38 | 38 | $button, |
39 | 39 | wfMessage($info['title']), |
40 | | - wfMessage($info['text']) |
| 40 | + wfMessage($info['text']), |
| 41 | + $page |
41 | 42 | ); |
42 | 43 | } |
43 | 44 | |
44 | 45 | return $buttons; |
45 | 46 | } |
46 | 47 | |
47 | | - public static function formatButton( $button, $buttonTitle, $buttonText ) { |
| 48 | + public static function formatButton( $button, $buttonTitle, $buttonText, $page ) { |
48 | 49 | if ( $buttonTitle instanceof Message ) { |
49 | 50 | $buttonTitle = $buttonTitle->escaped(); |
50 | 51 | } |
— | — | @@ -52,11 +53,18 @@ |
53 | 54 | $buttonText = $buttonText->escaped(); |
54 | 55 | } |
55 | 56 | |
56 | | - global $wgArticleCreationConfig; |
| 57 | + global $wgArticleCreationConfig, $wgScript, $wgUser; |
57 | 58 | |
58 | | - //$target = htmlspecialchars( $wgArticleCreationConfig['action-url'][$button] ); |
59 | | - $target = '#'; |
| 59 | + $target = htmlspecialchars( $wgArticleCreationConfig['action-url'][$button] ); |
60 | 60 | |
| 61 | + $replacements = array( |
| 62 | + '{{SCRIPT}}' => $wgScript, |
| 63 | + '{{USER}}' => $wgUser, |
| 64 | + '{{PAGE}}' => $page, |
| 65 | + ); |
| 66 | + |
| 67 | + $target = strtr( $target, $replacements ); |
| 68 | + |
61 | 69 | return <<<HTML |
62 | 70 | <div class="ac-button-wrap"> |
63 | 71 | <a class="ac-article-button ac-button ac-button-blue ac-article-$button" data-ac-button="$button" href="$target"> |
Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js |
— | — | @@ -143,6 +143,7 @@ |
144 | 144 | .end() |
145 | 145 | .find('.ac-action-button') |
146 | 146 | .click( function(e) { |
| 147 | + e.preventDefault(); |
147 | 148 | ac.executeAction(button); |
148 | 149 | } ) |
149 | 150 | .end() |
Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.core/ext.articleCreation.core.css |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | .ac-button { |
23 | 23 | display: inline-block; |
24 | 24 | border-radius: 5px; |
25 | | - color: #FFFFFF; |
| 25 | + color: #FFFFFF !important; |
26 | 26 | padding: 5px 10px; |
27 | 27 | margin: 8px 0; |
28 | 28 | cursor: pointer; |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php |
— | — | @@ -112,6 +112,6 @@ |
113 | 113 | 'create' => '{{SCRIPT}}?title={{PAGE}}&action=edit', |
114 | 114 | 'login' => '{{SCRIPT}}?title=Special:Userlogin&returnto=Special:ArticleCreationLanding/{{PAGE}}', |
115 | 115 | 'signup' => '{{SCRIPT}}?title=Special:Userlogin/signup&returnto=Special:ArticleCreationLanding/{{PAGE}}', |
116 | | - 'request' => 'http://google.com/?q=dsa' |
| 116 | + 'request' => 'http://google.com/?q={{PAGE}}' |
117 | 117 | ) |
118 | 118 | ); |
Index: trunk/extensions/ArticleCreationWorkflow/SpecialArticleCreationLanding.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
34 | 34 | $wgOut->addModules( 'ext.articleCreation.core' ); |
35 | 35 | $wgOut->addModules( 'ext.articleCreation.user' ); |
36 | | - $wgOut->addHtml( ArticleCreationTemplates::getLandingPage() ); |
| 36 | + $wgOut->addHtml( ArticleCreationTemplates::getLandingPage($par) ); |
37 | 37 | } |
38 | 38 | |
39 | 39 | } |