File: adminhome.php

package info (click to toggle)
webcalendar 0.9.45-4sarge7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,888 kB
  • ctags: 4,775
  • sloc: php: 16,990; sql: 1,272; perl: 777; sh: 120; makefile: 45
file content (141 lines) | stat: -rw-r--r-- 2,972 bytes parent folder | download
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/*
 * $Id: adminhome.php,v 1.12 2004/11/30 15:07:10 cknudsen Exp $
 *
 * Page Description:
 *	Serves as the home page for administrative functions.
 *
 * Input Parameters:
 *	None
 *
 * Security:
 *	Admin users will see different options available on this page.
 *
 */
include_once 'includes/init.php';

if ( empty ( $TODAYCELLBG ) )
  $TODAYCELLBG = '#C0C0C0';

$COLUMNS = 3;

$style = "
<style type=\"text/css\">
table.admin {
  padding: 5px;
  border: 1px solid #000000;
  background-color: #CCCCCC;
}
table.admin td {
  padding: 20px;
  text-align: center;
}
.admin td a {
  padding: 10px;
  width: 200px;
  text-align: center;
  background-color: #CCCCCC;
  border-top: 1px solid #EEEEEE;
  border-left: 1px solid #EEEEEE;
  border-bottom: 1px solid #777777;
  border-right: 1px solid #777777;
}
.admin td a:hover {
  padding: 10px;
  width: 200px;
  text-align: center;
  background-color: #AAAAAA;
  border-top: 1px solid #777777;
  border-left: 1px solid #777777;
  border-bottom: 1px solid #EEEEEE;
  border-right: 1px solid #EEEEEE;
}
</style>
";
print_header('', $style);

$names = array ();
$links = array ();

if ( $is_admin ) {
  $names[] = translate("System Settings");
  $links[] = "admin.php";
}

$names[] = translate("Preferences");
$links[] = "pref.php";

if ( $is_admin ) {
  $names[] = translate("Users");
  $links[] = "users.php";
} else {
  $names[] = translate("Account");
  $links[] = "edit_user.php";
}

if ( $single_user != 'Y' ) {
  $names[] = translate("Assistants");
  $links[] = "assistant_edit.php";
}

if ( $categories_enabled == 'Y' ) {
  $names[] = translate("Categories");
  $links[] = "category.php";
}

$names[] = translate("Views");
$links[] = "views.php";

$names[] = translate("Layers");
$links[] = "layers.php";

if ( $reports_enabled == 'Y' ) {
  $names[] = translate("Reports");
  $links[] = "report.php";
}

if ( $is_admin ) {
  $names[] = translate("Delete Events");
  $links[] = "purge.php";

  $names[] = translate("Activity Log");
  $links[] = "activity_log.php";
}

if ( $is_admin && ! empty ( $public_access ) && $public_access == 'Y' ) {
  $names[] = translate("Public Preferences");
  $links[] = "pref.php?public=1";
}

if ( $is_admin && ! empty ( $public_access ) && $public_access == 'Y' &&
  $public_access_can_add == 'Y' && $public_access_add_needs_approval == 'Y' ) {
  $names[] = translate("Unapproved Public Events");
  $links[] = "list_unapproved.php?user=__public__";
}
?>

<h2><?php etranslate("Administrative Tools")?></h2>

<table class="admin">
<?php
  for ( $i = 0; $i < count ( $names ); $i++ ) {
  if ( $i % $COLUMNS == 0 )
    echo "<tr>\n";
    echo "<td>";
    if ( ! empty ( $links[$i] ) )
      echo "<a href=\"$links[$i]\">";
    echo $names[$i];
    if ( ! empty ( $links[$i] ) )
      echo "</a>";
    echo "</td>\n";
    if ( $i % $COLUMNS == $COLUMNS - 1 )
       echo "</tr>\n";
  }
  if ( $i % $COLUMNS != 0 )
    echo "</tr>\n";
?>
</table>

<?php print_trailer(); ?>
</body>
</html>