Project

General

Profile

« Previous | Next » 

Revision 44

Added by stefan about 19 years ago

View differences:

intro.php
38 38
	$content = '';
39 39
}
40 40

  
41
// Create new template object, insert vars, then parse template oject
42
$template = new Template(ADMIN_PATH.'/pages');
43
$template->set_file('page', 'intro.html');
44
$template->set_block('page', 'main_block', 'main');
45
$template->set_var(array(
46
								'CONTENT' => $admin->strip_slashes_dummy($content),
47
								'WB_URL' => WB_URL,
48
								'ADMIN_URL' => ADMIN_URL,
49
								'TEXT_SAVE' => $TEXT['SAVE'],
50
								'TEXT_CANCEL' => $TEXT['CANCEL']
51
								)
52
						);
53 41
if(!isset($_GET['wysiwyg']) OR $_GET['wysiwyg'] != 'no') {
54
	$template->set_var('WYSIWYG_FIELD', 'content');
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();
55 60
}
56
$template->parse('main', 'main_block', false);
57
$template->pparse('output', 'page');
61
</script>
62
<?php
58 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

  
69
	} else {
70
		$id_list=array('content');
71
		require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
72
	}
73
}
74
?>
75

  
76

  
77
<form action="intro2.php" method="post">
78

  
79
<input type="hidden" name="page_id" value="{PAGE_ID}" />
80

  
81
<?php
82
show_wysiwyg_editor('content','content',$content,'100%','500px');
83
?>
84

  
85
<table cellpadding="0" cellspacing="0" border="0" width="100%">
86
<tr>
87
	<td align="left">
88
		<input type="submit" value="<?php echo $TEXT['SAVE'];?>" style="width: 100px; margin-top: 5px;" />
89
	</td>
90
	<td align="right">
91
		</form>
92
		<input type="button" value="<?php echo $TEXT['CANCEL'];?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
93
	</td>
94
</tr>
95
</table>
96

  
97
</form>
98
<?php
59 99
// Print admin footer
60 100
$admin->print_footer();
61 101

  
62
?>
102
?>

Also available in: Unified diff