Project

General

Profile

1 1064 Ruebenwurz
<?php
2 1289 kweitzel
/**
3
 *
4
 * @category        modules
5
 * @package         news
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 4.3.4 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18 1064 Ruebenwurz
19
require('../../config.php');
20
21
// Get id
22
if(!isset($_GET['group_id']) OR !is_numeric($_GET['group_id'])) {
23
	header("Location: ".ADMIN_URL."/pages/index.php");
24
	exit(0);
25
} else {
26
	$group_id = $_GET['group_id'];
27
}
28
29
// Include WB admin wrapper script
30
require(WB_PATH.'/modules/admin.php');
31
32
// Get header and footer
33
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_groups WHERE group_id = '$group_id'");
34
$fetch_content = $query_content->fetchRow();
35
36
?>
37
38
<h2><?php echo $TEXT['ADD'].'/'.$TEXT['MODIFY'].' '.$TEXT['GROUP']; ?></h2>
39
40
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_group.php" method="post" enctype="multipart/form-data" style="margin: 0;">
41
42
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
43
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
44
<input type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
45
46
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
47
<tr>
48
	<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
49
	<td>
50
		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 98%;" maxlength="255" />
51
	</td>
52
</tr>
53
<tr>
54
	<td><?php echo $TEXT['IMAGE']; ?>:</td>
55
	<?php if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg')) { ?>
56
	<td>
57
		<a href="<?php echo WB_URL.MEDIA_DIRECTORY; ?>/.news/image<?php echo $group_id; ?>.jpg" target="_blank">View</a>
58
		&nbsp;
59
		<input type="checkbox" name="delete_image" id="delete_image" value="true" />
60
		<label for="delete_image">Delete</label>
61
	</td>
62
	<?php } else { ?>
63
	<td>
64
		<input type="file" name="image" />
65
	</td>
66
	<?php } ?>
67
</tr>
68
<tr>
69
	<td><?php echo $TEXT['ACTIVE']; ?>:</td>
70
	<td>
71
		<input type="radio" name="active" id="active_true" value="1" <?php if($fetch_content['active'] == 1) { echo ' checked="checked"'; } ?> />
72
		<a href="#" onclick="javascript: document.getElementById('active_true').checked = true;">
73
		<?php echo $TEXT['YES']; ?>
74
		</a>
75
		-
76
		<input type="radio" name="active" id="active_false" value="0" <?php if($fetch_content['active'] == 0) { echo ' checked="checked"'; } ?> />
77
		<a href="#" onclick="javascript: document.getElementById('active_false').checked = true;">
78
		<?php echo $TEXT['NO']; ?>
79
		</a>
80
	</td>
81
</tr>
82
</table>
83
84
<table cellpadding="0" cellspacing="0" border="0" width="100%">
85
<tr>
86
	<td align="left">
87
		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
88
	</td>
89
	<td align="right">
90
		<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 100px; margin-top: 5px;" />
91
	</td>
92
</tr>
93
</table>
94
</form>
95
96
<?php
97
98
// Print admin footer
99
$admin->print_footer();
100
101 562 Ruebenwurz
?>