r37729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37728‎ | r37729 | r37730 >
Date:22:27, 15 July 2008
Author:siebrand
Status:old
Tags:
Comment:
Recommit r37619, 37620 in <s>2</s> 3 goes, without phpMailer update.
* update files (renamed functions, etc)
* had to rename message 'emailarticle' to 'emailpages' because of conflict with core.
Modified paths:
  • /trunk/extensions/EmailPage/EmailPage.alias.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage.i18n.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage.php (modified) (history)
  • /trunk/extensions/EmailPage/EmailPage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EmailPage/EmailPage.alias.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Aliases for Special:EmailArticle
 4+ * Aliases for Special:EmailPage
55 *
66 * @addtogroup Extensions
77 */
@@ -11,50 +11,50 @@
1212 * @author Jon Harald Søby
1313 */
1414 $aliases['en'] = array(
15 - 'EmailArticle' => array( 'EmailArticle' ),
 15+ 'EmailPages' => array( 'EmailPages' ),
1616 );
1717
1818 /** Arabic (العربية) */
1919 $aliases['ar'] = array(
20 - 'EmailArticle' => array( 'مراسلة المقالة' ),
 20+ 'EmailPages' => array( 'مراسلة الصفحة' ),
2121 );
2222
2323 /** Egyptian Spoken Arabic (مصرى) */
2424 $aliases['arz'] = array(
25 - 'EmailArticle' => array( 'مراسلة المقالة' ),
 25+ 'EmailPages' => array( 'مراسلة المقالة' ),
2626 );
2727
2828 /** French (Français) */
2929 $aliases['fr'] = array(
30 - 'EmailArticle' => array( 'EnvoyerArticle', 'Envoyer Article', 'Envoyer l’article' ),
 30+ 'EmailPages' => array( 'EnvoyerPage', 'Envoyer Page' ),
3131 );
3232
3333 /** Hebrew (עברית)
3434 * @author Rotem Liss
3535 */
3636 $aliases['he'] = array(
37 - 'EmailArticle' => array( 'שליחת_דף_בדואר' ),
 37+ 'EmailPages' => array( 'שליחת_דף_בדואר' ),
3838 );
3939
4040 /** Haitian (Kreyòl ayisyen) */
4141 $aliases['ht'] = array(
42 - 'EmailArticle' => array( 'EmèlAtik' ),
 42+ 'EmailPages' => array( 'EmèlAtik' ),
4343 );
4444
4545 /** Hungarian (Magyar) */
4646 $aliases['hu'] = array(
47 - 'EmailArticle' => array( 'Szócikk elküldése e-mailben' ),
 47+ 'EmailPages' => array( 'Szócikk elküldése e-mailben' ),
4848 );
4949
5050 /** Dutch (Nederlands) */
5151 $aliases['nl'] = array(
52 - 'EmailArticle' => array( 'PaginaE-mailen', 'PaginaEmailen' ),
 52+ 'EmailPages' => array( 'PaginaE-mailen', 'PaginaEmailen' ),
5353 );
5454
5555 /** Norwegian (bokmål)‬ (‪Norsk (bokmål)‬)
5656 * @author Jon Harald Søby
5757 */
5858 $aliases['no'] = array(
59 - 'EmailArticle' => array( 'Send_side_som_e-post' ),
 59+ 'EmailPages' => array( 'Send_side_som_e-post' ),
6060 );
6161
Index: trunk/extensions/EmailPage/EmailPage_body.php
@@ -1,7 +1,7 @@
22 <?php
33 if (!defined('MEDIAWIKI')) die();
44
5 -class SpecialEmailArticle extends SpecialPage {
 5+class SpecialEmailPage extends SpecialPage {
66
77 var $recipients = array();
88 var $title;
@@ -14,56 +14,56 @@
1515 var $css;
1616
1717 public function __construct() {
18 - global $wgEmailArticleGroup;
19 - SpecialPage::SpecialPage('EmailArticle', $wgEmailArticleGroup);
 18+ global $wgEmailPageGroup;
 19+ SpecialPage::SpecialPage('EmailPages', $wgEmailPageGroup);
2020 }
2121
2222 /**
2323 * Override SpecialPage::execute($param = '')
2424 */
2525 function execute($param) {
26 - global $wgOut, $wgUser, $wgEmailArticleContactsCat, $wgGroupPermissions, $wgSitename, $wgEmailArticleCss, $wgEmailArticleAllowAllUsers;
 26+ global $wgOut, $wgUser, $wgEmailPageContactsCat, $wgGroupPermissions, $wgSitename, $wgEmailPageCss, $wgEmailPageAllowAllUsers;
2727 $db =& wfGetDB(DB_SLAVE);
2828 $param = str_replace('_', ' ', $param);
2929
30 - wfLoadExtensionMessages( 'EmailArticle' );
 30+ wfLoadExtensionMessages( 'EmailPage' );
3131
3232 $this->setHeaders();
3333
3434 # Get info from request or set to defaults
3535 $this->title = isset($_REQUEST['ea-title']) ? $_REQUEST['ea-title'] : $param;
36 - $this->subject = isset($_REQUEST['ea-subject']) ? $_REQUEST['ea-subject'] : '' . wfMsg('ea-articlesend', $this->title, $wgSitename );
 36+ $this->subject = isset($_REQUEST['ea-subject']) ? $_REQUEST['ea-subject'] : '' . wfMsg('ea-pagesend', $this->title, $wgSitename );
3737 $this->header = isset($_REQUEST['ea-header']) ? $_REQUEST['ea-header'] : '';
3838 $this->cat = isset($_REQUEST['ea-cat']) ? $_REQUEST['ea-cat'] : '';
3939 $this->group = isset($_REQUEST['ea-group']) ? $_REQUEST['ea-group'] : '';
4040 $this->list = isset($_REQUEST['ea-list']) ? $_REQUEST['ea-list'] : '';
4141 $this->textonly = isset($_REQUEST['ea-textonly']) ? $_REQUEST['ea-textonly'] : false;
42 - $this->css = isset($_REQUEST['ea-css']) ? $_REQUEST['ea-css'] : $wgEmailArticleCss;
 42+ $this->css = isset($_REQUEST['ea-css']) ? $_REQUEST['ea-css'] : $wgEmailPageCss;
4343
44 - # Bail if no article title to send has been specified
 44+ # Bail if no page title to send has been specified
4545 if ($this->title) $wgOut->addWikiText(wfMsg('ea-heading', $this->title));
46 - else return $wgOut->addWikiText(wfMsg('ea-noarticle'));
 46+ else return $wgOut->addWikiText(wfMsg('ea-nopage'));
4747
4848 # If the send button was clicked, attempt to send and exit
4949 if (isset($_REQUEST['ea-send'])) return $this->send();
5050
5151 # Render form
52 - $special = Title::makeTitle(NS_SPECIAL, 'EmailArticle');
 52+ $special = Title::makeTitle(NS_SPECIAL, 'EmailPage');
5353 $wgOut->addHTML(wfElement('form',array(
54 - 'class' => 'EmailArticle',
 54+ 'class' => 'EmailPage',
5555 'action' => $special->getLocalURL('action=submit'),
5656 'method' => 'POST'
5757 ),null));
5858 $wgOut->addHTML('<fieldset><legend>'.wfMsg('ea-selectrecipients').'</legend>');
5959 $wgOut->addHTML('<table style="padding:0;margin:0;border:none;">');
6060
61 - # If $wgEmailArticleContactsCat is set, create a select list of all categories
62 - if ($wgEmailArticleContactsCat) {
 61+ # If $wgEmailPageContactsCat is set, create a select list of all categories
 62+ if ($wgEmailPageContactsCat) {
6363 $cats = '';
6464 $result = $db->select(
6565 'categorylinks',
6666 'cl_from',
67 - 'cl_to = '.$db->addQuotes($wgEmailArticleContactsCat),
 67+ 'cl_to = '.$db->addQuotes($wgEmailPageContactsCat),
6868 __METHOD__,
6969 array('ORDER BY' => 'cl_sortkey')
7070 );
@@ -83,7 +83,7 @@
8484 $groups = '<option/>';
8585 foreach (array_keys($wgGroupPermissions) as $group) if ($group != '*') {
8686 $selected = $group == $this->group ? ' selected' : '';
87 - if ($wgEmailArticleAllowAllUsers || $group != 'user') $groups .= "<option$selected>$group</option>";
 87+ if ($wgEmailPageAllowAllUsers || $group != 'user') $groups .= "<option$selected>$group</option>";
8888 }
8989 $wgOut->addHTML("<tr><td>".wfMsg('ea-fromgroup')."</td><td><select name=\"ea-group\">$groups</select></td></tr>\n");
9090 $wgOut->addHTML('</table>');
@@ -139,10 +139,10 @@
140140 # Send the message to the recipients (or just list them if arg = false)
141141 function send($send = true) {
142142 global $wgOut, $wgUser, $wgParser, $wgServer, $wgScript, $wgArticlePath, $wgScriptPath,
143 - $wgEmailArticleCss, $wgEmailArticleGroup, $wgEmailArticleAllowRemoteAddr, $wgEmailArticleAllowAllUsers;
 143+ $wgEmailPageCss, $wgEmailPageGroup, $wgEmailPageAllowRemoteAddr, $wgEmailPageAllowAllUsers;
144144
145145 # Set error and bail if user not in postmaster group, and request not from trusted address
146 - if ($wgEmailArticleGroup && !in_array($wgEmailArticleGroup, $wgUser->getGroups()) && !in_array($_SERVER['REMOTE_ADDR'], $wgEmailArticleAllowRemoteAddr)) {
 146+ if ($wgEmailPageGroup && !in_array($wgEmailPageGroup, $wgUser->getGroups()) && !in_array($_SERVER['REMOTE_ADDR'], $wgEmailPageAllowRemoteAddr)) {
147147 $denied = wfMsg('ea-denied');
148148 $wgOut->addWikiText(wfMsg('ea-error', $this->title, $denied ));
149149 return false;
@@ -152,7 +152,7 @@
153153 $title = Title::newFromText($this->title);
154154 $opt = new ParserOptions;
155155
156 - # Get contact article titles from selected cat
 156+ # Get contact page titles from selected cat
157157 if ($this->cat) {
158158 $result = $db->select(
159159 'categorylinks',
@@ -166,7 +166,7 @@
167167 }
168168
169169 # Get email addresses from users in selected group
170 - if ($this->group && ($wgEmailArticleAllowAllUsers || $this->group != 'user')) {
 170+ if ($this->group && ($wgEmailPageAllowAllUsers || $this->group != 'user')) {
171171 $group = $db->addQuotes($this->group);
172172 $result = $this->group == 'user'
173173 ? $db->select('user', 'user_email', 'user_email != \'\'', __METHOD__)
@@ -179,15 +179,15 @@
180180 $list = $wgParser->preprocess($this->list, $title, $opt);
181181 foreach (preg_split("/[\\x00-\\x1f,;*]+/", $list) as $item) $this->addRecipient($item);
182182
183 - # Compose the wikitext content of the article to send
184 - $article = new Article($title);
185 - $message = $article->getContent();
 183+ # Compose the wikitext content of the page to send
 184+ $page = new Article($title);
 185+ $message = $page->getContent();
186186 if ($this->header) $message = "{$this->header}\n\n$message";
187187
188188 # Convert the message text to html unless textonly
189189 if ($this->textonly == '') {
190190
191 - # Parse the wikitext using absolute URL's for local article links
 191+ # Parse the wikitext using absolute URL's for local page links
192192 $tmp = array($wgArticlePath, $wgScriptPath, $wgScript);
193193 $wgArticlePath = $wgServer.$wgArticlePath;
194194 $wgScriptPath = $wgServer.$wgScriptPath;
@@ -197,8 +197,8 @@
198198
199199 # Get CSS content if any
200200 if ($this->css) {
201 - $article = new Article(Title::newFromText($this->css));
202 - $css = '<style type="text/css">'.$article->getContent().'</style>';
 201+ $page = new Article(Title::newFromText($this->css));
 202+ $css = '<style type="text/css">'.$page->getContent().'</style>';
203203 }
204204
205205 # Create a html wrapper for the message
@@ -239,12 +239,12 @@
240240
241241 /**
242242 * Add a recipient the list
243 - * - accepts title objects for article containing email address, or string of actual address
 243+ * - accepts title objects for page containing email address, or string of actual address
244244 */
245245 function addRecipient($recipient) {
246246 if (is_object($recipient) && $recipient->exists()) {
247 - $article = new Article($recipient);
248 - if (preg_match('/[a-z0-9_.-]+@[a-z0-9_.-]+/i', $article->getContent(), $emails)) $recipient = $emails[0];
 247+ $page = new Article($recipient);
 248+ if (preg_match('/[a-z0-9_.-]+@[a-z0-9_.-]+/i', $page->getContent(), $emails)) $recipient = $emails[0];
249249 else $recipient = '';
250250 }
251251 if ($valid = User::isValidEmailAddr($recipient)) $this->recipients[] = $recipient;
Index: trunk/extensions/EmailPage/EmailPage.i18n.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Internationalisation file for extension EmailArticle.
 4+ * Internationalisation file for extension EmailPage.
55 *
66 * @addtogroup Extensions
77 */
@@ -11,12 +11,12 @@
1212 * @author Nad
1313 */
1414 $messages['en'] = array(
15 - 'emailarticle' => 'E-mail page',
 15+ 'emailpages' => 'E-mail page',
1616 'ea-desc' => 'Send rendered HTML page to an e-mail address or list of addresses using [http://phpmailer.sourceforge.net phpmailer].',
1717 'ea-heading' => "=== E-mailing the page [[$1]] ===",
1818 'ea-fromgroup' => 'From group:',
19 - 'ea-articlesend' => 'Page "$1" sent from $2',
20 - 'ea-noarticle' => "Please specify a page to send, for example [[Special:EmailArticle/Main Page]].",
 19+ 'ea-pagesend' => 'Page "$1" sent from $2',
 20+ 'ea-nopage' => "Please specify a page to send, for example [[Special:EmailPage/Main Page]].",
2121 'ea-norecipients' => "No valid e-mail addresses found!",
2222 'ea-listrecipients' => "=== {{PLURAL:$1|Recipient|$1 recipients}} ===",
2323 'ea-error' => "'''Error sending [[$1]]:''' ''$2''",
@@ -39,15 +39,16 @@
4040 * @author Meno25
4141 */
4242 $messages['ar'] = array(
43 - 'emailarticle' => 'مراسلة الصفحة',
 43+ 'emailpages' => 'إرسال رسالة للمستخدم',
4444 'ea-heading' => '=== مراسلة صفحة [[$1]] ===',
4545 'ea-fromgroup' => 'من مجموعة:',
46 - 'ea-articlesend' => 'الصفحة "$1" أُرسلت من $2',
 46+ 'ea-pagesend' => 'الصفحة "$1" أُرسلت من $2',
4747 'ea-norecipients' => 'لا عناوين بريد إلكتروني صحيحة وُجدت!',
4848 'ea-error' => "'''خطأ في إرسال [[$1]]:''' ''$2''",
4949 'ea-denied' => 'السماح مرفوض',
5050 'ea-selectrecipients' => 'اختر المتلقين',
5151 'ea-compose' => 'كتابة المحتوى',
 52+ 'ea-show' => 'عرض المتلقين',
5253 'ea-send' => 'أرسل!',
5354 'ea-subject' => 'أدخل سطر عنوان للبريد الإلكتروني',
5455 );
@@ -57,7 +58,7 @@
5859 */
5960 $messages['bg'] = array(
6061 'ea-fromgroup' => 'От група:',
61 - 'ea-noarticle' => 'Необходимо е да се посочи страница, която да бъде изпратена, напр. [[Special:EmailArticle/Начална страница]].',
 62+ 'ea-nopage' => 'Необходимо е да се посочи страница, която да бъде изпратена, напр. [[Special:EmailPage/Начална страница]].',
6263 'ea-norecipients' => 'Не бяха намерени валидни адреси за е-поща!',
6364 'ea-listrecipients' => '=== Списък на $1 {{PLURAL:$1|получател|получателя}} ===',
6465 'ea-error' => "'''Грешка при изпращане на [[$1]]:''' ''$2''",
@@ -71,11 +72,11 @@
7273 * @author Yekrats
7374 */
7475 $messages['eo'] = array(
75 - 'emailarticle' => 'Retpoŝtigi paĝon',
 76+ 'emailpages' => 'Retpoŝtigi paĝon',
7677 'ea-heading' => '=== Retpoŝtigante paĝon [[$1]] ===',
7778 'ea-fromgroup' => 'De grupo:',
78 - 'ea-articlesend' => 'Paĝo "$1" sendita de $2',
79 - 'ea-noarticle' => 'Bonvolu enigi paĝon por retsendi, ekz-e [[Special:EmailArticle/Main Page]].',
 79+ 'ea-pagesend' => 'Paĝo "$1" sendita de $2',
 80+ 'ea-nopage' => 'Bonvolu enigi paĝon por retsendi, ekz-e [[Special:EmailPage/Main Page]].',
8081 'ea-norecipients' => 'Neniaj validaj retadresoj trovitaj!',
8182 'ea-listrecipients' => '=== Listo de $1 {{PLURAL:$1|ricevonto|ricevontoj}} ===',
8283 'ea-error' => "'''Eraro sendante [[$1]]:''' ''$2''",
@@ -91,12 +92,12 @@
9293 * @author Grondin
9394 */
9495 $messages['fr'] = array(
95 - 'emailarticle' => 'Envoyer l’article par courriel',
 96+ 'emailpages' => 'Envoyer l’article par courriel',
9697 'ea-desc' => 'Envoie le rendu d’une page HTML à une adresse électronique où à une liste d’adresses en utilisant [http://phpmailer.sourceforge.net phpmailer]',
9798 'ea-heading' => '=== Envoi de la page [[$1]] par courrier électronique ===',
9899 'ea-fromgroup' => 'Depuis le groupe :',
99 - 'ea-articlesend' => 'Page « $1 » envoyée depuis $2',
100 - 'ea-noarticle' => 'Veuillez spécifier une page à envoyer, par exemple [[Special:EmailArticle/Accueil]]',
 100+ 'ea-pagesend' => 'Page « $1 » envoyée depuis $2',
 101+ 'ea-nopage' => 'Veuillez spécifier une page à envoyer, par exemple [[Special:EmailPage/Accueil]]',
101102 'ea-norecipients' => 'Aucune adresse courriel de trouvée !',
102103 'ea-listrecipients' => '=== Liste de $1 {{PLURAL:$1|destinataire|destinataires}} ===',
103104 'ea-error' => "'''Erreur de l’envoi de [[$1]] :''' ''$2''",
@@ -118,12 +119,12 @@
119120 * @author Toliño
120121 */
121122 $messages['gl'] = array(
122 - 'emailarticle' => 'Enviar a páxina por correo electrónico',
 123+ 'emailpages' => 'Enviar a páxina por correo electrónico',
123124 'ea-desc' => 'Enviar páxinas HTML renderizadas a un enderezo de correo electrónico (ou a varios correos) usando [http://phpmailer.sourceforge.net phpmailer].',
124125 'ea-heading' => '=== Enviando a páxina "[[$1]]" ===',
125126 'ea-fromgroup' => 'Desde o grupo:',
126 - 'ea-articlesend' => 'O artigo "$1" foi enviado desde $2',
127 - 'ea-noarticle' => 'Por favor, especifique a páxina que quere enviar, por exemplo: [[Special:EmailArticle/Main Page]].',
 127+ 'ea-pagesend' => 'O artigo "$1" foi enviado desde $2',
 128+ 'ea-nopage' => 'Por favor, especifique a páxina que quere enviar, por exemplo: [[Special:EmailPage/Main Page]].',
128129 'ea-norecipients' => 'Non foi atopado ningún enderezo de correo electrónico válido!',
129130 'ea-listrecipients' => '=== {{PLURAL:$1|Nome do destinatario|Listaxe dos $1 destinatarios}} ===',
130131 'ea-error' => "'''Erro no envío de \"[[\$1]]\":''' ''\$2''",
@@ -145,9 +146,9 @@
146147 * @author Lovekhmer
147148 */
148149 $messages['km'] = array(
149 - 'emailarticle' => 'ទំព័រអ៊ីមែល',
 150+ 'emailpages' => 'ទំព័រអ៊ីមែល',
150151 'ea-fromgroup' => 'ពីក្រុម:',
151 - 'ea-articlesend' => 'ទំព័រ"$1"ត្រូវបានបញ្ជូនពី$2',
 152+ 'ea-pagesend' => 'ទំព័រ"$1"ត្រូវបានបញ្ជូនពី$2',
152153 'ea-send' => 'ផ្ញើ!',
153154 );
154155
@@ -155,10 +156,10 @@
156157 * @author Robby
157158 */
158159 $messages['lb'] = array(
159 - 'emailarticle' => 'Säit per Mail schécken',
 160+ 'emailpages' => 'Säit per Mail schécken',
160161 'ea-heading' => '=== Säit [[$1]] peer E-Mail verschécken ===',
161162 'ea-fromgroup' => 'Vun der Grupp:',
162 - 'ea-articlesend' => 'D\'Säit "$1" gouf verschéckt vum $2',
 163+ 'ea-pagesend' => 'D\'Säit "$1" gouf verschéckt vum $2',
163164 'ea-norecipients' => 'Keng gëlteg E-Mailadress fonnt',
164165 'ea-denied' => 'Rechter refuséiert',
165166 'ea-selectrecipients' => 'Adressaten erauswielen',
@@ -172,11 +173,11 @@
173174 * @author Shijualex
174175 */
175176 $messages['ml'] = array(
176 - 'emailarticle' => 'ഇമെയില്‍ താള്‍',
 177+ 'emailpages' => 'ഇമെയില്‍ താള്‍',
177178 'ea-heading' => '=== [[$1]] എന്ന താള്‍ ഇമെയില്‍ ചെയ്യുന്നു ===',
178179 'ea-fromgroup' => 'ഗ്രൂപ്പ്:',
179 - 'ea-articlesend' => '$2 സം‌രംഭത്തില്‍ നിന്നു "$1" എന്ന താള്‍ അയച്ചു',
180 - 'ea-noarticle' => 'അയക്കുവാന്‍ വേണ്ടി ഒരു താള്‍ തിരഞ്ഞെടുക്കുക. ഉദാ: [[Special:EmailArticle/Main Page]]',
 180+ 'ea-pagesend' => '$2 സം‌രംഭത്തില്‍ നിന്നു "$1" എന്ന താള്‍ അയച്ചു',
 181+ 'ea-nopage' => 'അയക്കുവാന്‍ വേണ്ടി ഒരു താള്‍ തിരഞ്ഞെടുക്കുക. ഉദാ: [[Special:EmailPage/Main Page]]',
181182 'ea-norecipients' => 'സാധുവായ ഇമെയില്‍ വിലാസങ്ങള്‍ കണ്ടില്ല!',
182183 'ea-listrecipients' => '=== $1 {{PLURAL:$1|സ്വീകര്‍ത്താവിന്റെ|സ്വീകര്‍ത്താക്കളുടെ}} പട്ടിക ===',
183184 'ea-error' => "'''[[$1]] അയക്കുന്നതില്‍ പിഴവ്:''' ''$2''",
@@ -193,12 +194,12 @@
194195 * @author Kaustubh
195196 */
196197 $messages['mr'] = array(
197 - 'emailarticle' => 'पान इ-मेल करा',
 198+ 'emailpages' => 'पान इ-मेल करा',
198199 'ea-desc' => ' [http://phpmailer.sourceforge.net पीएचपी मेलर] चा वापर करून एखादे पान एखाद्या इ-मेल पत्त्यावर किंवा इ-मेल पत्त्यांच्या यादीवर पाठवा.',
199200 'ea-heading' => '=== [[$1]] पान इ-मेल करीत आहे ===',
200201 'ea-fromgroup' => 'गटाकडून:',
201 - 'ea-articlesend' => '$2 ने "$1" पान पाठविले',
202 - 'ea-noarticle' => 'कृपया पाठविण्यासाठी एक पान निवडा, उदाहरणासाठी [[Special:EmailArticle/Main Page]].',
 202+ 'ea-pagesend' => '$2 ने "$1" पान पाठविले',
 203+ 'ea-nopage' => 'कृपया पाठविण्यासाठी एक पान निवडा, उदाहरणासाठी [[Special:EmailPage/Main Page]].',
203204 'ea-norecipients' => 'योग्य इ-मेल पत्ता सापडला नाही!',
204205 'ea-listrecipients' => '=== $1 {{PLURAL:$1|सदस्याची|सदस्यांची}}यादी ===',
205206 'ea-error' => "'''पाठविण्यामध्ये त्रुटी [[$1]]:''' ''$2''",
@@ -227,12 +228,12 @@
228229 * @author Siebrand
229230 */
230231 $messages['nl'] = array(
231 - 'emailarticle' => 'Pagina e-mailen',
 232+ 'emailpages' => 'Pagina e-mailen',
232233 'ea-desc' => 'Stuur een gerenderde pagina naar een e-mailadres of een lijst van adressen met behulp van [http://phpmailer.sourceforge.net phpmailer].',
233234 'ea-heading' => '=== Pagina [[$1]] e-mailen ===',
234235 'ea-fromgroup' => 'Van groep:',
235 - 'ea-articlesend' => 'Pagina "$1" is vanuit $2 verstuurd',
236 - 'ea-noarticle' => 'Geef een pagina op om te versturen, bijvoorbeeld [[Special:EmailArticle/Hoofdpagina]].',
 236+ 'ea-pagesend' => 'Pagina "$1" is vanuit $2 verstuurd',
 237+ 'ea-nopage' => 'Geef een pagina op om te versturen, bijvoorbeeld [[Special:EmailPage/Hoofdpagina]].',
237238 'ea-norecipients' => 'Er is geen geldig e-mailadres opgegeven!',
238239 'ea-listrecipients' => '=== Lijst met $1 {{PLURAL:$1|ontvanger|ontvangers}} ===',
239240 'ea-error' => "'''Fout bij het versturen van [[$1]]:''' ''$2''",
@@ -254,12 +255,12 @@
255256 * @author Jon Harald Søby
256257 */
257258 $messages['no'] = array(
258 - 'emailarticle' => 'Send side som e-post',
 259+ 'emailpages' => 'Send side som e-post',
259260 'ea-desc' => 'Send HTML-side til en eller flere e-postadresser ved hjelp av [http://phpmailer.sourceforge.net/ phpmailer].',
260261 'ea-heading' => '=== Send siden [[$1]] som e-post ===',
261262 'ea-fromgroup' => 'Fra gruppe:',
262 - 'ea-articlesend' => 'Siden «$1» sendt fra $2',
263 - 'ea-noarticle' => 'Oppgi en side du vil sende, for eksempel [[Special:EmailArticle/{{MediaWiki:Mainpage}}]].',
 263+ 'ea-pagesend' => 'Siden «$1» sendt fra $2',
 264+ 'ea-nopage' => 'Oppgi en side du vil sende, for eksempel [[Special:EmailPage/{{MediaWiki:Mainpage}}]].',
264265 'ea-norecipients' => 'Ingen gyldige e-postadresser funnet.',
265266 'ea-listrecipients' => '=== Liste over $1 {{PLURAL:$1|mottaker|mottakere}} ===',
266267 'ea-error' => "'''Feil under sending av [[$1]]:''' ''$2''",
@@ -281,12 +282,12 @@
282283 * @author Cedric31
283284 */
284285 $messages['oc'] = array(
285 - 'emailarticle' => 'Mandar l’article per corrièr electronic',
 286+ 'emailpages' => 'Mandar l’article per corrièr electronic',
286287 'ea-desc' => 'Manda lo rendut d’una pagina HTML a una adreça electronica o a una tièra d’adreças en utilizant [http://phpmailer.sourceforge.net phpmailer]',
287288 'ea-heading' => '=== Mandadís de la pagina [[$1]] per corrièr electronic ===',
288289 'ea-fromgroup' => 'Dempuèi lo grop :',
289 - 'ea-articlesend' => 'Pagina « $1 » mandada dempuèi $2',
290 - 'ea-noarticle' => 'Especificatz una pagina de mandar, per exemple [[Special:EmailArticle/Acuèlh]]',
 290+ 'ea-pagesend' => 'Pagina « $1 » mandada dempuèi $2',
 291+ 'ea-nopage' => 'Especificatz una pagina de mandar, per exemple [[Special:EmailPage/Acuèlh]]',
291292 'ea-norecipients' => "Cap d'adreça de corrièr electronic pas trobada !",
292293 'ea-listrecipients' => '=== Tièra de $1 {{PLURAL:$1|destinatari|destinataris}} ===',
293294 'ea-error' => "'''Error del mandadís de [[$1]] :''' ''$2''",
@@ -304,16 +305,27 @@
305306 'ea-selectcss' => "Seleccionar un fuèlh d'estil CSS",
306307 );
307308
 309+/** Polish (Polski)
 310+ * @author Maikking
 311+ */
 312+$messages['pl'] = array(
 313+ 'ea-selectrecipients' => 'Wybierz odbiorców',
 314+ 'ea-show' => 'Pokaż odbiorców',
 315+ 'ea-send' => 'Wyślij',
 316+ 'ea-subject' => 'Wprowadź temat',
 317+ 'ea-selectcss' => 'Wybierz styl CSS',
 318+);
 319+
308320 /** Slovak (Slovenčina)
309321 * @author Helix84
310322 */
311323 $messages['sk'] = array(
312 - 'emailarticle' => 'Poslať stránku emailom',
 324+ 'emailpages' => 'Poslať stránku emailom',
313325 'ea-desc' => 'Poslať stránku vo formáte HTML na emailovú adresu alebo zoznam adries pomocou [http://phpmailer.sourceforge.net phpmailer].',
314326 'ea-heading' => '=== Poslanie stránky [[$1]] emailom ===',
315327 'ea-fromgroup' => 'Zo skupiny:',
316 - 'ea-articlesend' => 'Článok „$1” poslaný z $2',
317 - 'ea-noarticle' => 'Prosím, uveďte stránku, ktorú chcete poslať, napr. [[Special:EmailArticle/Hlavná stránka]].',
 328+ 'ea-pagesend' => 'Článok „$1” poslaný z $2',
 329+ 'ea-nopage' => 'Prosím, uveďte stránku, ktorú chcete poslať, napr. [[Special:EmailPage/Hlavná stránka]].',
318330 'ea-norecipients' => 'Nebola nájdená platná emailová adresa!',
319331 'ea-listrecipients' => '=== Zoznam $1 {{PLURAL:$1|príjemcu|príjemcov}} ===',
320332 'ea-error' => "'''Chyba pri odosielaní [[$1]]:''' ''$2''",
@@ -342,12 +354,12 @@
343355 * @author M.M.S.
344356 */
345357 $messages['sv'] = array(
346 - 'emailarticle' => 'E-posta sida',
 358+ 'emailpages' => 'E-posta sida',
347359 'ea-desc' => 'Skicka en renderad HTML-sida till en e-postadress eller en lista över adresser som använder [http://phpmailer.sourceforge.net phpmailer].',
348360 'ea-heading' => '=== E-posta sidan [[$1]] ===',
349361 'ea-fromgroup' => 'Från grupp:',
350 - 'ea-articlesend' => 'Artikeln "$1" skickades från $2',
351 - 'ea-noarticle' => 'Var god ange en sida att skicka, för exempel [[Special:EmailArticle/Main Page]].',
 362+ 'ea-pagesend' => 'Artikeln "$1" skickades från $2',
 363+ 'ea-nopage' => 'Var god ange en sida att skicka, för exempel [[Special:EmailPage/Main Page]].',
352364 'ea-norecipients' => 'Inga giltiga e-postadresser hittades!',
353365 'ea-listrecipients' => '=== Lista över $1 {{PLURAL:$1|mottagare|mottagare}} ===',
354366 'ea-error' => "'''Fel under sändande av [[$1]]:''' ''$2''",
@@ -378,10 +390,10 @@
379391 * @author Vinhtantran
380392 */
381393 $messages['vi'] = array(
382 - 'emailarticle' => 'Trang thư điện tử',
 394+ 'emailpages' => 'Trang thư điện tử',
383395 'ea-desc' => 'Gửi trang HTML giản lược đến một địa chỉ hoặc danh sách các địa chỉ thư điện tử dùng [http://phpmailer.sourceforge.net phpmailer].',
384396 'ea-heading' => '=== Gửi trang [[$1]] ===',
385 - 'ea-noarticle' => 'Xin hãy xác định trang muốn gửi, ví dụ [[Special:EmailArticle/Trang_Chính]].',
 397+ 'ea-nopage' => 'Xin hãy xác định trang muốn gửi, ví dụ [[Special:EmailPage/Trang_Chính]].',
386398 'ea-norecipients' => 'Không tìm thấy địa chỉ thư điện tử hợp lệ!',
387399 'ea-listrecipients' => '=== Danh sách $1 {{PLURAL:$1|người nhận|người nhận}} ===',
388400 'ea-error' => "'''Lỗi khi gửi [[$1]]:''' ''$2''",
Index: trunk/extensions/EmailPage/EmailPage.php
@@ -1,8 +1,8 @@
22 <?php
33 /**
4 - * EmailArticle extension - Send rendered HTML article to an email address or list of addresses using phpmailer
 4+ * EmailPage extension - Send rendered HTML page to an email address or list of addresses using phpmailer
55 *
6 - * See http://www.mediawiki.org/wiki/Extension:EmailArticle for installation and usage details
 6+ * See http://www.mediawiki.org/wiki/Extension:EmailPage for installation and usage details
77 *
88 * @package MediaWiki
99 * @subpackage Extensions
@@ -13,61 +13,60 @@
1414
1515 if (!defined('MEDIAWIKI')) die('Not an entry point.');
1616
17 -define('EMAILARTICLE_VERSION', '1.1.0, 2008-06-04');
 17+define('EMAILPAGE_VERSION', '1.2.0, 2008-07-13');
1818
19 -$wgEmailArticleGroup = 'sysop'; # Users must belong to this group to send emails (empty string means anyone can send)
20 -$wgEmailArticleContactsCat = ''; # This specifies the name of a category containing categories of contact articles
21 -$wgEmailArticleCss = 'EmailArticle.css'; # A minimal CSS article to embed in the email (eg. monobook/main.css without portlets, actions etc)
22 -$wgEmailArticleAllowRemoteAddr = array($_SERVER['SERVER_ADDR'],'127.0.0.1'); # Allow anonymous sending from these addresses
23 -$wgEmailArticleAllowAllUsers = false; # Whether to allow sending to all users (the "user" group)
24 -$wgEmailArticleToolboxLink = 'Send to email'; # Link title for toolbox link (set to "" to not have any link in toolbox)
25 -$wgEmailArticleActionLink = 'email'; # Link title for action link (set to "" to not have any action link)
 19+$wgEmailPageGroup = 'sysop'; # Users must belong to this group to send emails (empty string means anyone can send)
 20+$wgEmailPageContactsCat = ''; # This specifies the name of a category containing categories of contact pages
 21+$wgEmailPageCss = 'EmailPage.css'; # A minimal CSS page to embed in the email (eg. monobook/main.css without portlets, actions etc)
 22+$wgEmailPageAllowRemoteAddr = array($_SERVER['SERVER_ADDR'],'127.0.0.1'); # Allow anonymous sending from these addresses
 23+$wgEmailPageAllowAllUsers = false; # Whether to allow sending to all users (the "user" group)
 24+$wgEmailPageToolboxLink = 'Send to email'; # Link title for toolbox link (set to "" to not have any link in toolbox)
 25+$wgEmailPageActionLink = 'email'; # Link title for action link (set to "" to not have any action link)
2626 $wgPhpMailerClass = dirname(__FILE__).'/phpMailer_v2.1.0beta2/class.phpmailer.php'; # From http://phpmailer.sourceforge.net/
2727
28 -if ($wgEmailArticleGroup) $wgGroupPermissions['sysop'][$wgEmailArticleGroup] = true;
 28+if ($wgEmailPageGroup) $wgGroupPermissions['sysop'][$wgEmailPageGroup] = true;
2929
3030 $dir = dirname(__FILE__) . '/';
31 -$wgAutoloadClasses['SpecialEmailArticle'] = $dir . 'EmailArticle_body.php';
32 -$wgExtensionMessagesFiles['EmailArticle'] = $dir . 'EmailArticle.i18n.php';
33 -$wgExtensionAliasesFiles['EmailArticle'] = $dir . 'EmailArticle.alias.php';
34 -$wgSpecialPages['EmailArticle'] = 'SpecialEmailArticle';
 31+$wgAutoloadClasses['SpecialEmailPage'] = $dir . 'EmailPage_body.php';
 32+$wgExtensionMessagesFiles['EmailPage'] = $dir . 'EmailPage.i18n.php';
 33+$wgExtensionAliasesFiles['EmailPage'] = $dir . 'EmailPage.alias.php';
 34+$wgSpecialPages['EmailPages'] = 'SpecialEmailPage';
3535
3636 $wgExtensionCredits['specialpage'][] = array(
37 - 'name' => 'Special:EmailArticle',
 37+ 'name' => 'Special:EmailPages',
3838 'author' => '[http://www.organicdesign.co.nz/nad User:Nad]',
39 - 'description' => 'Send rendered HTML article to an email address or list of addresses using [http://phpmailer.sourceforge.net phpmailer].',
 39+ 'description' => 'Send rendered HTML page to an email address or list of addresses using [http://phpmailer.sourceforge.net phpmailer].',
4040 'descriptionmsg' => 'ea-desc',
41 - 'url' => 'http://www.mediawiki.org/wiki/Extension:EmailArticle',
42 - 'version' => EMAILARTICLE_VERSION
 41+ 'url' => 'http://www.mediawiki.org/wiki/Extension:EmailPage',
 42+ 'version' => EMAILPAGE_VERSION
4343 );
4444
4545 # If form has been posted, include the phpmailer class
4646 if (isset($_REQUEST['ea-send'])) require_once($wgPhpMailerClass);
4747
4848 # Add toolbox and action links
49 -if ($wgEmailArticleToolboxLink) {
50 - $wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfEmailArticleToolboxLink';
 49+if ($wgEmailPageToolboxLink) {
 50+ $wgHooks['MonoBookTemplateToolboxEnd'][] = 'wfEmailPageToolboxLink';
5151 }
5252
53 -if ($wgEmailArticleActionLink) {
54 - $wgHooks['SkinTemplateTabs'][] = 'wfEmailArticleActionLink';
 53+if ($wgEmailPageActionLink) {
 54+ $wgHooks['SkinTemplateTabs'][] = 'wfEmailPageActionLink';
5555 }
5656
57 -function wfEmailArticleToolboxLink() {
58 - global $wgEmailArticleToolboxLink,$wgTitle;
 57+function wfEmailPageToolboxLink() {
 58+ global $wgEmailPageToolboxLink,$wgTitle;
5959 if (is_object($wgTitle)) {
60 - $url = Title::makeTitle(NS_SPECIAL,'EmailArticle')->getLocalURL('ea-title='.$wgTitle->getPrefixedText());
61 - echo("<li><a href=\"$url\">$wgEmailArticleToolboxLink</li>");
 60+ $url = Title::makeTitle(NS_SPECIAL,'EmailPages')->getLocalURL('ea-title='.$wgTitle->getPrefixedText());
 61+ echo("<li><a href=\"$url\">$wgEmailPageToolboxLink</li>");
6262 }
6363 return true;
6464 }
6565
66 -
67 -function wfEmailArticleActionLink(&$skin,&$actions) {
68 - global $wgEmailArticleActionLink,$wgTitle;
 66+function wfEmailPageActionLink(&$skin,&$actions) {
 67+ global $wgEmailPageActionLink,$wgTitle;
6968 if (is_object($wgTitle)) {
70 - $url = Title::makeTitle(NS_SPECIAL,'EmailArticle')->getLocalURL('ea-title='.$wgTitle->getPrefixedText());
71 - $actions['email'] = array('text' => $wgEmailArticleActionLink, 'class' => false, 'href' => $url);
 69+ $url = Title::makeTitle(NS_SPECIAL,'EmailPage')->getLocalURL('ea-title='.$wgTitle->getPrefixedText());
 70+ $actions['email'] = array('text' => $wgEmailPageActionLink, 'class' => false, 'href' => $url);
7271 }
7372 return true;
7473 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r37730Update for r37727-r37729siebrand22:30, 15 July 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37619* rename EmailArticle to EmailPage...siebrand15:51, 13 July 2008

Status & tagging log