summaryrefslogtreecommitdiffstats
path: root/templates/bbcode.inc.php
blob: 3c8212ea9f6ac8ae15020562f5354f841956f127 (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
<?PHP
  Uses('message', 'bbcode', 'links');
  
  class bbcode_template {
    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_content" 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;
?>