1 | <?php |
---|
2 | if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | // Langue et configuration |
---|
5 | global $conf; |
---|
6 | load_language('plugin.lang', AM_PATH); |
---|
7 | $conf['admin_messages'] = unserialize($conf['admin_messages']); |
---|
8 | |
---|
9 | |
---|
10 | // +-----------------------------------------------------------------------+ |
---|
11 | // Tabsheet |
---|
12 | // +-----------------------------------------------------------------------+ |
---|
13 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
14 | $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'list'; |
---|
15 | |
---|
16 | $tabsheet = new tabsheet(); |
---|
17 | $tabsheet->add('list', l10n('AM_list_tab'), AM_ADMIN . '-list'); // Liste de smessages |
---|
18 | $tabsheet->add('new', l10n('AM_new_tab'), AM_ADMIN . '-new'); // Ajouter un nouveau message |
---|
19 | if ($page['tab'] == 'edit' AND isset($_GET['message_id'])) { // Editer le message |
---|
20 | $tabsheet->add('edit', l10n('AM_edit_tab'), CR_ADMIN . '-edit&message_id=' . $_GET['message_id']); |
---|
21 | } |
---|
22 | $tabsheet->add('config', l10n('Configuration'), AM_ADMIN . '-config'); // Configuration |
---|
23 | $tabsheet->select($page['tab']); |
---|
24 | $tabsheet->assign(); |
---|
25 | |
---|
26 | |
---|
27 | // +-----------------------------------------------------------------------+ |
---|
28 | // Template |
---|
29 | // +-----------------------------------------------------------------------+ |
---|
30 | $template->assign(array( |
---|
31 | 'AM_VERSION' => AM_NAME . ' ' . AM_VERSION, |
---|
32 | 'AM_PATH' => AM_PATH, |
---|
33 | 'AM_ADMIN' => AM_ADMIN, |
---|
34 | )); |
---|
35 | |
---|
36 | if ($page['tab'] == 'edit') { $page['tab'] = 'new'; } // L'édition se fait sur la page de création |
---|
37 | include(AM_PATH .'admin/' . $page['tab'] . '.php'); |
---|
38 | ?> |
---|