-
Notifications
You must be signed in to change notification settings - Fork 6
/
edit_info.php
41 lines (31 loc) · 963 Bytes
/
edit_info.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
<?php
include_once("includes/inc.global.php");
$cUser->MustBeLevel(1);
$p->site_section = EVENTS;
$p->page_title = _("Choose Info Page to Edit");
include("includes/inc.forms.php");
include_once("classes/class.info.php");
$pgs = cInfo::LoadPages();
if ($pgs) {
foreach($pgs as $pg) {
$p_array[$pg["id"]] = stripslashes($pg["title"]);
}
$form->addElement("select", "news_id", _("Which Info Page?"), $p_array);
$form->addElement("static", null, null, null);
$form->addElement('submit', 'btnSubmit', _("Edit"));
}
else {
$form->addElement("static", null, _("There are no current Info Pages."), null);
}
if ($form->validate()) { // Form is validated so processes the data
$form->freeze();
$form->process("process_data", false);
} else { // Display the form
$p->DisplayPage($form->toHtml());
}
function process_data ($values) {
global $cUser;
header("location:http://".HTTP_BASE."/do_info_edit.php?id=".$values["news_id"]);
exit;
}
?>