Project

General

Profile

1 4 ryan
<?php
2
3 36 stefan
// $Id$
4 4 ryan
5
/*
6
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2005, Ryan Djurovich
9
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
24
*/
25
26
// Create new admin object
27
require('../../config.php');
28
require_once(WB_PATH.'/framework/class.admin.php');
29
$admin = new admin('Pages', 'pages_intro');
30
31
// Get page content
32
$filename = WB_PATH.'/pages/intro.php';
33
if(file_exists($filename)) {
34
	$handle = fopen($filename, "r");
35
	$content = fread($handle, filesize($filename));
36
	fclose($handle);
37
} else {
38
	$content = '';
39
}
40
41
if(!isset($_GET['wysiwyg']) OR $_GET['wysiwyg'] != 'no') {
42 44 stefan
	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 4 ryan
}
61 44 stefan
</script>
62
<?php
63 4 ryan
64 44 stefan
	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
99 4 ryan
// Print admin footer
100
$admin->print_footer();
101
102 44 stefan
?>