From: Nicolas Iooss Date: Sat, 28 Dec 2013 19:58:46 +0000 (+0100) Subject: Add basic pages for community letter X-Git-Tag: xorg/1.1.11~6 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=26cba39a939c4a9eb60b88a9bf71f1737d14e3f0;p=platal.git Add basic pages for community letter --- diff --git a/classes/xorg.php b/classes/xorg.php index e920dc1..a7858db 100644 --- a/classes/xorg.php +++ b/classes/xorg.php @@ -31,6 +31,7 @@ class Xorg extends Platal 'axletter', 'bandeau', 'carnet', + 'comletter', 'deltaten', 'email', 'epletter', diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index d5f7718..fc08040 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -44,6 +44,7 @@ class NewsLetter // 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'; @@ -548,6 +549,8 @@ class NewsLetter 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: @@ -574,6 +577,8 @@ class NewsLetter 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: @@ -600,6 +605,8 @@ class NewsLetter 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: @@ -647,6 +654,7 @@ class NewsLetter { switch ($this->group) { case self::GROUP_XORG: + case self::GROUP_COMMUNITY: case self::GROUP_AX: case self::GROUP_EP: case self::GROUP_FX: diff --git a/modules/comletter.php b/modules/comletter.php new file mode 100644 index 0000000..103adef --- /dev/null +++ b/modules/comletter.php @@ -0,0 +1,64 @@ + $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: +?> diff --git a/templates/register/step3.tpl b/templates/register/step3.tpl index ea03229..b2a8639 100644 --- a/templates/register/step3.tpl +++ b/templates/register/step3.tpl @@ -116,11 +116,11 @@
- 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.
- 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é.
{if $smarty.session.subState.edu_type eq #Profile::DEGREE_X#}
diff --git a/templates/skin/common.menu.tpl b/templates/skin/common.menu.tpl index e3780bf..626a0c8 100644 --- a/templates/skin/common.menu.tpl +++ b/templates/skin/common.menu.tpl @@ -98,6 +98,7 @@ +