-
Notifications
You must be signed in to change notification settings - Fork 0
/
news_to_edit.php
33 lines (28 loc) · 914 Bytes
/
news_to_edit.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
include_once("includes/inc.global.php");
$cUser->MustBeLevel(1);
$p->site_section = EVENTS;
$p->page_title = "Choose Item to Edit";
include("includes/inc.forms.php");
include_once("classes/class.news.php");
$news = new cNewsGroup;
$news->LoadNewsGroup();
if($news_array = $news->MakeNewsArray()) {
$form->addElement("select", "news_id", "Which News Item?", $news_array);
$form->addElement("static", null, null, null);
$form->addElement('submit', 'btnSubmit', 'Edit');
} else {
$form->addElement("static", null, "There are no current news items.", 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."/news_edit.php?news_id=".$values["news_id"]);
exit;
}
?>