• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Revision143f14f326932150ea9de2864478c920a8f02b52 (tree)
Time2013-03-10 10:37:59
AuthorHIKAWA Kilica <kilica.hikawa@gmai...>
CommiterHIKAWA Kilica

Log Message

Merge pull request #68 from nao-pon/formdhtmltarea

support editor delegate with xoopsform dhtmltarea

Change Summary

Incremental Difference

--- a/html/class/xoopsform/formdhtmltextarea.php
+++ b/html/class/xoopsform/formdhtmltextarea.php
@@ -64,7 +64,22 @@ class XoopsFormDhtmlTextArea extends XoopsFormTextArea
6464 * @access private
6565 */
6666 var $_hiddenText;
67-
67+
68+ /**
69+ * Editor type
70+ * @var string
71+ * @access private
72+ */
73+ private $_editor;
74+
75+ /**
76+ * Editor check for recursive prevention
77+ * @static
78+ * @var array
79+ * @access private
80+ */
81+ private static $_editorCheck = array();
82+
6883 /**
6984 * Constructor
7085 *
@@ -89,6 +104,35 @@ class XoopsFormDhtmlTextArea extends XoopsFormTextArea
89104 function render()
90105 {
91106 $root =& XCube_Root::getSingleton();
107+
108+ $editor = $this->getEditor();
109+ if ($editor && !isset(self::$_editorCheck[$id])) {
110+ self::$_editorCheck[$id] = true;
111+ $params['name'] = trim($this->getName(false));
112+ $params['class'] = trim($this->getClass());
113+ $params['cols'] = $this->getCols();
114+ $params['rows'] = $this->getRows();
115+ $params['value'] = $this->getValue();
116+ $params['id'] = $this->getId();
117+ $params['editor'] = $editor;
118+
119+ $html = '';
120+ switch ($params['editor']) {
121+ case 'html':
122+ XCube_DelegateUtils::call('Site.TextareaEditor.HTML.Show', new XCube_Ref($html), $params);
123+ break;
124+ case 'none':
125+ XCube_DelegateUtils::call('Site.TextareaEditor.None.Show', new XCube_Ref($html), $params);
126+ break;
127+ case 'bbcode':
128+ default:
129+ XCube_DelegateUtils::call('Site.TextareaEditor.BBCode.Show', new XCube_Ref($html), $params);
130+ break;
131+ }
132+
133+ return $html;
134+ }
135+
92136 $renderSystem =& $root->getRenderSystem(XOOPSFORM_DEPENDENCE_RENDER_SYSTEM);
93137
94138 $renderTarget =& $renderSystem->createRenderTarget('main');
@@ -129,5 +173,24 @@ class XoopsFormDhtmlTextArea extends XoopsFormTextArea
129173
130174 return $renderTarget->getResult();
131175 }
176+
177+ /**
178+ * set editor mode for XCL 2.2
179+ *
180+ * @param string editor type
181+ */
182+ function setEditor($editor) {
183+ $this->_editor = strtolower($editor);
184+ }
185+
186+ /**
187+ * get the "editor" value
188+ *
189+ * @return string editor type
190+ */
191+ function getEditor() {
192+ return $this->_editor;
193+ }
194+
132195 }
133196 ?>