Project

General

Profile

1
<?php
2

    
3
// $Id: intro.php 40 2005-09-07 19:22:34Z stefan $
4

    
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
// 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($content),
47
								'WB_URL' => WB_URL,
48
								'ADMIN_URL' => ADMIN_URL,
49
								'TEXT_SAVE' => $TEXT['SAVE'],
50
								'TEXT_CANCEL' => $TEXT['CANCEL']
51
								)
52
						);
53
if(!isset($_GET['wysiwyg']) OR $_GET['wysiwyg'] != 'no') {
54
	$template->set_var('WYSIWYG_FIELD', 'content');
55
}
56
$template->parse('main', 'main_block', false);
57
$template->pparse('output', 'page');
58

    
59
// Print admin footer
60
$admin->print_footer();
61

    
62
?>
(6-6/20)