blob: 6620c912269c9e12e48a8332cf918bc2580dfed0 (
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
38
39
40
41
42
43
|
<?PHP
Uses('bbcode', 'links');
class bbcode_template {
function GetTitle($data) {
if($data['title'])
return htmlspecialchars($data['title']);
return strtr($data['_page'], array(':' => ' - '));
}
function GetPage($data) {
if($data['title'])
$title = htmlspecialchars($data['title']);
else
$title = strtr($data['_page'], array(':' => ' - '));
$content = '<h2>' . $title . '</h2>' . $GLOBALS['bbcode']->Parse($data['code']);
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 .= 'Titel: <input type="text" name="data_title" value="';
$content .= htmlspecialchars($data['title']) . '" size="70" /><br />';
$content .= '<textarea name="data_code" class="pageedit spaced-top 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']['bbcode'] = new bbcode_template;
?>
|