1: <?php
2: 3: 4: 5: 6:
7:
8: if (!defined('XOOPS_ROOT_PATH')) exit();
9:
10: class Legacy_TextareaEditor extends XCube_ActionFilter
11: {
12: 13: 14:
15: function preBlockFilter()
16: {
17: $this->mRoot->mDelegateManager->add('Site.TextareaEditor.BBCode.Show','Legacy_TextareaEditor::renderBBCode',XCUBE_DELEGATE_PRIORITY_FINAL);
18: $this->mRoot->mDelegateManager->add('Site.TextareaEditor.HTML.Show','Legacy_TextareaEditor::renderHTML',XCUBE_DELEGATE_PRIORITY_FINAL);
19: $this->mRoot->mDelegateManager->add('Site.TextareaEditor.None.Show','Legacy_TextareaEditor::renderNone',XCUBE_DELEGATE_PRIORITY_FINAL);
20: }
21:
22: 23: 24:
25: public static function renderBBCode(&$html, $params)
26: {
27: if (!XC_CLASS_EXISTS('xoopsformelement')) {
28: require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
29: }
30:
31: $form =new XoopsFormDhtmlTextArea($params['name'], $params['name'], $params['value'], $params['rows'], $params['cols']);
32: $form->setId($params['id']);
33: if ($params['class'] != null) {
34: $form->setClass($params['class']);
35: }
36:
37: $html = $form->render();
38: }
39:
40: 41: 42:
43: public static function renderHtml(&$html, $params)
44: {
45: self::renderBBCode($html, $params);
46: }
47:
48: 49: 50:
51: public static function renderNone(&$html, $params)
52: {
53: if (!XC_CLASS_EXISTS('xoopsformelement')) {
54: require_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
55: }
56:
57: $form =new XoopsFormTextArea($params['name'], $params['name'], $params['value'], $params['rows'], $params['cols']);
58: $form->setId($params['id']);
59: if ($params['class'] != null) {
60: $form->setClass($params['class']);
61: }
62:
63: $html = $form->render();
64: }
65: }
66:
67: ?>
68: