1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category modules
|
5
|
* @package wysiwyg
|
6
|
* @author WebsiteBaker Project
|
7
|
* @copyright 2009-2012, Website Baker Org. e.V.
|
8
|
* @link http://www.websitebaker2.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.3
|
11
|
* @requirements PHP 5.2.2 and higher
|
12
|
* @version $Id: modify.php 1652 2012-03-27 10:35:26Z Luisehahne $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/wysiwyg/modify.php $
|
14
|
* @lastmodified $Date: 2012-03-27 12:35:26 +0200 (Tue, 27 Mar 2012) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
/* -------------------------------------------------------- */
|
19
|
// Must include code to stop this file being accessed directly
|
20
|
if(!defined('WB_PATH')) {
|
21
|
require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
|
22
|
throw new IllegalFileException();
|
23
|
}
|
24
|
/* -------------------------------------------------------- */
|
25
|
|
26
|
$sMediaUrl = WB_URL.MEDIA_DIRECTORY;
|
27
|
// Get page content
|
28
|
$sql = 'SELECT `content` FROM `'.TABLE_PREFIX.'mod_wysiwyg` WHERE `section_id`='.(int)$section_id;
|
29
|
if ( ($content = $database->get_one($sql)) ) {
|
30
|
$content = htmlspecialchars(str_replace('{SYSVAR:MEDIA_REL}', $sMediaUrl, $content));
|
31
|
}else {
|
32
|
$content = '';
|
33
|
}
|
34
|
|
35
|
if(!function_exists('show_wysiwyg_editor'))
|
36
|
{
|
37
|
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php'))
|
38
|
{
|
39
|
function show_wysiwyg_editor($name,$id,$content,$width,$height)
|
40
|
{
|
41
|
echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
|
42
|
}
|
43
|
} else {
|
44
|
require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
|
45
|
}
|
46
|
}
|
47
|
|
48
|
?>
|
49
|
<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post">
|
50
|
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
|
51
|
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
|
52
|
<?php
|
53
|
echo $admin->getFTAN()."\n";
|
54
|
echo show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
|
55
|
?>
|
56
|
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
|
57
|
<tr>
|
58
|
<td align="left">
|
59
|
<input type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
|
60
|
</td>
|
61
|
<td align="right">
|
62
|
<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
|
63
|
</td>
|
64
|
</tr>
|
65
|
</table>
|
66
|
</form>
|
67
|
<br />
|