Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         wysiwyg
6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2011, 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.x
11
 * @requirements    PHP 5.2.2 and higher
12
 * @version         $Id: modify.php 1538 2011-12-10 15:06:15Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/modules/wysiwyg/modify.php $
14
 * @lastmodified    $Date: 2011-12-10 16:06:15 +0100 (Sat, 10 Dec 2011) $
15
 *
16
 */
17

    
18
/* -------------------------------------------------------- */
19
if(defined('WB_PATH') == false)
20
{
21
	// Stop this file being access directly
22
		die('<head><title>Access denied</title></head><body><h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2></body></html>');
23
}
24
/* -------------------------------------------------------- */
25

    
26
// Get page content
27
$query = "SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$section_id'";
28
$get_content = $database->query($query);
29
$content = $get_content->fetchRow();
30
$content = (htmlspecialchars($content['content']));
31

    
32
if(!isset($wysiwyg_editor_loaded)) {
33
	$wysiwyg_editor_loaded=true;
34

    
35
	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
36
		function show_wysiwyg_editor($name,$id,$content,$width,$height) {
37
			echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
38
		}
39
	} else {
40
		$id_list=array();
41
		$query_wysiwyg = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'wysiwyg'");
42
		if($query_wysiwyg->numRows() > 0) {
43
			while($wysiwyg_section = $query_wysiwyg->fetchRow()) {
44
				$entry='content'.$wysiwyg_section['section_id'];
45
				array_push($id_list,$entry);
46
			}
47
			require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
48
		}
49
	}
50
}
51

    
52
?>
53

    
54
<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post">
55

    
56
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
57
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
58

    
59
<?php
60
echo $admin->getFTAN()."\n"; 
61
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
62
?>
63

    
64
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
65
<tr>
66
	<td align="left">
67
		<input type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
68
	</td>
69
	<td align="right">
70
		<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
71
	</td>
72
</tr>
73
</table>
74

    
75
</form>
76

    
77
<br />
(6-6/10)