blob: 3198027f447a0c7ece5b78c2dbcb82739fd05da8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
<?php
require_once('include/menu.php');
function menu_post(&$a) {
if(! local_user())
return;
$channel = $a->get_channel();
$menu_id = ((argc() > 1) ? intval(argv(1)) : 0);
$menu_name = (($_REQUEST['menu_name']) ? $_REQUEST['menu_name'] : '');
$menu_desc = (($_REQUEST['menu_desc']) ? $_REQUEST['menu_desc'] : '');
}
function menu_content(&$a) {
if(! local_user()) {
notice( t('Permission denied.') . EOL);
return '';
}
if(argc() == 1) {
// list menus
}
if(argc() > 1) {
if(argv(1) === 'new') {
// new menu
}
elseif(intval(argv(1))) {
if(argc() == 3 && argv(2) == 'drop') {
$r = menu_delete_id(intval(argv(1)),local_user());
if($r)
info( t('Menu deleted.') . EOL);
else
notice( t('Menu could not be deleted.'). EOL);
goaway(z_root() . '/menu');
}
else {
// edit menu
}
}
}
}
|