• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine 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

Revisioneb785b734cc89878e0731bcfa8685aba1b71e536 (tree)
Zeit2011-11-25 19:58:18
Autorkilica <kilica@704c...>
Commiterkilica

Log Message

- Feature Request #2976820 - MyTextSanitizer delegate

git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1064 704cf05f-ae62-4b0e-a484-234ee0250e75

Ändern Zusammenfassung

Diff

--- a/html/class/module.textsanitizer.php
+++ b/html/class/module.textsanitizer.php
@@ -58,13 +58,13 @@ class MyTextSanitizer
5858 * @deprecated
5959 */
6060 var $mMakeClickablePostFilter = null;
61-
61+
6262 /**
6363 * @var XCube_Delegate
6464 * @deprecated
6565 */
6666 var $mXoopsCodePostFilter = null;
67-
67+
6868 /*
6969 * Constructor of this class
7070 *
@@ -78,10 +78,10 @@ class MyTextSanitizer
7878 */
7979 function MyTextSanitizer()
8080 {
81-
81+
8282 $this->mMakeClickablePostFilter =new XCube_Delegate();
8383 $this->mMakeClickablePostFilter->register('MyTextSanitizer.MakeClickablePostFilter');
84-
84+
8585 $this->mXoopsCodePostFilter =new XCube_Delegate();
8686 $this->mXoopsCodePostFilter->register('MyTextSanitizer.XoopsCodePostFilter');
8787
@@ -142,7 +142,7 @@ class MyTextSanitizer
142142
143143 // RaiseEvent : 'MyTextSanitizer.MakeClickablePostFilter'
144144 // Delegate may convert output text with quickApplyFilter rule
145- // Args :
145+ // Args :
146146 // 'string' [I/O] : Text to convert;
147147 //
148148 $this->mMakeClickablePostFilter->call(new XCube_Ref($text));
@@ -160,10 +160,10 @@ class MyTextSanitizer
160160 function &xoopsCodeDecode($text, $allowimage = 1)
161161 {
162162 $text = $this->mTextFilter->convertXCode($text, $allowimage);
163-
163+
164164 // RaiseEvent : 'MyTextSanitizer.XoopsCodePostFilter'
165165 // Delegate may convert output text with quickApplyFilter rule
166- // Args :
166+ // Args :
167167 // 'string' [I/O] : Text to convert;
168168 // 'allowimage' [I] : xoopsCodeDecode $allowimage parameter
169169 //
@@ -286,7 +286,7 @@ class MyTextSanitizer
286286 * @param bool $br convert linebreaks?
287287 * @return string
288288 **/
289-
289+
290290 function _ToShowTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1) {
291291 $text = $this->codePreConv($text, $xcode);
292292 if ($html != 1) $text = $this->htmlSpecialChars($text);
@@ -311,7 +311,7 @@ class MyTextSanitizer
311311 **/
312312 function &displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
313313 {
314- $text = $this->_ToShowTarea($text, $html, $smiley, $xcode, $image, $br);
314+ $text = $this->mTextFilter->toShowTarea($text, $html, $smiley, $xcode, $image, $br, true);
315315 return $text;
316316 }
317317
@@ -329,7 +329,7 @@ class MyTextSanitizer
329329 function &previewTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
330330 {
331331 $text =& $this->stripSlashesGPC($text);
332- $text = $this->_ToShowTarea($text, $html, $smiley, $xcode, $image, $br);
332+ $text = $this->mTextFilter->toPreviewTarea($text, $html, $smiley, $xcode, $image, $br, true);
333333 return $text;
334334 }
335335
--- a/html/modules/legacy/kernel/Legacy_TextFilter.class.php
+++ b/html/modules/legacy/kernel/Legacy_TextFilter.class.php
@@ -163,6 +163,23 @@ class Legacy_TextFilter extends XCube_TextFilter
163163 }
164164
165165 /**
166+ * Filters textarea data for preview
167+ *
168+ * @param string $text
169+ * @param bool $html allow html?
170+ * @param bool $smiley allow smileys?
171+ * @param bool $xcode allow xoopscode?
172+ * @param bool $image allow inline images?
173+ * @param bool $br convert linebreaks?
174+ * @param string $x2comat
175+ * @return string
176+ **/
177+ function toPreviewTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1, $x2comat=false)
178+ {
179+ return $this->toShowTarea($text, $html, $smiley, $xcode, $image, $br, $x2comat);
180+ }
181+
182+ /**
166183 * purifyHtml
167184 *
168185 * @param string $html