XOOPS Cube Legacy base repository
Revision | eb785b734cc89878e0731bcfa8685aba1b71e536 (tree) |
---|---|
Zeit | 2011-11-25 19:58:18 |
Autor | kilica <kilica@704c...> |
Commiter | kilica |
- Feature Request #2976820 - MyTextSanitizer delegate
git-svn-id: https://xoopscube.svn.sourceforge.net/svnroot/xoopscube/Package_Legacy/trunk@1064 704cf05f-ae62-4b0e-a484-234ee0250e75
@@ -58,13 +58,13 @@ class MyTextSanitizer | ||
58 | 58 | * @deprecated |
59 | 59 | */ |
60 | 60 | var $mMakeClickablePostFilter = null; |
61 | - | |
61 | + | |
62 | 62 | /** |
63 | 63 | * @var XCube_Delegate |
64 | 64 | * @deprecated |
65 | 65 | */ |
66 | 66 | var $mXoopsCodePostFilter = null; |
67 | - | |
67 | + | |
68 | 68 | /* |
69 | 69 | * Constructor of this class |
70 | 70 | * |
@@ -78,10 +78,10 @@ class MyTextSanitizer | ||
78 | 78 | */ |
79 | 79 | function MyTextSanitizer() |
80 | 80 | { |
81 | - | |
81 | + | |
82 | 82 | $this->mMakeClickablePostFilter =new XCube_Delegate(); |
83 | 83 | $this->mMakeClickablePostFilter->register('MyTextSanitizer.MakeClickablePostFilter'); |
84 | - | |
84 | + | |
85 | 85 | $this->mXoopsCodePostFilter =new XCube_Delegate(); |
86 | 86 | $this->mXoopsCodePostFilter->register('MyTextSanitizer.XoopsCodePostFilter'); |
87 | 87 |
@@ -142,7 +142,7 @@ class MyTextSanitizer | ||
142 | 142 | |
143 | 143 | // RaiseEvent : 'MyTextSanitizer.MakeClickablePostFilter' |
144 | 144 | // Delegate may convert output text with quickApplyFilter rule |
145 | - // Args : | |
145 | + // Args : | |
146 | 146 | // 'string' [I/O] : Text to convert; |
147 | 147 | // |
148 | 148 | $this->mMakeClickablePostFilter->call(new XCube_Ref($text)); |
@@ -160,10 +160,10 @@ class MyTextSanitizer | ||
160 | 160 | function &xoopsCodeDecode($text, $allowimage = 1) |
161 | 161 | { |
162 | 162 | $text = $this->mTextFilter->convertXCode($text, $allowimage); |
163 | - | |
163 | + | |
164 | 164 | // RaiseEvent : 'MyTextSanitizer.XoopsCodePostFilter' |
165 | 165 | // Delegate may convert output text with quickApplyFilter rule |
166 | - // Args : | |
166 | + // Args : | |
167 | 167 | // 'string' [I/O] : Text to convert; |
168 | 168 | // 'allowimage' [I] : xoopsCodeDecode $allowimage parameter |
169 | 169 | // |
@@ -286,7 +286,7 @@ class MyTextSanitizer | ||
286 | 286 | * @param bool $br convert linebreaks? |
287 | 287 | * @return string |
288 | 288 | **/ |
289 | - | |
289 | + | |
290 | 290 | function _ToShowTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1) { |
291 | 291 | $text = $this->codePreConv($text, $xcode); |
292 | 292 | if ($html != 1) $text = $this->htmlSpecialChars($text); |
@@ -311,7 +311,7 @@ class MyTextSanitizer | ||
311 | 311 | **/ |
312 | 312 | function &displayTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1) |
313 | 313 | { |
314 | - $text = $this->_ToShowTarea($text, $html, $smiley, $xcode, $image, $br); | |
314 | + $text = $this->mTextFilter->toShowTarea($text, $html, $smiley, $xcode, $image, $br, true); | |
315 | 315 | return $text; |
316 | 316 | } |
317 | 317 |
@@ -329,7 +329,7 @@ class MyTextSanitizer | ||
329 | 329 | function &previewTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1) |
330 | 330 | { |
331 | 331 | $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); | |
333 | 333 | return $text; |
334 | 334 | } |
335 | 335 |
@@ -163,6 +163,23 @@ class Legacy_TextFilter extends XCube_TextFilter | ||
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
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 | + /** | |
166 | 183 | * purifyHtml |
167 | 184 | * |
168 | 185 | * @param string $html |