Linux multi-monitor fullscreen support
[ryzomcore.git] / web / public_php / admin / tool_notes.php
bloba242c6d3f1e7b63cf710a0607d42c2931ebc5741
1 <?php
3 require_once('common.php');
4 require_once('functions_tool_notes.php');
6 if (!tool_admin_applications_check('tool_notes')) nt_common_redirect('index.php');
8 nt_common_add_debug('-- Starting on \'tool_notes.php\'');
10 $tpl->assign('tool_title', "Notes");
12 if (tool_admin_applications_check('tool_notes_global')) $tpl->assign('restriction_tool_notes_global', true);
14 if (isset($NELTOOL['GET_VARS']['note_id']))
16 $note_id = $NELTOOL['GET_VARS']['note_id'];
17 $tool_note_data = tool_notes_get_id($nel_user['user_id'], $note_id);
19 $tpl->assign('tool_note_edit_data', $tool_note_data);
22 if (isset($NELTOOL['POST_VARS']['toolaction']))
24 $tool_action = $NELTOOL['POST_VARS']['toolaction'];
26 switch($tool_action)
28 case 'create':
30 $note_title = $NELTOOL['POST_VARS']['tool_form_note_title'];
31 $note_data = $NELTOOL['POST_VARS']['tool_form_note_data'];
32 $note_active = $NELTOOL['POST_VARS']['tool_form_note_active'];
33 $note_global = (isset($NELTOOL['POST_VARS']['tool_form_note_global']) ? $NELTOOL['POST_VARS']['tool_form_note_global'] : 0);
35 $note_mode = $NELTOOL['POST_VARS']['tool_form_note_mode'];
36 $note_uri = $NELTOOL['POST_VARS']['tool_form_note_popup_uri'];
37 $note_restriction = $NELTOOL['POST_VARS']['tool_form_note_popup_restriction'];
39 $tool_error = tool_notes_add($nel_user['user_id'], $note_title, $note_data, $note_active, $note_global, $note_mode, $note_uri, $note_restriction);
40 if ($tool_error != "")
42 $tpl->assign('tool_alert_message', $tool_error);
45 break;
47 case 'update':
49 $note_id = $NELTOOL['POST_VARS']['tool_form_note_id'];
50 $note_title = $NELTOOL['POST_VARS']['tool_form_note_title'];
51 $note_data = $NELTOOL['POST_VARS']['tool_form_note_data'];
52 $note_active = $NELTOOL['POST_VARS']['tool_form_note_active'];
53 $note_global = (isset($NELTOOL['POST_VARS']['tool_form_note_global']) ? $NELTOOL['POST_VARS']['tool_form_note_global'] : 0);
55 $note_mode = $NELTOOL['POST_VARS']['tool_form_note_mode'];
56 $note_uri = $NELTOOL['POST_VARS']['tool_form_note_popup_uri'];
57 $note_restriction = $NELTOOL['POST_VARS']['tool_form_note_popup_restriction'];
59 $tool_error = tool_notes_update($nel_user['user_id'], $note_id, $note_title, $note_data, $note_active, $note_global, $note_mode, $note_uri, $note_restriction);
60 if ($tool_error != "")
62 $tpl->assign('tool_alert_message', $tool_error);
66 break;
68 case 'delete':
70 $note_id = $NELTOOL['POST_VARS']['tool_form_note_id'];
71 tool_notes_del($nel_user['user_id'], $note_id);
73 break;
77 $tool_note_list = tool_notes_get_list($nel_user['user_id']);
78 $tpl->assign('tool_note_list', $tool_note_list);
81 $tpl->display('tool_notes.tpl');