// Diminutif of X.net groups with a specific NL view
const GROUP_XORG = 'Polytechnique.org';
+ const GROUP_COMMUNITY = 'Annonces';
const GROUP_AX = 'AX';
const GROUP_EP = 'Ecole';
const GROUP_FX = 'FX';
switch ($this->group) {
case self::GROUP_XORG:
return 'nl';
+ case self::GROUP_COMMUNITY:
+ return 'comletter';
case self::GROUP_AX:
return 'ax';
case self::GROUP_EP:
switch ($this->group) {
case self::GROUP_XORG:
return 'admin/newsletter';
+ case self::GROUP_COMMUNITY:
+ return 'comletter/admin';
case self::GROUP_AX:
return 'ax/admin';
case self::GROUP_EP:
switch ($this->group) {
case self::GROUP_XORG:
return 'stat/newsletter';
+ case self::GROUP_COMMUNITY:
+ return 'comletter/stat';
case self::GROUP_AX:
return 'ax/stat';
case self::GROUP_EP:
{
switch ($this->group) {
case self::GROUP_XORG:
+ case self::GROUP_COMMUNITY:
case self::GROUP_AX:
case self::GROUP_EP:
case self::GROUP_FX:
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2013 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 *
+ ***************************************************************************/
+
+Platal::load('newsletter');
+
+/**
+ * Newsletter for community
+ */
+class ComLetterModule extends NewsletterModule
+{
+ function handlers()
+ {
+ return array(
+ 'comletter' => $this->make_hook('nl', AUTH_COOKIE, 'user'),
+ 'comletter/out' => $this->make_hook('out', AUTH_PUBLIC),
+ 'comletter/show' => $this->make_hook('nl_show', AUTH_COOKIE, 'user'),
+ 'comletter/search' => $this->make_hook('nl_search', AUTH_COOKIE, 'user'),
+ 'comletter/admin' => $this->make_hook('admin_nl', AUTH_PASSWD, 'user'),
+ 'comletter/admin/edit' => $this->make_hook('admin_nl_edit', AUTH_PASSWD, 'user'),
+ 'comletter/admin/edit/valid' => $this->make_hook('admin_nl_valid', AUTH_PASSWD, 'user'),
+ 'comletter/admin/edit/cancel' => $this->make_hook('admin_nl_cancel', AUTH_PASSWD, 'user'),
+ 'comletter/admin/edit/delete' => $this->make_hook('admin_nl_delete', AUTH_PASSWD, 'user'),
+ 'comletter/admin/categories' => $this->make_hook('admin_nl_cat', AUTH_PASSWD, 'user'),
+ 'comletter/stat' => $this->make_hook('stat_nl', AUTH_PASSWD, 'user')
+ );
+ }
+
+ protected function getNl()
+ {
+ require_once 'newsletter.inc.php';
+ return NewsLetter::forGroup(NewsLetter::GROUP_COMMUNITY);
+ }
+
+ 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:
+?>
<dl>
<dt><label><input type="checkbox" checked="checked" name="nl" /> lettre mensuelle</label></dt>
<dd>
- de recevoir chaque mois la lettre mensuelle de Polytechnique.org contenant les activités et nouvelles de la communauté des X.
+ de recevoir chaque mois la lettre mensuelle de Polytechnique.org contenant les activités de la communauté des X.
</dd>
<dt><label><input type="checkbox" checked="checked" name="com_letters" /> lettres de la communauté</label></dt>
<dd>
- de recevoir les informations importantes de l'École, de l'AX et de la FX.
+ de recevoir les informations importantes de l'École, de l'AX, de la FX et de la communauté.
</dd>
{if $smarty.session.subState.edu_type eq #Profile::DEGREE_X#}
<dt><label><input type="checkbox" checked="checked" name="ml_promo" /> ta promotion</label></dt>