Project

General

Profile

1 1265 Luisehahne
<?php
2
/**
3
 *
4 1281 Luisehahne
 * @category        modules
5 1265 Luisehahne
 * @package         wysiwyg
6 1281 Luisehahne
 * @author          WebsiteBaker Project
7 1265 Luisehahne
 * @copyright       2004-2009, Ryan Djurovich
8 1349 Luisehahne
 * @copyright       2009-2011, Website Baker Org. e.V.
9 1265 Luisehahne
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12 1374 Luisehahne
 * @requirements    PHP 5.2.2 and higher
13 1281 Luisehahne
 * @version         $Id$
14
 * @filesource		$HeadURL$
15 1265 Luisehahne
 * @lastmodified    $Date$
16
 *
17
 */
18
19
if(!defined('WB_PATH')) exit('Direct access to this file is not allowed');
20
21
// Get page content
22
$query = "SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg WHERE section_id = '$section_id'";
23
$get_content = $database->query($query);
24
$content = $get_content->fetchRow();
25
$content = (htmlspecialchars($content['content']));
26
27
if(!isset($wysiwyg_editor_loaded)) {
28
	$wysiwyg_editor_loaded=true;
29
30
	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
31
		function show_wysiwyg_editor($name,$id,$content,$width,$height) {
32
			echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
33
		}
34
	} else {
35
		$id_list=array();
36
		$query_wysiwyg = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'wysiwyg'");
37
		if($query_wysiwyg->numRows() > 0) {
38
			while($wysiwyg_section = $query_wysiwyg->fetchRow()) {
39
				$entry='content'.$wysiwyg_section['section_id'];
40
				array_push($id_list,$entry);
41
			}
42
			require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
43
		}
44
	}
45
}
46
47
?>
48
49 1409 FrankH
<script language="javascript" type="text/javascript">
50
//<![CDATA[
51
  // Added to confirm leaving the page without saving changes first (even if there aren't any)
52
  var needToConfirm = <?php echo WARN_PAGE_LEAVE; ?>;
53
  window.onbeforeunload = confirmExit;
54
  function confirmExit()
55
  {
56
    if (needToConfirm)
57
      return "<?php print(html_entity_decode($MESSAGE['SETTINGS']['MODE_SWITCH_WARNING'], ENT_NOQUOTES, 'UTF-8')); ?>";
58
  }
59
//]]>
60
</script>
61 1265 Luisehahne
62 1409 FrankH
<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post" onclick="needToConfirm=false;">
63
64 1265 Luisehahne
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
65
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
66
67
<?php
68 1376 FrankH
echo $admin->getFTAN()."\n";
69 1409 FrankH
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','350');
70 1265 Luisehahne
?>
71
72
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
73
<tr>
74
	<td align="left">
75
		<input type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;" />
76
	</td>
77
	<td align="right">
78
		<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
79
	</td>
80
</tr>
81
</table>
82
83
</form>
84
85 239 stefan
<br />