Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2011, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 5.2.2 and higher
14
 * @version         $Id: modify_droplet.php 1684 2012-05-05 07:17:09Z Luisehahne $
15
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/droplets/modify_droplet.php $
16
 * @lastmodified    $Date: 2012-05-05 09:17:09 +0200 (Sat, 05 May 2012) $
17
 *
18
 */
19

    
20
require('../../config.php');
21

    
22
require_once(WB_PATH.'/framework/class.admin.php');
23
require_once(WB_PATH.'/framework/functions.php');
24

    
25
$admintool_link = ADMIN_URL .'/admintools/index.php';
26
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
27
$admin = new admin('admintools', 'admintools');
28

    
29
// Get id
30
$droplet_id = intval($admin->checkIDKEY('droplet_id', false, 'GET'));
31
if (!$droplet_id) {
32
	$admin->print_error('IDKEY::'.$MESSAGE['GENERIC_SECURITY_ACCESS'], $module_edit_link);
33
}
34
/*
35
// check if backend.css file needs to be included into the <body></body> of modify.php
36
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/droplets/backend.css")) {
37
	echo '<style type="text/css">';
38
	include(WB_PATH .'/modules/droplets/backend.css');
39
	echo "n</style>n";
40
}
41
*/
42
// Load Language file
43
if(LANGUAGE_LOADED) {
44
	if(!file_exists(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php')) {
45
		require_once(WB_PATH.'/modules/droplets/languages/EN.php');
46
	} else {
47
		require_once(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php');
48
	}
49
}
50
require_once(WB_PATH . '/include/editarea/wb_wrapper_edit_area.php');
51
echo registerEditArea ('contentedit','php',true,'both',true,true,600,450,'search, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, help');
52

    
53
$modified_when = time();
54
$modified_by = ($admin->ami_group_member('1') ? 1 : $admin->get_user_id());
55
$sOverviewDroplets = $TEXT['LIST_OPTIONS'].' '.$DR_TEXT['DROPLETS'];
56

    
57
// Get header and footer
58
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_droplets` ';
59
$sql .= 'WHERE id = '.$droplet_id;
60
$sql .= '';
61

    
62
$query_content = $database->query($sql);
63

    
64
$fetch_content = $query_content->fetchRow();
65
$content = (htmlspecialchars($fetch_content['code']));
66
?>
67
<h4 style="margin: 0; border-bottom: 1px solid #DDD; padding-bottom: 5px;">
68
	<a href="<?php echo $admintool_link;?>" title="<?php echo $HEADING['ADMINISTRATION_TOOLS']; ?>"><?php echo $HEADING['ADMINISTRATION_TOOLS']; ?></a>
69
	->
70
	<a href="<?php echo $module_edit_link;?>" title="<?php echo $sOverviewDroplets ?>" alt="<?php echo $sOverviewDroplets ?>">Droplet Edit</a>
71
</h4>
72
<br />
73
<form name="modify" action="<?php echo WB_URL; ?>/modules/droplets/save_droplet.php" method="post" style="margin: 0;">
74
<input type="hidden" name="data_codepress" value="" />
75
<input type="hidden" name="droplet_id" value="<?php echo $admin->getIDKEY($droplet_id); ?>" />
76
<input type="hidden" name="show_wysiwyg" value="<?php echo $fetch_content['show_wysiwyg']; ?>" />
77
<?php echo $admin->getFTAN(); ?>
78

    
79
<table class="row_a" cellpadding="4" cellspacing="0" border="0" width="100%">
80
		<tr>
81
		<td width="10%" class="setting_name">
82
			<?php echo $TEXT['NAME']; ?>:
83
		</td>
84
		<td width="90%">
85
			<input type="text" name="title" value="<?php echo stripslashes($fetch_content['name']); ?>" style="width: 38%;" maxlength="32" />
86
		</td>
87
	</tr>
88
	<tr>
89
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['DESCRIPTION']; ?>:</td>
90
		<td>
91
			<input type="text" name="description" value="<?php echo stripslashes($fetch_content['description']); ?>" style="width: 98%;" />
92
		</td>
93
	</tr>
94
	<tr>
95
		<td class="setting_name" width="60px">
96
			<?php echo $TEXT['ACTIVE']; ?>:
97
		</td>
98
		<td>	
99
			<input type="radio" name="active" id="active_true" value="1" <?php if($fetch_content['active'] == 1) { echo ' checked="checked"'; } ?> />
100
			<a href="#" onclick="javascript: document.getElementById('active_true').checked = true;">
101
			<label><?php echo $TEXT['YES']; ?></label>
102
			</a>
103
			<input type="radio" name="active" id="active_false" value="0" <?php if($fetch_content['active'] == 0) { echo ' checked="checked"'; } ?> />
104
			<a href="#" onclick="javascript: document.getElementById('active_false').checked = true;">
105
			<label><?php echo $TEXT['NO']; ?></label>
106
			</a>
107
		</td>
108
	</tr>
109
<?php
110
// Next show only if admin is logged in, user_id = 1
111
if ($modified_by == 1) {
112
	?>
113
	<tr>
114
		<td class="setting_name" width="60px">
115
			<?php echo $TEXT['ADMIN']; ?>:
116
		</td>
117
		<td> 
118
			<?php echo $DR_TEXT['ADMIN_EDIT']; ?>&nbsp;   	
119
			<input type="radio" name="admin_edit" id="admin_edit_true" value="1" <?php if($fetch_content['admin_edit'] == 1) { echo ' checked="checked"'; } ?> />
120
			<a href="#" onclick="javascript: document.getElementById('admin_edit_true').checked = true;">
121
			<label><?php echo $TEXT['YES']; ?></label>
122
			</a>
123
			<input type="radio" name="admin_edit" id="admin_edit_false" value="0" <?php if($fetch_content['admin_edit'] == 0) { echo ' checked="checked"'; } ?> />
124
			<a href="#" onclick="javascript: document.getElementById('admin_edit_false').checked = true;">
125
			<label><?php echo $TEXT['NO']; ?></label>
126
			</a>
127
			&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
128
			<?php echo $DR_TEXT['ADMIN_VIEW']; ?>:
129
			<input type="radio" name="admin_view" id="admin_view_true" value="1" <?php if($fetch_content['admin_view'] == 1) { echo ' checked="checked"'; } ?> />
130
			<a href="#" onclick="javascript: document.getElementById('admin_view_true').checked = true;">
131
			<label><?php echo $TEXT['YES']; ?></label>
132
			</a>
133
			<input type="radio" name="admin_view" id="admin_view_false" value="0" <?php if($fetch_content['admin_view'] == 0) { echo ' checked="checked"'; } ?> />
134
			<a href="#" onclick="javascript: document.getElementById('admin_view_false').checked = true;">
135
			<label><?php echo $TEXT['NO']; ?></label>
136
			</a>
137
		</td>
138
	</tr>
139
	<?php
140
}
141
?>
142
	<tr>
143
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['CODE']; ?>:</td>
144
		<td ><textarea name="savecontent" id ="contentedit" style="width: 98%; height: 450px;" rows="50" cols="120"><?php echo $content; ?></textarea>&nbsp;
145
		</td>
146
	</tr>
147
	<tr>
148
		<td colspan="2">					
149
		</td>
150
	</tr>
151
	<tr>
152
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['COMMENTS']; ?>:</td>
153
		<td>
154
			<textarea name="comments" style="width: 98%; height: 100px;" rows="50" cols="120"><?php echo stripslashes($fetch_content['comments']); ?></textarea>
155
		</td>
156
	</tr>
157
	<tr>
158
		<td colspan="2">&nbsp;					
159
		</td>
160
	</tr>
161
</table>
162
<br />
163
<table cellpadding="0" cellspacing="0" border="0" width="100%">
164
	<tr>
165
		<td align="left">
166
<?php
167
// Show only save button if allowed....
168
if ($modified_by == 1 OR $fetch_content['admin_edit'] == 0 ) {
169
	?>
170
			<button  class="save" name="save" type="submit"><?php echo $TEXT['SAVE']; ?></button>
171
	<?php
172
}
173
?>
174
		</td>
175
		<td align="right">
176
			<button class="cancel" type="button" onclick="javascript: window.location = '<?php echo $module_edit_link; ?>';"><?php echo $TEXT['CANCEL']; ?></button>
177
		</td>
178
	</tr>
179
</table>
180
</form>
181
<?php
182

    
183
// Print admin footer
184
$admin->print_footer();
(10-10/15)