Project

General

Profile

« Previous | Next » 

Revision 69

Added by stefan about 19 years ago

Removed support for internal HTMLArea editor.

View differences:

trunk/wb/admin/pages/intro.php
39 39
}
40 40

  
41 41
if(!isset($_GET['wysiwyg']) OR $_GET['wysiwyg'] != 'no') {
42
	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="htmlarea" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
43
?>
44
<script type="text/javascript">
45
  _editor_url = "<?php echo WB_URL;?>/include/htmlarea/";
46
  _editor_lang = "en";
47
</script>
48
<script type="text/javascript" src="<?php echo WB_URL;?>/include/htmlarea/htmlarea.js"></script>
49
<script type="text/javascript">
50
HTMLArea.loadPlugin("FullPage");
51
HTMLArea.loadPlugin("ContextMenu");
52
HTMLArea.loadPlugin("TableOperations");
53
function initEditor() {
54

  
55
  var editor = new HTMLArea("content");
56
  editor.registerPlugin(FullPage);
57
  editor.registerPlugin(ContextMenu);
58
  editor.registerPlugin(TableOperations);
59
  editor.generate();
60
}
61
</script>
62
<?php
63

  
64
	function show_wysiwyg_editor($name,$id,$content,$width,$height) {
65
		echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
66
	}
67

  
68

  
42
	if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
43
		function show_wysiwyg_editor($name,$id,$content,$width,$height) {
44
			echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
45
		}
69 46
	} else {
70 47
		$id_list=array('content');
71 48
		require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
trunk/wb/admin/interface/header.html
14 14
}
15 15
function confirm_link(message, url) {
16 16
	if(confirm(message)) location.href = url;
17
}
18
function initEditor() {
19

  
20
}
21
</script>
17
}</script>
22 18
</head>
23
<body onload="initEditor()">
24 19

  
25 20
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center">
26 21
<tr>
trunk/wb/admin/settings/index.php
271 271

  
272 272
// Insert templates
273 273
$template->set_block('main_block', 'editor_list_block', 'editor_list');
274
$file='htmlarea';
275
$module_name='HTMLArea';
274
$file='none';
275
$module_name='None';
276 276
$template->set_var('FILE', $file);
277 277
$template->set_var('NAME', $module_name);
278 278
if((!defined('WYSIWYG_EDITOR') OR $file == WYSIWYG_EDITOR) ? $selected = ' selected' : $selected = '');
......
280 280
$template->parse('editor_list', 'editor_list_block', true);
281 281
if($handle = opendir(WB_PATH.'/modules/')) {
282 282
	while (false !== ($file = readdir($handle))) {
283
		if($file != "." AND $file != ".." AND $file != "CVS" AND is_dir(WB_PATH."/modules/$file") AND file_exists(WB_PATH."/modules/$file/info.php")) {
283
		if($file != "." AND $file != ".." AND $file != ".svn" AND is_dir(WB_PATH."/modules/$file") AND file_exists(WB_PATH."/modules/$file/info.php")) {
284 284
			include(WB_PATH."/modules/$file/info.php");
285 285
			if ($module_type == 'WYSIWYG') {
286 286
				$template->set_var('FILE', $file);
trunk/wb/modules/wysiwyg/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; ?>" />
trunk/wb/modules/news/modify_post.php
39 39
$query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_posts WHERE post_id = '$post_id'");
40 40
$fetch_content = $query_content->fetchRow();
41 41

  
42
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="htmlarea" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
43
?>
44
<script type="text/javascript">
45
_editor_url = "<?php echo WB_URL; ?>/include/htmlarea/";
46
_editor_lang = "en";
47
</script>
48
<script type="text/javascript" src="<?php echo WB_URL; ?>/include/htmlarea/htmlarea.js"></script>
49
<script type="text/javascript">
50
HTMLArea.loadPlugin("ContextMenu");
51
HTMLArea.loadPlugin("TableOperations");
52
function initEditor() {
53
	var editor = new HTMLArea("short");
54
	editor.registerPlugin(ContextMenu);
55
	editor.config.pageStyle = "body { <?php echo $admin->strip_slashes_dummy(WYSIWYG_STYLE); ?> }";
56
	editor.generate();
57
	var editor = new HTMLArea("long");
58
	editor.registerPlugin(ContextMenu);
59
	editor.registerPlugin(TableOperations);
60
	editor.config.pageStyle = "body { <?php echo $admin->strip_slashes_dummy(WYSIWYG_STYLE); ?> }";
61
	editor.generate();
62
}
63
</script>
64
<?php
42
if (!defined('WYSIWYG_EDITOR') OR WYSIWYG_EDITOR=="none" OR !file_exists(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php')) {
65 43
	function show_wysiwyg_editor($name,$id,$content,$width,$height) {
66 44
		echo '<textarea name="'.$name.'" id="'.$id.'" style="width: '.$width.'; height: '.$height.';">'.$content.'</textarea>';
67 45
	}

Also available in: Unified diff