1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11: class PasteForm extends Horde_Form
12: {
13: 14:
15: function PasteForm(&$vars)
16: {
17: parent::Horde_Form($vars, _("New Paste"));
18:
19: $engine = 'Pastie_Highlighter_' . $GLOBALS['conf']['highlighter']['engine'];
20: $tmp = call_user_func(array($engine, 'getSyntaxes'));
21: $types = array();
22: foreach ($tmp as $type) {
23: $types[$type] = $type;
24: }
25:
26:
27:
28: $curtype = $vars->get('syntax');
29: if (empty($curtype)) {
30: $vars->set('syntax', 'php');
31: }
32:
33: $this->addVariable(_("Title"), 'title', 'text', false);
34:
35: $this->addVariable(_("Syntax"), 'syntax', 'enum', true,
36: false, null, array($types, false));
37:
38: $this->addVariable(_("Paste"), 'paste', 'longtext', true, false, null,
39: array('rows' => 20, 'cols' => 100));
40:
41: return true;
42: }
43: }
44: