예제 #1
0
 /**
  * Filters textarea form data submitted for preview
  *
  * The only difference between this and displayTarea is the need to deal with $_POST input instead of database output
  *
  * @param   string  $text
  * @param   bool	$html   allow html?
  * @param   bool	$smiley allow smileys?
  * @param   bool	$xcode  allow xoopscode?
  * @param   bool	$image  allow inline images?
  * @param   bool	$br	 convert linebreaks?
  * @return  string
  **/
 public function previewTarea($text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
 {
     /* @deprecated Use icms_core_DataFilter::checkVar, instead - the events for previewTarea need to be added, first */
     //icms_core_Debug::setDeprecated('icms_core_DataFilter::checkVar - type = text or html, $options1 = input', sprintf(_CORE_REMOVE_IN_VERSION, '1.4'));
     /* trigger all the events tied to the beforePreviewTarea event */
     icms::$preload->triggerEvent('beforePreviewTarea', array(&$text, $html, $smiley, $xcode, $image, $br));
     $text = icms_core_DataFilter::stripSlashesGPC($text);
     if ($html = 0) {
         $text = icms_core_DataFilter::filterTextareaDisplay($text, $smiley, $xcode, $image, $br);
     } else {
         $text = icms_core_DataFilter::filterHTMLdisplay($text, $xcode, $br);
     }
     /* trigger all the events tied to the afterPreviewTarea event */
     icms::$preload->triggerEvent('afterPreviewTarea', array(&$text, $html, $smiley, $xcode, $image, $br));
     return $text;
 }