X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvalidations%2Fnl.inc.php;h=92c5b785ab79ad4e08a62249151d26d42e4b92bc;hb=b6ba1a0417b6fc73f3d1701146373b4bec0d1428;hp=22a0c62eb3e11c9c28c05e6bf320ac25e4cff525;hpb=5ddeb07cc787dd1dc3630a31f1528f5cc7c4d9b9;p=platal.git diff --git a/include/validations/nl.inc.php b/include/validations/nl.inc.php index 22a0c62..92c5b78 100644 --- a/include/validations/nl.inc.php +++ b/include/validations/nl.inc.php @@ -1,6 +1,6 @@ Validate($uid, false, 'nl'); - $this->art = new NLArticle($title, $body, $append); + public function __construct(User &$_user, $_title, $_body, $_append) + { + parent::__construct($_user, false, 'nl'); + $this->art = new NLArticle($_title, $_body, $_append); } // }}} // {{{ function formu() - function formu() + public function formu() { return 'include/form.valid.nl.tpl'; } @@ -49,7 +50,7 @@ class NLReq extends Validate // }}} // {{{ function editor() - function editor() + public function editor() { return 'include/form.valid.edit-nl.tpl'; } @@ -57,7 +58,7 @@ class NLReq extends Validate // }}} // {{{ function handle_editor() - function handle_editor() + protected function handle_editor() { $this->art->_body = Env::v('nl_body'); $this->art->_title = Env::v('nl_title'); @@ -67,8 +68,8 @@ class NLReq extends Validate // }}} // {{{ function _mail_subj - - function _mail_subj() + + protected function _mail_subj() { return "[Polytechnique.org/NL] Proposition d'article dans la NL"; } @@ -76,21 +77,36 @@ class NLReq extends Validate // }}} // {{{ function _mail_body - function _mail_body($isok) + protected function _mail_body($isok) { if ($isok) { - return ' L\'article que tu avais proposé ('.$this->art->title().') vient d\'être validé.'; + return " L'article que tu avais proposé (" . $this->art->title() . ") vient d'être validé."; } else { - return ' L\'article que tu avais proposé ('.$this->art->title().') a été refusé.'; + return " L'article que tu avais proposé a été refusé."; + } + } + + // }}} + // {{{ function _mail_ps + + protected function _mail_ps($isok) + { + if ($isok) { + return ''; } + return "\nPS : pour rappel, en voici le contenu :" + . "\n--------------------------------------------------------------------------\n" + . $this->art->title() + . "\n--------------------------------------------------------------------------\n" + . $this->art->body() . "\n\n" . $this->art->append() . "\n"; } // }}} // {{{ function commit() - function commit() + public function commit() { - $nl = new Newsletter(); + $nl = new NewsLetter(); $nl->saveArticle($this->art); return true; } @@ -100,5 +116,5 @@ class NLReq extends Validate // }}} -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>