Project

General

Profile

1 1420 Luisehahne
<?php
2
/**
3
 *
4
 * @category        modules
5
 * @package         code
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21 1428 Luisehahne
22
require_once(WB_PATH . '/include/editarea/wb_wrapper_edit_area.php');
23
24 1420 Luisehahne
// Setup template object
25
$template = new Template(WB_PATH.'/modules/code');
26
$template->set_file('page', 'htt/modify.htt');
27
$template->set_block('page', 'main_block', 'main');
28
29
// Get page content
30
$query = "SELECT content FROM ".TABLE_PREFIX."mod_code WHERE section_id = '$section_id'";
31
$get_content = $database->query($query);
32
$content = $get_content->fetchRow();
33
$content = htmlspecialchars($content['content']);
34
35
// Insert vars
36
$template->set_var(
37
	array(
38
		'PAGE_ID'				=> $page_id,
39
		'SECTION_ID'			=> $section_id,
40
		'REGISTER_EDIT_AREA'	=> function_exists('registerEditArea') ? registerEditArea('content'.$section_id, 'php', false) : '',
41
		'WB_URL'				=> WB_URL,
42
		'CONTENT'				=> $content,
43
		'TEXT_SAVE'				=> $TEXT['SAVE'],
44
		'TEXT_CANCEL'			=> $TEXT['CANCEL'],
45
		'SECTION'				=> $section_id,
46
		'FTAN'					=> $admin->getFTAN()
47
	)
48
);
49
50
// Parse template object
51
$template->set_unknowns('keep');
52
$template->parse('main', 'main_block', false);
53
$template->pparse('output', 'page', false);
54
55 4 ryan
?>