Revision 69
Added by stefan about 19 years ago
modify.php | ||
---|---|---|
34 | 34 |
if(!isset($wysiwyg_editor_loaded)) { |
35 | 35 |
$wysiwyg_editor_loaded=true; |
36 | 36 |
|
37 |
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="htmlarea" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) { |
|
38 |
|
|
39 |
// Workout how many WYSIWYG sections are used on this page |
|
40 |
$query_wysiwyg_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'wysiwyg' ORDER BY position ASC"); |
|
41 |
$num_wysiwyg_sections = $query_wysiwyg_sections->numRows(); |
|
42 |
|
|
43 |
echo '<script type="text/javascript">' |
|
44 |
. ' _editor_url = "'.WB_URL.'/include/htmlarea/";' |
|
45 |
. ' _editor_lang = "en";' |
|
46 |
. '</script>' |
|
47 |
. '<script type="text/javascript" src="'.WB_URL.'/include/htmlarea/htmlarea.js"></script>' |
|
48 |
. '<script type="text/javascript"> |
|
49 |
HTMLArea.loadPlugin("ContextMenu"); |
|
50 |
HTMLArea.loadPlugin("TableOperations"); |
|
51 |
function initEditor() {'; |
|
52 |
|
|
53 |
|
|
54 |
$query_wysiwyg = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'wysiwyg'"); |
|
55 |
if($query_wysiwyg->numRows() > 0) { |
|
56 |
while($wysiwyg_section = $query_wysiwyg->fetchRow()) { |
|
57 |
echo 'var editor = new HTMLArea("content'.$wysiwyg_section["section_id"].'");' |
|
58 |
. 'editor.registerPlugin(ContextMenu);' |
|
59 |
. 'editor.registerPlugin(TableOperations);' |
|
60 |
. 'editor.config.pageStyle = "body { '.stripslashes(WYSIWYG_STYLE).' }";' |
|
61 |
. 'editor.generate();'; |
|
62 |
} |
|
63 |
} |
|
64 |
|
|
65 |
echo '} </script>'; |
|
37 |
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) { |
|
66 | 38 |
function show_wysiwyg_editor($name,$id,$content,$width,$height) { |
67 | 39 |
echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>'; |
68 | 40 |
} |
69 |
|
|
70 | 41 |
} else { |
71 | 42 |
$id_list=array(); |
72 | 43 |
$query_wysiwyg = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'wysiwyg'"); |
... | ... | |
81 | 52 |
} |
82 | 53 |
|
83 | 54 |
?> |
55 |
|
|
84 | 56 |
<form name="wysiwyg<?php echo $section_id; ?>" action="<?php echo WB_URL; ?>/modules/wysiwyg/save.php" method="post"> |
85 | 57 |
|
86 | 58 |
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" /> |
Also available in: Unified diff
Removed support for internal HTMLArea editor.