From 87d116c47df7587d7ca53bba65e79563089f60cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 14 Nov 2011 21:58:58 +0100 Subject: [PATCH] Enable FX letter. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/xorg.php | 1 + configs/mails.conf | 4 ++ htdocs/css/nl.FX.css | 83 +++++++++++++++++++++++++++++++ include/newsletter.inc.php | 8 +++ modules/fxletter.php | 61 +++++++++++++++++++++++ templates/newsletter/nl.FX.mail.tpl | 99 +++++++++++++++++++++++++++++++++++++ templates/skin/common.menu.tpl | 1 + 7 files changed, 257 insertions(+) create mode 100644 htdocs/css/nl.FX.css create mode 100644 modules/fxletter.php create mode 100644 templates/newsletter/nl.FX.mail.tpl diff --git a/classes/xorg.php b/classes/xorg.php index c53f31a..17a350a 100644 --- a/classes/xorg.php +++ b/classes/xorg.php @@ -37,6 +37,7 @@ class Xorg extends Platal 'events', 'forums', 'fusionax', + 'fxletter', 'gadgets', 'geoloc', 'googleapps', diff --git a/configs/mails.conf b/configs/mails.conf index fc294d4..29d632e 100644 --- a/configs/mails.conf +++ b/configs/mails.conf @@ -44,6 +44,10 @@ to=non-geoloc@staff.polytechnique.org from="Amicale des Anciens de l'X" replyto=reponses@amicale.polytechnique.org +[mails_fx] +from="Fondation de l'Ecole polytechnique" +replyto=reponses@fondationx.fr + [marketing] from="Marketing Polytechnique.org" diff --git a/htdocs/css/nl.FX.css b/htdocs/css/nl.FX.css new file mode 100644 index 0000000..dcbab87 --- /dev/null +++ b/htdocs/css/nl.FX.css @@ -0,0 +1,83 @@ +/*************************************************************************** + * Copyright (C) 2003-2011 Polytechnique.org * + * http://opensource.polytechnique.org/ * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + ***************************************************************************/ + + +div.fx_mail { + margin : auto; + width : 72ex; + font-family : "Georgia", "Times New Roman", serif; + font-size : 10pt; + text-align : justify; + background-color : #fff; + color : #000; +} + +/* Links */ +div.fx_mail a[href] { + background-color: transparent; + color : #444; + text-decoration : none; + background-image: none; +} + +div.fx_mail a[href]:hover { + background-color: transparent; + color : #D44; + text-decoration : none; + background-image: none; +} + +/* Title */ +div.fx_mail .title { + background-color: #FA2; + margin : 0 0 3ex; + padding : 4.5ex 1ex 1ex 15ex; + font-size : 130%; + font-weight : bold; + text-align : left; +} + +/* Intro */ +div.fx_mail div.intro { + margin : 4ex 2ex 2ex 2ex; +} + +div.fx_mail div.signature { + margin : 3ex 2ex 0 0; + font-size : 90%; + font-style: italic; + text-align : right; +} + +/* Give */ +div.fx_mail div.give { + font-weight: bold; + text-align: center; + padding: 0.5ex 0 0.5ex 0; + border-top: solid 2ex #FA2; +} + +/* Footer */ +div.fx_mail div.foot1, div.fx_mail div.foot2 { + background-color: #FA2; + text-align: center; + font-size: 90%; + padding: 0.5ex 0; +} diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index 5dbe438..a51aeae 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -46,6 +46,7 @@ class NewsLetter const GROUP_XORG = 'Polytechnique.org'; const GROUP_AX = 'AX'; const GROUP_EP = 'Ecole'; + const GROUP_FX = 'FX'; // Searches on mutiple fields const SEARCH_ALL = 'all'; @@ -551,6 +552,8 @@ class NewsLetter return 'ax'; case self::GROUP_EP: return 'epletter'; + case self::GROUP_FX: + return 'fxletter'; default: // Don't display groups NLs on X.org assert(!$enforce_xnet); @@ -575,6 +578,8 @@ class NewsLetter return 'ax/admin'; case self::GROUP_EP: return 'epletter/admin'; + case self::GROUP_FX: + return 'fxletter/admin'; default: // Don't display groups NLs on X.org assert(!$enforce_xnet); @@ -599,6 +604,8 @@ class NewsLetter return 'ax/stat'; case self::GROUP_EP: return 'epletter/stat'; + case self::GROUP_FX: + return 'fxletter/stat'; default: // Don't display groups NLs on X.org assert(!$enforce_xnet); @@ -642,6 +649,7 @@ class NewsLetter case self::GROUP_XORG: case self::GROUP_AX: case self::GROUP_EP: + case self::GROUP_FX: return false; default: return true; diff --git a/modules/fxletter.php b/modules/fxletter.php new file mode 100644 index 0000000..defcd0a --- /dev/null +++ b/modules/fxletter.php @@ -0,0 +1,61 @@ + $this->make_hook('nl', AUTH_COOKIE, 'user'), + 'fxletter/out' => $this->make_hook('out', AUTH_PUBLIC), + 'fxletter/show' => $this->make_hook('nl_show', AUTH_COOKIE, 'user'), + 'fxletter/search' => $this->make_hook('nl_search', AUTH_COOKIE, 'user'), + 'fxletter/admin' => $this->make_hook('admin_nl', AUTH_PASSWD, 'user'), + 'fxletter/admin/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'user'), + 'fxletter/admin/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_PASSWD, 'user'), + 'fxletter/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'user'), + 'fxletter/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'user'), + 'fxletter/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'user'), + 'fxletter/stat' => $this->make_hook('stat_nl', AUTH_PASSWD, 'user') + ); + } + + protected function getNl() + { + require_once 'newsletter.inc.php'; + return NewsLetter::forGroup(NewsLetter::GROUP_FX); + } + + function handler_out($page, $hash = null, $issue_id = null) + { + if (!$hash) { + if (!S::logged()) { + return PL_DO_AUTH; + } + } + return $this->handler_nl($page, 'out', $hash, $issue_id); + } +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +?> diff --git a/templates/newsletter/nl.FX.mail.tpl b/templates/newsletter/nl.FX.mail.tpl new file mode 100644 index 0000000..8332667 --- /dev/null +++ b/templates/newsletter/nl.FX.mail.tpl @@ -0,0 +1,99 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2011 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +{config_load file="mails.conf" section="mails_fx"} +{if $mail_part eq 'head'} +{from full=#from#} +{subject text=$issue->title(true)} +{if isset(#replyto#)}{add_header name='Reply-To' value=#replyto#}{/if} +{if isset(#retpath#)}{add_header name='Return-Path' value=#retpath#}{/if} +{elseif $mail_part eq 'text'} +{if !$is_mail} +
+{/if}
+====================================================================
+{$issue->title()}
+====================================================================
+
+{$issue->head($user, 'text')}
+
+{$issue->signature('text')}
+
+--------------------------------------------------------------------
+{if $is_mail}
+Pour faire un don : 
+{else}
+Pour faire un don : <http://fondationx.fr/fond/paiement.php>
+{/if}
+Cette lettre est envoyée par la FX grâce aux outils de Polytechnique.org.
+
+{if $is_mail}
+archives         : 
+ne plus recevoir : id}>
+{else}
+archives         : <https://www.polytechnique.org/fxletter>
+ne plus recevoir : <https://www.polytechnique.org/fxletter/out/{if $hash}{$hash}{else}nohash{/if}/{$issue->id}>
+{/if}
+
+{if !$is_mail}
+
+{/if} +{elseif $mail_part eq 'html'} +{if $is_mail} + + + + + Lettre d'information de la Fondation de l'École polytechnique + + + +
+{/if} +
+
{$issue->title()}
+
{$issue->head($user, 'html')|smarty:nodefaults}
+
{$issue->signature('html')|smarty:nodefaults}
+ +
+ Cette lettre est envoyée par la FX grâce aux outils de Polytechnique.org. +
+ +
+{if $is_mail} +
+ + +{/if} +{/if} + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index a50c9f4..3ef2d78 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -100,6 +100,7 @@ + -- 2.1.4