summaryrefslogtreecommitdiff
path: root/editable.php
blob: 245f6888bc09fb4a4de5c1b2746e913daa03c972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
	require_once('internal/utils.php');

	$site_conf = sanitize_ini("site_conf.ini", SANITIZE_SITE_CONF);
	if ( ! is_array($site_conf) ) die("Error parsing site_conf.ini");

	// Never put \. in this regex !
	$page=sanitize($_GET, 'page', '/[^a-z0-9\/]+/', $site_conf['default_page']);
	if ( ! is_dir($page) die("Error : page does not exists ($page)");

	$page_props = sanitize_ini("$page/props.ini", SANITIZE_PAGE_PROPS);
	if ( ! is_array($page_props) ) die("Error parsing page properties ($page/props.ini)");

	$tpl_relpath = "templates/" . $page_props['template'] . '/';
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?=$page_props['title']?></title>
<link rel="stylesheet" href="<?=$tpl_relpath?>screen.css" />
</head>

<body>
<?php
	set_include_path( $tpl_relpath . PATH_SEPARATOR . $page	);
	include('layout-' . $page_props['layout'] . '.php');
	restore_include_path();

	include('internal/editor-bind-code.html');
?>
</body>
</html>