X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fcomletter.php;fp=modules%2Fcomletter.php;h=b6e7194b8b6938e7b33fdc211d044fc12cd96135;hb=60b19854568852e2a89d80f3456876ac4ff2cc9a;hp=959b62aad35784859409342057942fc8ef0caafe;hpb=2be9fe585f8e410d6918ad04d5ebcd0e6b74f109;p=platal.git diff --git a/modules/comletter.php b/modules/comletter.php index 959b62a..b6e7194 100644 --- a/modules/comletter.php +++ b/modules/comletter.php @@ -32,6 +32,7 @@ class ComLetterModule extends NewsletterModule return array( 'comletter' => $this->make_hook('nl', AUTH_COOKIE, 'user'), 'comletter/submit' => $this->make_hook('coml_submit', AUTH_PASSWD, 'user'), + 'comletter/remaining' => $this->make_hook('coml_remaining', AUTH_PASSWD, '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'), @@ -78,6 +79,19 @@ class ComLetterModule extends NewsletterModule $page->addCssLink($nl->cssFile()); } + function handler_coml_remaining($page) + { + pl_content_headers('text/html'); + $page->changeTpl('newsletter/remaining.tpl', NO_SKIN); + + $article = new ComLArticle('', Post::t('body'), ''); + $rest = $article->remain(); + + $page->assign('too_long', $rest['remaining_lines'] < 0); + $page->assign('last_line', ($rest['remaining_lines'] == 0)); + $page->assign('remaining', ($rest['remaining_lines'] == 0) ? $rest['remaining_characters_for_last_line'] : $rest['remaining_lines']); + } + function handler_out($page, $hash = null, $issue_id = null) { if (!$hash) {