Welcome, Guest

WYSIWYG editor in form
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: WYSIWYG editor in form

WYSIWYG editor in form 2 years ago #11607

Hi

I am a big fan of FacileForms and now BreezingForms. I do have soe grat working forms made with this component, but now hit a wall.

I do have WYSIWYG editor fields in may forms, and they work using simple scripts to initiate editor area (after moving to Joomla 1.5):

function wy_editorArea($ename, $content, $hidden, $width, $height, $cols, $lines)
{
global $ff_processor;
ob_start();
$editor = &JFactory::getEditor();
echo $editor->display($ename.'_hidden', $content, $width, $height, $cols, $lines, false);
$html = ob_get_contents();
ob_end_clean();
if ($ff_processor->form_id != 'adminForm')
$html = preg_replace('/adminForm/', $ff_processor->form_id, $html);
return $html;
} // wy_editorArea


and geting text back:

function wy_getText($ename, $fname)
{
global $ff_processor;
$editor = &JFactory::getEditor();
ob_start();
echo $editor->save($ename.'_hidden');
$html = ob_get_contents();
ob_end_clean();
if ($ff_processor->form_id != 'adminForm')
$html = preg_replace('/adminForm/', $ff_processor->form_id, $html);
return
$html."\n".
" ff_getElementByName('$fname').value = \n".
" document.".$ff_processor->form_id.".".$ename."_hidden.value;\n";
} // wy_getText


And here i got a problem, while, previously i have been reciving text with all formatting tags, now i am getting it completly clean, no tags at all, just plain text. Where is the error?

TP
  • TruePepe
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0

Re: WYSIWYG editor in form 2 years ago #11632

Hi,

that is a "feature". BF (and Joomla) filters tags from messages from frontend submissions. This is to prevent security issues (you could grab session data if a script tag would make it through).

I was often asked for this feature but I am still a little bit reluctant to add it.

I will first do a bigger update on breezingforms and then trying to find a proper way to address this requirement.

Until then I can only suggest - if you really need it - to add a corehack that removes the filtering __safely__.
See the facileforms.process.php for such a core hack.

Regards,
Markus
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re: WYSIWYG editor in form 2 years ago #11649

A hint where facileforms.process.php is placed in the system?
  • TruePepe
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0

Re: WYSIWYG editor in form 2 years ago #11654

...sure, sorry:

/components/com_facileforms/facileforms.process.php

If you need help, please let me know.
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
===============================================

Re: WYSIWYG editor in form 2 years ago #11718

Well, that's not so simple, i see. My idea is to allow only some specific tags, strictly formatting (like <strong> or <em>), I was looking for some regular expression search, haven't found. Can you suggest me the line number for the hack? (there is almost 5 thousand lines of code:)
  • TruePepe
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0

Re: WYSIWYG editor in form 2 years ago #11814

Well
Joomla native tag filtering have feature called "white list" which perfectly works for articles edited on the front end. Setting "allowed" tags this way in editor located in the BreezingForms don't look like working, please let me know, where is really placed filtering in the component
  • TruePepe
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Karma: 0
  • Page:
  • 1
Moderators: TheMuffinMan, ForumSupport
Time to create page: 0.40 seconds

About

Crosstec GmbH & Co. KG

Bergisch-Gladbacher-Str. 829

51069 Cologne, Germany