'admin/newsletter' => $this->make_hook('admin_nl', AUTH_MDP, 'admin'),
'admin/newsletter/categories' => $this->make_hook('admin_nl_cat', AUTH_MDP, 'admin'),
'admin/newsletter/edit' => $this->make_hook('admin_nl_edit', AUTH_MDP, 'admin'),
-
- 'ax' => $this->make_hook('ax', AUTH_COOKIE),
- 'ax/show' => $this->make_hook('ax_show', AUTH_COOKIE),
- 'ax/submit' => $this->make_hook('ax_submit', AUTH_MDP),
- 'ax/edit' => $this->make_hook('ax_submit', AUTH_MDP),
- 'admin/axletter/rights' => $this->make_hook('admin_ax_rights', AUTH_MDP, 'admin'),
);
}
require_once 'newsletter.inc.php';
- if (Post::has('see')) {
+ if (Post::has('see') || (Post::has('valid') && (!trim(Post::v('title')) || !trim(Post::v('body'))))) {
+ if (!Post::has('see')) {
+ $page->trig("L'article doit avoir un titre et un contenu");
+ }
$art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'));
$page->assign('art', $art);
} elseif (Post::has('valid')) {
$art->submit();
$page->assign('submited', true);
}
+ $page->addCssLink('nl.css');
}
function handler_admin_nl(&$page, $new = false) {
$table_editor->describe('pos','position',true);
$table_editor->apply($page, $action, $id);
}
-
- function handler_ax(&$page, $action = null)
- {
- require_once 'newsletter.inc.php';
-
- $page->changeTpl('newsletter/ax.tpl');
- $page->assign('xorg_title','Polytechnique.org - Envois de l\'AX');
-
- switch ($action) {
- case 'out': AXLetter::unsubscribe(); break;
- case 'in': AXLetter::subscribe(); break;
- default: ;
- }
-
- $perm = AXLetter::hasPerms();
- if ($perm) {
- $waiting = AXLetter::awaiting();
- if ($waiting) {
- $new = new AXLetter($waiting);
- $page->assign('new', $new);
- }
- }
- $page->assign('axs', AXLetter::subscriptionState());
- $page->assign('ax_list', AXLetter::listSent());
- $page->assign('ax_rights', AXLetter::hasPerms());
- }
-
- function handler_ax_submit(&$page)
- {
- require_once('newsletter.inc.php');
- if (!AXLetter::hasPerms()) {
- return PL_FORBIDDEN;
- }
- }
}
?>