-
Notifications
You must be signed in to change notification settings - Fork 0
/
tiki-admin.php
253 lines (225 loc) · 10.7 KB
/
tiki-admin.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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<?php
// $Header: /cvsroot-fuse/tikiwiki/tiki/tiki-admin.php,v 1.100.2.29 2006/09/03 16:32:30 ohertel Exp $
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Initialization
require_once ('tiki-setup.php');
include_once ('lib/admin/adminlib.php');
$tikifeedback = array();
if ($tiki_p_admin != 'y') {
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
function simple_set_toggle($feature) {
global $_REQUEST, $tikilib, $smarty, $tikifeedback, $$feature;
if (isset($_REQUEST[$feature]) && $_REQUEST[$feature] == "on") {
if (isset($$feature) && $$feature != 'y') {
$tikilib->set_preference($feature, 'y');
$smarty->assign($feature, 'y');
$tikifeedback[] = array('num'=>1,'mes'=>sprintf(tra("%s enabled"),$feature));
}
} else {
if (isset($$feature) && $$feature != 'n') {
$tikilib->set_preference($feature, 'n');
$smarty->assign($feature, 'n');
$tikifeedback[] = array('num'=>1,'mes'=>sprintf(tra("%s disabled"),$feature));
}
}
}
function simple_set_value($feature) {
global $_REQUEST, $tikilib, $smarty;
if (isset($_REQUEST[$feature])) {
$tikilib->set_preference($feature, $_REQUEST[$feature]);
$smarty->assign($feature, $_REQUEST[$feature]);
}
}
function simple_set_int($feature) {
global $_REQUEST, $tikilib, $smarty;
if (isset($_REQUEST[$feature]) && is_numeric($_REQUEST[$feature])) {
$tikilib->set_preference($feature, $_REQUEST[$feature]);
$smarty->assign($feature, $_REQUEST[$feature]);
}
}
function byref_set_value($feature, $pref = "") {
global $_REQUEST, $tikilib, $smarty;
if (isset($_REQUEST[$feature])) {
if (strlen($pref) > 0) {
$tikilib->set_preference($pref, $_REQUEST[$feature]);
// also assign the ref appareantly --gongo
$smarty->assign_by_ref($pref, $_REQUEST[$feature]);
} else {
$tikilib->set_preference($feature, $_REQUEST[$feature]);
}
$smarty->assign_by_ref($feature, $_REQUEST[$feature]);
}
}
$home_blog = $tikilib->get_preference("home_blog", 0);
$smarty->assign('home_blog', $home_blog);
$home_forum = $tikilib->get_preference("home_forum", 0);
$smarty->assign('home_forum', $home_forum);
$home_gallery = $tikilib->get_preference("home_gallery", 0);
$smarty->assign('home_gallery', $home_gallery);
$home_file_gallery = $tikilib->get_preference("home_file_gallery", 0);
$smarty->assign('home_file_gallery', $home_file_gallery);
$crumbs[] = new Breadcrumb('Administration',
'Sections',
'tiki-admin.php',
'Tiki+Admin',
'Help on Configuration Sections');
if (isset($_REQUEST["page"])) {
$adminPage = $_REQUEST["page"];
$helpUrl='';
if ($adminPage == "features") {
$admintitle = "Features"; //get_strings tra("Features")
$description = "Enable/disable Tiki features here, but configure them elsewhere"; //get_strings tra("Enable/disable Tiki features here, but configure them elsewhere") TODO FOR EACH DESCRIPTION
$helpUrl = "Features Admin";
include_once ('tiki-admin_include_features.php');
} else if ($adminPage == "general") {
$admintitle = "General";//get_strings tra("General")
$description = "General preferences and settings";//get_strings tra("General preferences and settings")
$helpUrl = "General Admin";
include_once ('tiki-admin_include_general.php');
} else if ($adminPage == "login") {
$admintitle = "Login";//get_strings tra("Login")
$description = "User registration, login and authentication";//get_strings tra("User registration, login and authentication")
$helpUrl = "Login Config";
include_once ('tiki-admin_include_login.php');
} else if ($adminPage == "wiki") {
$admintitle = "Wiki";//get_strings tra("Wiki")
$description = "Wiki settings";//get_strings tra("Wiki settings")
include_once ('tiki-admin_include_wiki.php');
} else if ($adminPage == "wikiatt") {
$admintitle = "Wiki Attachments";//get_strings tra("Wiki Attachments")
$description = "Wiki attachments";//get_strings tra("Wiki attachments")
include_once ('tiki-admin_include_wikiatt.php');
} else if ($adminPage == "gal") {
$admintitle = "Image Galleries";//get_strings tra("Image Galleries")
$helpUrl = "Image+Galleries+Config";
$description = "Image galleries";//get_strings tra("Image galleries")
include_once ('tiki-admin_include_gal.php');
} else if ($adminPage == "fgal") {
$admintitle = "File Galleries";//get_strings tra("File Galleries")
$helpUrl = "File+Galleries+Config";
$description = "File galleries";//get_strings tra("File galleries")
include_once ('tiki-admin_include_fgal.php');
} else if ($adminPage == "cms") {
$admintitle = "Articles";//get_strings tra("Articles")
$helpUrl = "Articles+Config";
$description = "Article/CMS settings";//get_strings tra("Article/CMS settings")
include_once ('tiki-admin_include_cms.php');
} else if ($adminPage == "polls") {
$admintitle = "Polls";//get_strings tra("Polls")
$description = "Poll comments settings";//get_strings tra("Poll comments settings")
include_once ('tiki-admin_include_polls.php');
} else if ($adminPage == "blogs") {
$admintitle = "Blogs";//get_strings tra("Blogs")
$description = "Configuration options for all blogs on your site";//get_strings tra("Configuration options for all blogs on your site")
include_once ('tiki-admin_include_blogs.php');
} else if ($adminPage == "forums") {
$admintitle = "Forums";//get_strings tra("Forums")
$description = "Forums settings";//get_strings tra("Forums settings")
include_once ('tiki-admin_include_forums.php');
} else if ($adminPage == "faqs") {
$admintitle = "FAQs";//get_strings tra("FAQs")
$description = "FAQ comments settings";//get_strings tra("FAQ comments settings")
include_once ('tiki-admin_include_faqs.php');
} else if ($adminPage == "trackers") {
$admintitle = "Trackers";//get_strings tra("Trackers")
$description = "Trackers settings";//get_strings tra("Trackers settings")
include_once ('tiki-admin_include_trackers.php');
} else if ($adminPage == "webmail") {
$admintitle = "Webmail";//get_strings tra("Webmail")
$description = "Webmail";
include_once ('tiki-admin_include_webmail.php');
} else if ($adminPage == "rss") {
$admintitle = "RSS feeds";//get_strings tra("RSS feeds")
$description = "RSS settings";//get_strings tra("RSS settings")
include_once ('tiki-admin_include_rss.php');
} else if ($adminPage == "directory") {
$admintitle = "Directory";//get_strings tra("Directory")
$description = "Directory settings";//get_strings tra("Directory settings")
include_once ('tiki-admin_include_directory.php');
} else if ($adminPage == "userfiles") {
$admintitle = "User Files";//get_strings tra("User files")
$helpUrl = "User+Fles+Config";
$description = "User files";//get_strings tra("User files")
include_once ('tiki-admin_include_userfiles.php');
} else if ($adminPage == "maps") {
$admintitle = "Maps";//get_strings tra("Maps")
$description = "Maps configuration";//get_strings tra("Maps configuration")
include_once ('tiki-admin_include_maps.php');
} else if ($adminPage == "metatags") {
$admintitle = "Meta Tags";//get_strings tra("Meta Tags")
$helpUrl = "Meta+Tags+Config";
$description = "Meta Tags settings";//get_strings tra("Meta Tags settings")
include_once ('tiki-admin_include_metatags.php');
} else if ($adminPage == "search") {
$admintitle = "Search";//get_strings tra("Search")
$description = "Search settings";//get_strings tra("Search settings")
include_once ('tiki-admin_include_search.php');
} else if ($adminPage == "score") {
$admintitle = "Score";//get_strings tra("Score")
$description = "Score settings";//get_strings tra("Score settings")
include_once ('tiki-admin_include_score.php');
} else if ($adminPage == "projects") {
$admintitle = "Projects";//get_strings tra("Projects")
$description = "Projects configuration";//get_strings tra("Projects configuration")
include_once ('tiki-admin_include_projects.php');
} else if ($adminPage == "community") {
$admintitle = "Community";//get_strings tra("Community")
$description = "Community settings";//get_strings tra("Community settings")
include_once ('tiki-admin_include_community.php');
} else if ($adminPage == "siteid") {
$admintitle = "Site Identity";//get_strings tra("Site Identity")
$helpUrl = "Site+Logo+and+Identity+Config";
$description = "Site Identity features";//get_strings tra("Site Identity features")
include_once ('tiki-admin_include_siteid.php');
} else if ($adminPage == "calendar") {
$admintitle = "Calendar";//get_strings tra("Calendar")
$description = "Calendar settings";//get_strings tra("Calendar settings")
include_once ('tiki-admin_include_calendar.php');
} else if ($adminPage == "intertiki") {
$admintitle = "Intertiki";//get_strings tra("Intertiki")
$description = "Intertiki settings";//get_strings tra("Intertiki settings")
include_once ('tiki-admin_include_intertiki.php');
} else if ($adminPage == "gmap") {
$admintitle = "Google Maps";//get_strings tra("Google Maps")
$description = "Google Maps";//get_strings tra("Google Maps")
include_once ('tiki-admin_include_gmap.php');
} else if ($adminPage == "i18n") {
$admintitle = "i18n";//get_strings tra("i18n")
$description = "Internationalization";//get_strings tra("i18n")
$helpUrl = "Internationalization Admin";
include_once ('tiki-admin_include_i18n.php');
}
$url = 'tiki-admin.php'.'?page='.$adminPage;
if (!$helpUrl) {$helpUrl = ucfirst($adminPage)."+Config";}
$helpDescription = "Help on $admintitle Config";//get_strings tra("Help on $admintitle Config")
} else {
$smarty->assign('headtitle', breadcrumb_buildHeadTitle($crumbs));
$smarty->assign('description', $crumbs[0]->description);
}
if(isset($admintitle)) {
$admintitle = tra($admintitle);
$crumbs[] = new Breadcrumb($admintitle,
$description,
$url,
$helpUrl,
$helpDescription);
$smarty->assign_by_ref('admintitle', $admintitle);
$headtitle = breadcrumb_buildHeadTitle($crumbs);
$smarty->assign_by_ref('headtitle', $headtitle);
}
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
// Display the template
$smarty->assign('mid', 'tiki-admin.tpl');
if(isset($helpUrl)) $smarty->assign_by_ref('sectionhelp', $helpUrl);
if(isset($description)) $smarty->assign('description', $description);
$smarty->assign('trail', $crumbs);
$smarty->assign('crumb', count($crumbs)-1);
$smarty->display("tiki.tpl");
?>