Project

General

Profile

1 1425 Luisehahne
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6 1741 Luisehahne
 * @author          Ruud Eisinga (Ruud) John (PCWacht),WebsiteBaker Project
7
 * @copyright       2009-2012, Website Baker Org. e.V.
8 1425 Luisehahne
 * @link			http://www.websitebaker2.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id$
13
 * @filesource		$HeadURL$
14
 * @lastmodified    $Date$
15
 *
16
 */
17
18
require('../../config.php');
19
20
require_once(WB_PATH.'/framework/class.admin.php');
21
require_once(WB_PATH.'/framework/functions.php');
22
23
$admintool_link = ADMIN_URL .'/admintools/index.php';
24
$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
25
$admin = new admin('admintools', 'admintools');
26
27
// Get id
28 1503 Luisehahne
$droplet_id = intval($admin->checkIDKEY('droplet_id', false, 'GET'));
29 1425 Luisehahne
if (!$droplet_id) {
30 1503 Luisehahne
	$admin->print_error('IDKEY::'.$MESSAGE['GENERIC_SECURITY_ACCESS'], $module_edit_link);
31 1425 Luisehahne
}
32 1503 Luisehahne
/*
33 1425 Luisehahne
// check if backend.css file needs to be included into the <body></body> of modify.php
34
if(!method_exists($admin, 'register_backend_modfiles') && file_exists(WB_PATH ."/modules/droplets/backend.css")) {
35
	echo '<style type="text/css">';
36
	include(WB_PATH .'/modules/droplets/backend.css');
37
	echo "n</style>n";
38
}
39 1503 Luisehahne
*/
40 1425 Luisehahne
// Load Language file
41
if(LANGUAGE_LOADED) {
42
	if(!file_exists(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php')) {
43
		require_once(WB_PATH.'/modules/droplets/languages/EN.php');
44
	} else {
45
		require_once(WB_PATH.'/modules/droplets/languages/'.LANGUAGE.'.php');
46
	}
47
}
48
require_once(WB_PATH . '/include/editarea/wb_wrapper_edit_area.php');
49
echo registerEditArea ('contentedit','php',true,'both',true,true,600,450,'search, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, help');
50
51
$modified_when = time();
52 1684 Luisehahne
$modified_by = ($admin->ami_group_member('1') ? 1 : $admin->get_user_id());
53 1503 Luisehahne
$sOverviewDroplets = $TEXT['LIST_OPTIONS'].' '.$DR_TEXT['DROPLETS'];
54 1425 Luisehahne
55
// Get header and footer
56 1503 Luisehahne
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_droplets` ';
57
$sql .= 'WHERE id = '.$droplet_id;
58
$sql .= '';
59
60
$query_content = $database->query($sql);
61
62 1425 Luisehahne
$fetch_content = $query_content->fetchRow();
63
$content = (htmlspecialchars($fetch_content['code']));
64
?>
65 1741 Luisehahne
<div class="droplets" style="margin-top: 6px;">
66 1425 Luisehahne
<h4 style="margin: 0; border-bottom: 1px solid #DDD; padding-bottom: 5px;">
67 1503 Luisehahne
	<a href="<?php echo $admintool_link;?>" title="<?php echo $HEADING['ADMINISTRATION_TOOLS']; ?>"><?php echo $HEADING['ADMINISTRATION_TOOLS']; ?></a>
68 1741 Luisehahne
	<span> &raquo; </span>
69
	<a href="<?php echo $module_edit_link;?>" title="<?php echo $sOverviewDroplets ?>" alt="<?php echo $sOverviewDroplets ?>">Droplet Overview</a>
70 1425 Luisehahne
</h4>
71
<br />
72
<form name="modify" action="<?php echo WB_URL; ?>/modules/droplets/save_droplet.php" method="post" style="margin: 0;">
73
<input type="hidden" name="data_codepress" value="" />
74 1503 Luisehahne
<input type="hidden" name="droplet_id" value="<?php echo $admin->getIDKEY($droplet_id); ?>" />
75 1425 Luisehahne
<input type="hidden" name="show_wysiwyg" value="<?php echo $fetch_content['show_wysiwyg']; ?>" />
76
<?php echo $admin->getFTAN(); ?>
77
78
<table class="row_a" cellpadding="4" cellspacing="0" border="0" width="100%">
79
		<tr>
80
		<td width="10%" class="setting_name">
81
			<?php echo $TEXT['NAME']; ?>:
82
		</td>
83
		<td width="90%">
84
			<input type="text" name="title" value="<?php echo stripslashes($fetch_content['name']); ?>" style="width: 38%;" maxlength="32" />
85
		</td>
86
	</tr>
87
	<tr>
88
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['DESCRIPTION']; ?>:</td>
89
		<td>
90
			<input type="text" name="description" value="<?php echo stripslashes($fetch_content['description']); ?>" style="width: 98%;" />
91
		</td>
92
	</tr>
93
	<tr>
94
		<td class="setting_name" width="60px">
95
			<?php echo $TEXT['ACTIVE']; ?>:
96
		</td>
97 1741 Luisehahne
		<td>
98 1425 Luisehahne
			<input type="radio" name="active" id="active_true" value="1" <?php if($fetch_content['active'] == 1) { echo ' checked="checked"'; } ?> />
99
			<a href="#" onclick="javascript: document.getElementById('active_true').checked = true;">
100
			<label><?php echo $TEXT['YES']; ?></label>
101
			</a>
102
			<input type="radio" name="active" id="active_false" value="0" <?php if($fetch_content['active'] == 0) { echo ' checked="checked"'; } ?> />
103
			<a href="#" onclick="javascript: document.getElementById('active_false').checked = true;">
104
			<label><?php echo $TEXT['NO']; ?></label>
105
			</a>
106
		</td>
107
	</tr>
108
<?php
109
// Next show only if admin is logged in, user_id = 1
110
if ($modified_by == 1) {
111
	?>
112
	<tr>
113
		<td class="setting_name" width="60px">
114
			<?php echo $TEXT['ADMIN']; ?>:
115
		</td>
116 1741 Luisehahne
		<td>
117
			<?php echo $DR_TEXT['ADMIN_EDIT']; ?>&nbsp;
118 1425 Luisehahne
			<input type="radio" name="admin_edit" id="admin_edit_true" value="1" <?php if($fetch_content['admin_edit'] == 1) { echo ' checked="checked"'; } ?> />
119
			<a href="#" onclick="javascript: document.getElementById('admin_edit_true').checked = true;">
120
			<label><?php echo $TEXT['YES']; ?></label>
121
			</a>
122
			<input type="radio" name="admin_edit" id="admin_edit_false" value="0" <?php if($fetch_content['admin_edit'] == 0) { echo ' checked="checked"'; } ?> />
123
			<a href="#" onclick="javascript: document.getElementById('admin_edit_false').checked = true;">
124
			<label><?php echo $TEXT['NO']; ?></label>
125
			</a>
126 1741 Luisehahne
			&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
127 1425 Luisehahne
			<?php echo $DR_TEXT['ADMIN_VIEW']; ?>:
128
			<input type="radio" name="admin_view" id="admin_view_true" value="1" <?php if($fetch_content['admin_view'] == 1) { echo ' checked="checked"'; } ?> />
129
			<a href="#" onclick="javascript: document.getElementById('admin_view_true').checked = true;">
130
			<label><?php echo $TEXT['YES']; ?></label>
131
			</a>
132
			<input type="radio" name="admin_view" id="admin_view_false" value="0" <?php if($fetch_content['admin_view'] == 0) { echo ' checked="checked"'; } ?> />
133
			<a href="#" onclick="javascript: document.getElementById('admin_view_false').checked = true;">
134
			<label><?php echo $TEXT['NO']; ?></label>
135
			</a>
136
		</td>
137
	</tr>
138
	<?php
139
}
140
?>
141
	<tr>
142
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['CODE']; ?>:</td>
143
		<td ><textarea name="savecontent" id ="contentedit" style="width: 98%; height: 450px;" rows="50" cols="120"><?php echo $content; ?></textarea>&nbsp;
144
		</td>
145
	</tr>
146
	<tr>
147 1741 Luisehahne
		<td colspan="2">
148 1425 Luisehahne
		</td>
149
	</tr>
150
	<tr>
151
		<td valign="top" class="setting_name" width="60px"><?php echo $TEXT['COMMENTS']; ?>:</td>
152
		<td>
153
			<textarea name="comments" style="width: 98%; height: 100px;" rows="50" cols="120"><?php echo stripslashes($fetch_content['comments']); ?></textarea>
154
		</td>
155
	</tr>
156
	<tr>
157 1741 Luisehahne
		<td colspan="2">&nbsp;
158 1425 Luisehahne
		</td>
159
	</tr>
160
</table>
161
<br />
162
<table cellpadding="0" cellspacing="0" border="0" width="100%">
163
	<tr>
164
		<td align="left">
165
<?php
166
// Show only save button if allowed....
167
if ($modified_by == 1 OR $fetch_content['admin_edit'] == 0 ) {
168
	?>
169
			<button  class="save" name="save" type="submit"><?php echo $TEXT['SAVE']; ?></button>
170
	<?php
171
}
172
?>
173
		</td>
174
		<td align="right">
175
			<button class="cancel" type="button" onclick="javascript: window.location = '<?php echo $module_edit_link; ?>';"><?php echo $TEXT['CANCEL']; ?></button>
176
		</td>
177
	</tr>
178
</table>
179
</form>
180 1741 Luisehahne
</div>
181 1425 Luisehahne
<?php
182
183
// Print admin footer
184
$admin->print_footer();