Index: trunk/extensions/CategoryWatch/CategoryWatch.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | /** |
82 | 82 | * Find changes in categorisation and send messages to watching users |
83 | 83 | */ |
84 | | - function onArticleSaveComplete( &$article, &$user, &$text ) { |
| 84 | + function onArticleSaveComplete( &$article, &$user, &$text, &$summary, &$medit, ) { |
85 | 85 | |
86 | 86 | # Get cats after update |
87 | 87 | $this->after = array(); |
— | — | @@ -102,31 +102,31 @@ |
103 | 103 | $pagename = $page->getPrefixedText(); |
104 | 104 | $pageurl = $page->getFullUrl(); |
105 | 105 | $page = "$pagename ($pageurl)"; |
106 | | - |
| 106 | + |
107 | 107 | if ( count( $add ) == 1 && count( $sub ) == 1 ) { |
108 | 108 | $add = array_shift( $add ); |
109 | 109 | $sub = array_shift( $sub ); |
110 | 110 | |
111 | 111 | $title = Title::newFromText( $add, NS_CATEGORY ); |
112 | 112 | $message = wfMsg( 'categorywatch-catmovein', $page, $this->friendlyCat( $add ), $this->friendlyCat( $sub ) ); |
113 | | - $this->notifyWatchers( $title, $user, $message ); |
| 113 | + $this->notifyWatchers( $title, $user, $message, $summary, $medit ); |
114 | 114 | |
115 | 115 | #$title = Title::newFromText( $sub, NS_CATEGORY ); |
116 | 116 | #$message = wfMsg( 'categorywatch-catmoveout', $page, $this->friendlyCat( $sub ), $this->friendlyCat( $add ) ); |
117 | | - #$this->notifyWatchers( $title, $user, $message ); |
| 117 | + #$this->notifyWatchers( $title, $user, $message, $summary, $medit ); |
118 | 118 | } |
119 | 119 | else { |
120 | 120 | |
121 | 121 | foreach ( $add as $cat ) { |
122 | 122 | $title = Title::newFromText( $cat, NS_CATEGORY ); |
123 | 123 | $message = wfMsg( 'categorywatch-catadd', $page, $this->friendlyCat( $cat ) ); |
124 | | - $this->notifyWatchers( $title, $user, $message ); |
| 124 | + $this->notifyWatchers( $title, $user, $message, $summary, $medit ); |
125 | 125 | } |
126 | 126 | |
127 | 127 | #foreach ( $sub as $cat ) { |
128 | 128 | # $title = Title::newFromText( $cat, NS_CATEGORY ); |
129 | 129 | # $message = wfMsg( 'categorywatch-catsub', $page, $this->friendlyCat( $cat ) ); |
130 | | - # $this->notifyWatchers( $title, $user, $message ); |
| 130 | + # $this->notifyWatchers( $title, $user, $message, $summary, $medit ); |
131 | 131 | #} |
132 | 132 | } |
133 | 133 | } |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | return "$catname ($caturl)"; |
146 | 146 | } |
147 | 147 | |
148 | | - function notifyWatchers( &$title, &$editor, &$message ) { |
| 148 | + function notifyWatchers( &$title, &$editor, &$message, &$summary, &$medit ) { |
149 | 149 | global $wgLang, $wgEmergencyContact, $wgNoReplyAddress, $wgCategoryWatchNotifyEditor, |
150 | 150 | $wgEnotifRevealEditorAddress, $wgEnotifUseRealName, $wgPasswordSender, $wgEnotifFromEditor; |
151 | 151 | |
— | — | @@ -158,6 +158,8 @@ |
159 | 159 | $page = $title->getPrefixedText(); |
160 | 160 | $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' ); |
161 | 161 | $editorAddress = new MailAddress( $editor ); |
| 162 | + $summary = $summary ? $summary : ' - '; |
| 163 | + $medit = $medit ? wfMsg( 'minoredit' ) : ''; |
162 | 164 | while ( $row = $dbr->fetchRow( $res ) ) { |
163 | 165 | $watchingUser = User::newFromId( $row[0] ); |
164 | 166 | $timecorrection = $watchingUser->getOption( 'timecorrection' ); |
— | — | @@ -196,8 +198,9 @@ |
197 | 199 | '$CHANGEDORCREATED' => wfMsgForContent( 'changed' ), |
198 | 200 | '$PAGETITLE_URL' => $title->getFullUrl(), |
199 | 201 | '$PAGEEDITOR_WIKI' => $userPage->getFullUrl(), |
200 | | - '$OLDID' => '', |
201 | | - '$PAGEMINOREDIT' => '' |
| 202 | + '$PAGESUMMARY' => $summary, |
| 203 | + '$PAGEMINOREDIT' => $medit, |
| 204 | + '$OLDID' => '' |
202 | 205 | ); |
203 | 206 | if ( $editor->isIP( $name ) ) { |
204 | 207 | $utext = wfMsgForContent( 'enotif_anon_editor', $name ); |