blob: db8373ab839144c65aa9196b77cf5bde806228a6 (
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
35
36
37
|
<?PHP
Uses('links');
class phpexec_template {
function GetPage($data) {
$title = strtr($data['_page'], array(':' => ' - '));
ob_start();
eval('?>' . $data['code']);
$content = ob_get_contents();
ob_end_clean();
return array('title' => $title, 'content' => $content);
}
function GetEditor($data) {
$title = '{{Edit \'' . $data['_page'] . '\'}}';
$content = '<h2>' . $title . '</h2>';
$content .= '<form method="post" action="' . $GLOBALS['links']->GetNeonLink('Pages:Edit') . '">';
$content .= '<input type="hidden" name="name" value="' . $data['_page'] . '" />';
$content .= '<input type="hidden" name="type" value="' . $data['_type'] . '" />';
$content .= '<input type="hidden" name="backlink" value="' . htmlspecialchars($data['_backlink']) . '" />';
$content .= '<textarea name="data_code" class="pageedit spaced-bottom" rows="25" cols="70">';
$content .= htmlspecialchars($data['code']) . '</textarea><br />';
$content .= '<input type="submit" value="Änderungen übernehmen" />';
$content .= '<input type="submit" name="back" value="Zurück" />';
$content .= '</form>';
return array('title' => $title, 'content' => $content);
}
}
$GLOBALS['templates']['phpexec'] = new phpexec_template;
?>
|