1 |
2
|
Manuela
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category modules
|
5 |
|
|
* @package news
|
6 |
|
|
* @author WebsiteBaker Project
|
7 |
|
|
* @copyright WebsiteBaker Org. e.V.
|
8 |
|
|
* @link http://websitebaker.org/
|
9 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
10 |
|
|
* @platform WebsiteBaker 2.8.3
|
11 |
|
|
* @requirements PHP 5.3.6 and higher
|
12 |
|
|
* @version $Id$
|
13 |
|
|
* @filesource $HeadURL$
|
14 |
|
|
* @lastmodified $Date$
|
15 |
|
|
*
|
16 |
|
|
*/
|
17 |
|
|
|
18 |
|
|
if ( !defined( 'WB_PATH' ) ){ require( dirname(dirname((__DIR__))).'/config.php' ); }
|
19 |
|
|
|
20 |
|
|
// suppress to print the header, so no new FTAN will be set
|
21 |
|
|
//$admin_header = false;
|
22 |
|
|
// Tells script to update when this page was last updated
|
23 |
|
|
$update_when_modified = false;
|
24 |
|
|
// show the info banner
|
25 |
|
|
$print_info_banner = true;
|
26 |
|
|
// Include WB admin wrapper script
|
27 |
|
|
require(WB_PATH.'/modules/admin.php');
|
28 |
|
|
/* */
|
29 |
|
|
$group_id = intval($admin->checkIDKEY('group_id', false, 'GET'));
|
30 |
|
|
if (!$group_id) {
|
31 |
|
|
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
// Get header and footer
|
35 |
|
|
$sql = 'SELECT * FROM '.TABLE_PREFIX.'mod_news_groups '
|
36 |
|
|
. 'WHERE group_id = '.$group_id;
|
37 |
|
|
$query_content = $database->query( $sql );
|
38 |
|
|
|
39 |
|
|
$fetch_content = $query_content->fetchRow( MYSQLI_ASSOC );
|
40 |
|
|
|
41 |
|
|
?>
|
42 |
|
|
|
43 |
|
|
<h2><?php echo $TEXT['ADD'].'/'.$TEXT['MODIFY'].' '.$TEXT['GROUP']; ?></h2>
|
44 |
|
|
|
45 |
|
|
<form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_group.php" method="post" enctype="multipart/form-data" style="margin: 0;">
|
46 |
|
|
<?php echo $admin->getFTAN(); ?>
|
47 |
|
|
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
|
48 |
|
|
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
|
49 |
|
|
<input type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
|
50 |
|
|
<table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
|
51 |
|
|
<tr>
|
52 |
|
|
<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
|
53 |
|
|
<td>
|
54 |
|
|
<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 98%;" maxlength="255" />
|
55 |
|
|
</td>
|
56 |
|
|
</tr>
|
57 |
|
|
<tr>
|
58 |
|
|
<td><?php echo $TEXT['IMAGE']; ?>:</td>
|
59 |
|
|
<?php if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg')) { ?>
|
60 |
|
|
<td>
|
61 |
|
|
<a href="<?php echo WB_URL.MEDIA_DIRECTORY; ?>/.news/image<?php echo $group_id; ?>.jpg" target="_blank">View</a>
|
62 |
|
|
|
63 |
|
|
<input type="checkbox" name="delete_image" id="delete_image" value="true" />
|
64 |
|
|
<label for="delete_image">Delete</label>
|
65 |
|
|
</td>
|
66 |
|
|
<?php } else { ?>
|
67 |
|
|
<td>
|
68 |
|
|
<input type="file" name="image" />
|
69 |
|
|
</td>
|
70 |
|
|
<?php } ?>
|
71 |
|
|
</tr>
|
72 |
|
|
<tr>
|
73 |
|
|
<td><?php echo $TEXT['ACTIVE']; ?>:</td>
|
74 |
|
|
<td>
|
75 |
|
|
<input type="radio" name="active" id="active_true" value="1" <?php if($fetch_content['active'] == 1) { echo ' checked="checked"'; } ?> />
|
76 |
|
|
<a href="#" onclick="javascript: document.getElementById('active_true').checked = true;">
|
77 |
|
|
<?php echo $TEXT['YES']; ?>
|
78 |
|
|
</a>
|
79 |
|
|
-
|
80 |
|
|
<input type="radio" name="active" id="active_false" value="0" <?php if($fetch_content['active'] == 0) { echo ' checked="checked"'; } ?> />
|
81 |
|
|
<a href="#" onclick="javascript: document.getElementById('active_false').checked = true;">
|
82 |
|
|
<?php echo $TEXT['NO']; ?>
|
83 |
|
|
</a>
|
84 |
|
|
</td>
|
85 |
|
|
</tr>
|
86 |
|
|
</table>
|
87 |
|
|
|
88 |
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
89 |
|
|
<tr>
|
90 |
|
|
<td align="left">
|
91 |
|
|
<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
|
92 |
|
|
</td>
|
93 |
|
|
<td align="right">
|
94 |
|
|
<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;" />
|
95 |
|
|
</td>
|
96 |
|
|
</tr>
|
97 |
|
|
</table>
|
98 |
|
|
</form>
|
99 |
|
|
|
100 |
|
|
<?php
|
101 |
|
|
|
102 |
|
|
// Print admin footer
|
103 |
|
|
$admin->print_footer();
|