Project

General

Profile

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