Index: trunk/extensions/Checkpoint/Checkpoint.i18n.php |
— | — | @@ -1,4 +1,9 @@ |
2 | 2 | <?php |
| 3 | +/** |
| 4 | + * Internationalisation file for Checkpoint extension. |
| 5 | + * |
| 6 | + * @addtogroup Extensions |
| 7 | + */ |
3 | 8 | |
4 | 9 | $messages = array(); |
5 | 10 | |
— | — | @@ -7,4 +12,4 @@ |
8 | 13 | 'checkpoint-desc' => 'Allows one to save an edit and continue editing', |
9 | 14 | 'checkpoint-tooltip' => 'Save your progress and continue editing the page', |
10 | 15 | 'checkpoint-notice' => '([[{{ns:project}}:Checkpoint|checkpoint save]])', |
11 | | -); |
\ No newline at end of file |
| 16 | +); |
Index: trunk/extensions/Checkpoint/Checkpoint.php |
— | — | @@ -1,14 +1,13 @@ |
2 | 2 | <?php |
3 | | - |
4 | 3 | /** |
5 | 4 | * Checkpoint extension by Skizzerz, from a request on IRC |
6 | | - * It would be nice if this was in core and not an extension, |
7 | | - * but having an extension is good for testing purposes, etc. before implementation |
8 | | -*/ |
| 5 | + * It would be nice if this was in core and not an extension, but having an |
| 6 | + * extension is good for testing purposes, etc. before implementation |
| 7 | + */ |
9 | 8 | |
10 | | -if(!defined('MEDIAWIKI')) { |
| 9 | +if ( !defined( 'MEDIAWIKI' ) ) { |
11 | 10 | echo "This is an extension to the MediaWiki software and cannot be used standalone"; |
12 | | - die(1); |
| 11 | + die( 1 ); |
13 | 12 | } |
14 | 13 | |
15 | 14 | $wgExtensionCredits['other'][] = array( |
— | — | @@ -20,51 +19,54 @@ |
21 | 20 | 'version' => '0.1', |
22 | 21 | ); |
23 | 22 | |
24 | | -$wgExtensionMessagesFiles['Checkpoint'] = dirname(__FILE__) . '/Checkpoint.i18n.php'; |
| 23 | +$wgExtensionMessagesFiles['Checkpoint'] = dirname( __FILE__ ) . '/Checkpoint.i18n.php'; |
25 | 24 | |
26 | 25 | $wgHooks['EditPageBeforeEditButtons'][] = 'efCheckpointButton'; |
27 | 26 | $wgHooks['ArticleSave'][] = 'efCheckpointSave'; |
28 | 27 | $wgHooks['GetFullURL'][] = 'efCheckpointReturn'; |
29 | 28 | |
30 | | -function efCheckpointButton(&$editpage, &$buttons) { |
31 | | - wfLoadExtensionMessages('Checkpoint'); |
| 29 | +function efCheckpointButton( &$editpage, &$buttons ) { |
| 30 | + wfLoadExtensionMessages( 'Checkpoint' ); |
32 | 31 | $attr = array( |
33 | 32 | 'id' => 'wpCheckpoint', |
34 | 33 | 'name' => 'wpCheckpoint', |
35 | 34 | 'type' => 'submit', |
36 | | - 'value' => wfMsg('checkpoint'), |
37 | | - 'title' => wfMsg('checkpoint-tooltip'), |
| 35 | + 'value' => wfMsg( 'checkpoint' ), |
| 36 | + 'title' => wfMsg( 'checkpoint-tooltip' ), |
38 | 37 | ); |
39 | | - $buttons['checkpoint'] = Xml::element('input', $attr, ''); |
| 38 | + $buttons['checkpoint'] = Xml::element( 'input', $attr, '' ); |
40 | 39 | return true; |
41 | 40 | } |
42 | 41 | |
43 | | -function efCheckpointSave($article, $user, $text, &$summary, $minor, $watch, $sectionanchor, $flags) { |
| 42 | +function efCheckpointSave( $article, $user, $text, &$summary, $minor, $watch, $sectionanchor, $flags ) { |
44 | 43 | global $wgRequest; |
45 | | - wfLoadExtensionMessages('Checkpoint'); |
46 | | - if( $wgRequest->getCheck('wpCheckpoint') ) { |
47 | | - if($summary == '') { |
48 | | - //blank summary, so let's get an automatic one if applicable (the appending bit prevents autosummaries from appearing otherwise). |
| 44 | + |
| 45 | + wfLoadExtensionMessages( 'Checkpoint' ); |
| 46 | + if ( $wgRequest->getCheck( 'wpCheckpoint' ) ) { |
| 47 | + if ( $summary == '' ) { |
| 48 | + // blank summary, so let's get an automatic one if |
| 49 | + // applicable (the appending bit prevents autosummaries |
| 50 | + // from appearing otherwise). |
49 | 51 | $oldtext = $article->fetchContent(); |
50 | | - $summary = $article->getAutosummary($oldtext, $text, $flags); |
| 52 | + $summary = $article->getAutosummary( $oldtext, $text, $flags ); |
51 | 53 | } |
52 | | - $summary .= ' ' . wfMsg('checkpoint-notice'); |
53 | | - |
| 54 | + $summary .= wfMsg( 'word-separator' ) . wfMsg( 'checkpoint-notice' ); |
54 | 55 | } |
55 | 56 | return true; |
56 | 57 | } |
57 | 58 | |
58 | | -function efCheckpointReturn($title, &$url, $query) { |
| 59 | +function efCheckpointReturn( $title, &$url, $query ) { |
59 | 60 | global $wgRequest; |
60 | | - if( $wgRequest->wasPosted() && $wgRequest->getCheck('wpCheckpoint') ) { |
| 61 | + |
| 62 | + if ( $wgRequest->wasPosted() && $wgRequest->getCheck( 'wpCheckpoint' ) ) { |
61 | 63 | $frag = $title->getFragmentForURL(); |
62 | | - $querystr = strpos($url, '?') ? '&' : '?'; //see if we need to append a ? or a & |
63 | | - if($frag == '') { |
64 | | - //just append our query to the end |
| 64 | + $querystr = strpos( $url, '?' ) ? '&' : '?'; // see if we need to append a ? or a & |
| 65 | + if ( $frag == '' ) { |
| 66 | + // just append our query to the end |
65 | 67 | $url .= $querystr . 'action=edit&preview=yes'; |
66 | 68 | } else { |
67 | | - //do a string replace |
68 | | - $url = str_replace($frag, $querystr . 'action=edit&preview=yes' . $frag, $url); |
| 69 | + // do a string replace |
| 70 | + $url = str_replace( $frag, $querystr . 'action=edit&preview=yes' . $frag, $url ); |
69 | 71 | } |
70 | 72 | } |
71 | 73 | return true; |
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt |
— | — | @@ -115,7 +115,10 @@ |
116 | 116 | ignored = changeauthor-logpagetext, changeauthor-short |
117 | 117 | |
118 | 118 | Char Insert |
| 119 | +#magicfile = CharInsert/CharInsert.i18n.magic.php |
119 | 120 | |
| 121 | +Checkpoint |
| 122 | + |
120 | 123 | Check User |
121 | 124 | aliasfile = CheckUser/CheckUser.alias.php |
122 | 125 | ignored = checkuser-toollinks |