Revision 1273
Added by Dietmar over 14 years ago
edit_module_files.php | ||
---|---|---|
72 | 72 |
|
73 | 73 |
// check if the module directory is valid |
74 | 74 |
$mod_dir = check_module_dir($_POST['mod_dir']); |
75 |
if($mod_dir == '') { |
|
75 |
if($mod_dir == '') |
|
76 |
{ |
|
76 | 77 |
echo 'The specified module directory is invalid - script stopped.'; |
77 | 78 |
die; |
78 | 79 |
}; |
... | ... | |
88 | 89 |
} |
89 | 90 |
|
90 | 91 |
$bytes = 0; |
91 |
if ($css_content != '') { |
|
92 |
if ($css_content != '') |
|
93 |
{ |
|
92 | 94 |
// open the module CSS file for writting |
93 | 95 |
$mod_file = @fopen(WB_PATH .'/modules/' .$mod_dir .'/' .$_POST['edit_file'], 'wb'); |
94 | 96 |
// write new content to the module CSS file |
... | ... | |
98 | 100 |
} |
99 | 101 |
|
100 | 102 |
// write out status message |
101 |
if($bytes == 0 ) { |
|
103 |
if($bytes == 0 ) |
|
104 |
{ |
|
102 | 105 |
$admin->print_error($TEXT['ERROR'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
103 | 106 |
} else { |
104 | 107 |
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); |
... | ... | |
121 | 124 |
$css_file = (in_array($_POST['edit_file'], array('frontend.css', 'backend.css'))) ? $_POST['edit_file'] : ''; |
122 | 125 |
|
123 | 126 |
// display output |
124 |
if($css_file == '') { |
|
127 |
if($css_file == '') |
|
128 |
{ |
|
125 | 129 |
// no valid module file to edit; display error message and backlink to modify.php |
126 | 130 |
echo "<h2>Nothing to edit</h2>"; |
127 | 131 |
echo "<p>No valid module file exists for this module.</p>"; |
... | ... | |
146 | 150 |
<input type="hidden" name="mod_dir" value="<?php echo $mod_dir; ?>" /> |
147 | 151 |
<input type="hidden" name="edit_file" value="<?php echo $css_file; ?>" /> |
148 | 152 |
<input type="hidden" name="action" value="save" /> |
149 |
<textarea id="code_area" name="css_data" cols="115" rows="25" wrap="VIRTUAL" style="margin:2px;"><?php |
|
153 |
<textarea id="code_area" name="css_data" cols="115" rows="25" wrap="VIRTUAL" style="margin:2px;width:100%;"><?php
|
|
150 | 154 |
echo htmlspecialchars($css_content); ?> |
151 | 155 |
</textarea> |
156 |
<?php |
|
152 | 157 |
|
158 |
?> |
|
153 | 159 |
<table cellpadding="0" cellspacing="0" border="0" width="100%"> |
154 | 160 |
<tr> |
155 |
<td align="left">
|
|
161 |
<td class="left">
|
|
156 | 162 |
<input name="save" type="submit" value="<?php echo $TEXT['SAVE'];?>" style="width: 100px; margin-top: 5px;" /> |
157 | 163 |
</td> |
158 |
<td align="right">
|
|
164 |
<td class="right">
|
|
159 | 165 |
<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" |
160 | 166 |
onclick="javascript: window.location = '<?php echo ADMIN_URL;?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" |
161 | 167 |
style="width: 100px; margin-top: 5px;" /> |
Also available in: Unified diff
Ticket #921 Update EditArea framework
fix stylings wb_theme, fix upgradescript