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 915 Ruebenwurz
 Copyright (C) 2004-2009, Ryan Djurovich
9 4 ryan
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 558 Ruebenwurz
$filename = WB_PATH.PAGES_DIRECTORY.'/intro'.PAGE_EXTENSION;
33 4 ryan
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 69 stefan
	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
		}
46 44 stefan
	} else {
47
		$id_list=array('content');
48
		require(WB_PATH.'/modules/'.WYSIWYG_EDITOR.'/include.php');
49
	}
50
}
51
?>
52
53
54
<form action="intro2.php" method="post">
55
56
<input type="hidden" name="page_id" value="{PAGE_ID}" />
57
58
<?php
59
show_wysiwyg_editor('content','content',$content,'100%','500px');
60
?>
61
62
<table cellpadding="0" cellspacing="0" border="0" width="100%">
63
<tr>
64
	<td align="left">
65
		<input type="submit" value="<?php echo $TEXT['SAVE'];?>" style="width: 100px; margin-top: 5px;" />
66
	</td>
67
	<td align="right">
68
		</form>
69
		<input type="button" value="<?php echo $TEXT['CANCEL'];?>" onclick="javascript: window.location = 'index.php';" style="width: 100px; margin-top: 5px;" />
70
	</td>
71
</tr>
72
</table>
73
74
</form>
75
<?php
76 4 ryan
// Print admin footer
77
$admin->print_footer();
78
79 239 stefan
?>