Index: trunk/extensions/CategoryWatch/CategoryWatch.i18n.php |
— | — | @@ -15,10 +15,10 @@ |
16 | 16 | 'categorywatch-emailbody' => "Hi $1, you have received this message because you are watching the \"$2\" category. |
17 | 17 | This message is to notify you that at $3 user $4 $5.", |
18 | 18 | 'categorywatch-emailsubject' => "Activity involving watched category \"$1\"", |
19 | | - 'categorywatch-catmovein' => "moved $1 into category $2 from $3", |
20 | | - 'categorywatch-catmoveout' => "moved $1 out of category $2 into $3", |
21 | | - 'categorywatch-catadd' => "added $1 to category $2", |
22 | | - 'categorywatch-catsub' => "removed $1 from category $2", |
| 19 | + 'categorywatch-catmovein' => "moved [[$1]] into [[:Category:$2|category $2]] from [[:Category:$3|Category:$3]]", |
| 20 | + 'categorywatch-catmoveout' => "moved [[$1]] out of [[:Category:$2|Category:$2]] into [[:Category:$3|Category:$3]]", |
| 21 | + 'categorywatch-catadd' => "added [[$1]] to category $2", |
| 22 | + 'categorywatch-catsub' => "removed [[$1]] from category $2", |
23 | 23 | 'categorywatch-autocat' => "Automatically watched by $1", |
24 | 24 | ); |
25 | 25 | |
Index: trunk/extensions/CategoryWatch/CategoryWatch.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | |
17 | 17 | if ( !defined('MEDIAWIKI' ) ) die( 'Not an entry point.' ); |
18 | 18 | |
19 | | -define( 'CATEGORYWATCH_VERSION', '1.0.0, 2009-03-22' ); |
| 19 | +define( 'CATEGORYWATCH_VERSION', '1.1.0, 2009-04-21' ); |
20 | 20 | |
21 | 21 | $wgCategoryWatchNotifyEditor = true; |
22 | 22 | $wgCategoryWatchUseAutoCat = false; |
— | — | @@ -106,9 +106,9 @@ |
107 | 107 | $message = wfMsg( 'categorywatch-catmovein', $page, $add, $sub ); |
108 | 108 | $this->notifyWatchers( $title, $user, $message ); |
109 | 109 | |
110 | | - $title = Title::newFromText( $sub, NS_CATEGORY ); |
111 | | - $message = wfMsg( 'categorywatch-catmoveout', $page, $sub, $add ); |
112 | | - $this->notifyWatchers( $title, $user, $message ); |
| 110 | + #$title = Title::newFromText( $sub, NS_CATEGORY ); |
| 111 | + #$message = wfMsg( 'categorywatch-catmoveout', $page, $sub, $add ); |
| 112 | + #$this->notifyWatchers( $title, $user, $message ); |
113 | 113 | } |
114 | 114 | else { |
115 | 115 | |
— | — | @@ -118,11 +118,11 @@ |
119 | 119 | $this->notifyWatchers( $title, $user, $message ); |
120 | 120 | } |
121 | 121 | |
122 | | - foreach ( $sub as $cat ) { |
123 | | - $title = Title::newFromText( $cat, NS_CATEGORY ); |
124 | | - $message = wfMsg( 'categorywatch-catsub', $page, $cat ); |
125 | | - $this->notifyWatchers( $title, $user, $message ); |
126 | | - } |
| 122 | + #foreach ( $sub as $cat ) { |
| 123 | + # $title = Title::newFromText( $cat, NS_CATEGORY ); |
| 124 | + # $message = wfMsg( 'categorywatch-catsub', $page, $cat ); |
| 125 | + # $this->notifyWatchers( $title, $user, $message ); |
| 126 | + #} |
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
— | — | @@ -145,6 +145,7 @@ |
146 | 146 | foreach ( $res as $row ) { |
147 | 147 | $watchingUser = User::newFromId( $row->wl_user ); |
148 | 148 | if ( $watchingUser->getOption( 'enotifwatchlistpages' ) && $watchingUser->isEmailConfirmed() ) { |
| 149 | + |
149 | 150 | $to = new MailAddress( $watchingUser ); |
150 | 151 | $timecorrection = $watchingUser->getOption( 'timecorrection' ); |
151 | 152 | $editdate = $wgLang->timeanddate( wfTimestampNow(), true, false, $timecorrection ); |
— | — | @@ -160,6 +161,74 @@ |
161 | 162 | $editdat1, |
162 | 163 | $edittim2 |
163 | 164 | ); |
| 165 | + |
| 166 | + $subject = wfMsgForContent( 'enotif_subject' ); |
| 167 | + $body = wfMsgForContent( 'enotif_body' ); |
| 168 | + $keys = array(); |
| 169 | + |
| 170 | + if ( $this->oldid ) { |
| 171 | + $difflink = $this->title->getFullUrl( 'diff=0&oldid=' . $this->oldid ); |
| 172 | + $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastvisited', $difflink ); |
| 173 | + $keys['$OLDID'] = $this->oldid; |
| 174 | + $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'changed' ); |
| 175 | + } else { |
| 176 | + $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_newpagetext' ); |
| 177 | + # clear $OLDID placeholder in the message template |
| 178 | + $keys['$OLDID'] = ''; |
| 179 | + $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'created' ); |
| 180 | + } |
| 181 | + |
| 182 | + if ($wgEnotifImpersonal && $this->oldid) |
| 183 | + $keys['$NEWPAGE'] = wfMsgForContent( 'enotif_lastdiff', $this->title->getFullURL( "oldid={$this->oldid}&diff=prev" ) ); |
| 184 | + |
| 185 | + $body = strtr( $body, $keys ); |
| 186 | + $pagetitle = $this->title->getPrefixedText(); |
| 187 | + $keys['$PAGETITLE'] = $pagetitle; |
| 188 | + $keys['$PAGETITLE_URL'] = $this->title->getFullUrl(); |
| 189 | + |
| 190 | + $keys['$PAGEMINOREDIT'] = $medit; |
| 191 | + $keys['$PAGESUMMARY'] = $summary; |
| 192 | + |
| 193 | + $subject = strtr( $subject, $keys ); |
| 194 | + |
| 195 | + # Reveal the page editor's address as REPLY-TO address only if |
| 196 | + # the user has not opted-out and the option is enabled at the |
| 197 | + # global configuration level. |
| 198 | + $editor = $this->editor; |
| 199 | + $name = $wgEnotifUseRealName ? $editor->getRealName() : $editor->getName(); |
| 200 | + $adminAddress = new MailAddress( $wgPasswordSender, 'WikiAdmin' ); |
| 201 | + $editorAddress = new MailAddress( $editor ); |
| 202 | + if( $wgEnotifRevealEditorAddress |
| 203 | + && ( $editor->getEmail() != '' ) |
| 204 | + && $editor->getOption( 'enotifrevealaddr' ) ) { |
| 205 | + if( $wgEnotifFromEditor ) { |
| 206 | + $from = $editorAddress; |
| 207 | + } else { |
| 208 | + $from = $adminAddress; |
| 209 | + $replyto = $editorAddress; |
| 210 | + } |
| 211 | + } else { |
| 212 | + $from = $adminAddress; |
| 213 | + $replyto = new MailAddress( $wgNoReplyAddress ); |
| 214 | + } |
| 215 | + |
| 216 | + if( $editor->isIP( $name ) ) { |
| 217 | + #real anon (user:xxx.xxx.xxx.xxx) |
| 218 | + $utext = wfMsgForContent('enotif_anon_editor', $name); |
| 219 | + $subject = str_replace('$PAGEEDITOR', $utext, $subject); |
| 220 | + $keys['$PAGEEDITOR'] = $utext; |
| 221 | + $keys['$PAGEEDITOR_EMAIL'] = wfMsgForContent( 'noemailtitle' ); |
| 222 | + } else { |
| 223 | + $subject = str_replace('$PAGEEDITOR', $name, $subject); |
| 224 | + $keys['$PAGEEDITOR'] = $name; |
| 225 | + $emailPage = SpecialPage::getSafeTitleFor( 'Emailuser', $name ); |
| 226 | + $keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl(); |
| 227 | + } |
| 228 | + $userPage = $editor->getUserPage(); |
| 229 | + $keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl(); |
| 230 | + $body = strtr( $body, $keys ); |
| 231 | + $body = wordwrap( $body, 72 ); |
| 232 | + |
164 | 233 | if ( function_exists( 'userMailer' ) ) { |
165 | 234 | userMailer( |
166 | 235 | $to, |