forked from grinnellplans/grinnellplans-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
customize.php
executable file
·33 lines (33 loc) · 1.45 KB
/
customize.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
<?php
require_once ('Plans.php');
require ('functions-main.php');
require ('syntax-classes.php');
$dbh = db_connect();
$idcookie = User::id();
// initialize page classes
$thispage = new PlansPage('Preferences', 'prefs', PLANSVNAME . ' - Preferences', 'customize.php');
if (!User::logged_in()) {
populate_guest_page($thispage);
$denied = new AlertText('You are not allowed to edit as a guest.', 'Access Denied');
$thispage->append($denied);
} else {
populate_page($thispage, $dbh, $idcookie);
$heading = new HeadingText('Preferences', 1);
$thispage->append($heading);
$preflist = new WidgetList('preflist', "Preferences");
// make the list of preference pages
$arr = array('Change Password' => "changepassword.php", 'Change Name' => "changename.php", 'Change Permanent Email' => 'changeemail.php', 'Guest Readable' => "webview.php", "Blocking" => 'blocks.php', 'Customize' => '', 'Interfaces' => "interfaces.php", 'Styles' => "styles.php", 'Edit Text Box Size' => "textbox.php", 'Optional Links' => "links.php");
foreach($arr as $name => $ref) {
if (strtolower($name) != 'customize') {
$alink = new Hyperlink('preflink', false, $ref, $name);
$preflist->append($alink);
} else {
$aheading = new HeadingText('Customize', 2);
$preflist->append($aheading);
}
}
$thispage->append($preflist);
} //if is a valid user
interface_disp_page($thispage);
db_disconnect($dbh);
?>