-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsneak.php
66 lines (50 loc) · 2.04 KB
/
sneak.php
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
62
63
64
65
66
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
require_once __DIR__.'/config.php';
require_once mnminclude.'html1.php';
require_once mnminclude.'sneak.php';
$globals['favicon'] = 'img/favicons/favicon-sneaker.ico';
init_sneak();
// Check the tab options and set corresponging JS variables
if ($current_user->user_id > 0) {
if (!empty($_REQUEST['friends'])) {
$option = _('amigos');
} elseif (!empty($_REQUEST['admin']) && $current_user->admin) {
$option = _('admin');
} else {
$option = _('todos');
}
// Haanga::Load('sneak/tabs.html', compact('option'));
}
//////
// Start html
$globals['extra_css'][] = 'es/sneak.css';
if (!empty($_REQUEST['friends'])) {
do_header(_('amigos en la fisgona'), _('fisgona'), sneak_menu_items($option));
} elseif ($current_user->user_id > 0 && !empty($_REQUEST['admin']) && $current_user->admin) {
do_header(_('admin'), _('fisgona'), sneak_menu_items($option));
} else {
do_header(_('fisgona'), _('fisgona'), sneak_menu_items($option));
}
$globals['site_id'] = SitesMgr::my_id();
Haanga::Load('sneak/base.html');
$globals['sneak_telnet'] = false;
Haanga::Load('sneak/form.html', compact('max_items'));
do_footer();
function sneak_menu_items($id)
{
global $globals, $current_user;
$items = array();
$items[] = new MenuOption(_('todos'), $globals['base_url'].'sneak', $id, _('todos'));
$items[] = new MenuOption(_('amigos'), $globals['base_url'].'sneak?friends=1', $id, _('amigos'));
if ($current_user->admin) {
$items[] = new MenuOption(_('admin'), $globals['base_url'].'sneak?admin=1', $id, _('admin'));
}
$items[] = new MenuOption(_('consola'), $globals['base_url'].'telnet', $id, _('consola'));
return $items;
}