Dennasz1 Posted December 12, 2013 Share Posted December 12, 2013 Hello everyone, After multiple tries to add the tinymce html editor to my cms editor and following these instructions: http://mypresta.eu/en/art/developer/prestashop-product-page-full-rich-editor.html#validate_class_change I dont know what to do, it still isnt working. my prestashop version is 1.5.6.1 default theme I have changed: -classes/validation.php -admin/themes/default/template/controllers/products/helpers/form/form.tpl Like the instructions and enabled iframes html in BO Can someone send me the adjusted files? or help me further? Thanks in advance, Dennis Link to comment Share on other sites More sharing options...
vekia Posted December 12, 2013 Share Posted December 12, 2013 show contents of your files (modified) you can attach them to pastebin.org (it will be much easier to read code because these files are big) Link to comment Share on other sites More sharing options...
Dennasz1 Posted December 12, 2013 Author Share Posted December 12, 2013 Hello Vekia, I have attached the two files as txt files. Hope you can help Dennis form.txt validate.txt Link to comment Share on other sites More sharing options...
vekia Posted December 12, 2013 Share Posted December 12, 2013 public static function isCleanHtml($html, $allow_iframe = false) { $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; $events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove'; $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel'; $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; $events .= '|onselectstart|onstart|onstop'; if (preg_match('/<[\s]*script/ims', $html) || preg_match('/('.$events.')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) return false; if (!$allow_iframe && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html)) return false; return true; } Validate.php function isn't correct. you have to change this function to: public static function isCleanHtml($html, $allow_iframe = false) { return true; } please follow guide carefully Link to comment Share on other sites More sharing options...
Dennasz1 Posted December 13, 2013 Author Share Posted December 13, 2013 Oke! thanks for answering. I will try it again later Link to comment Share on other sites More sharing options...
vekia Posted December 13, 2013 Share Posted December 13, 2013 btw. you said that it doesn't work. may i know where you've got problem? with tinymce editor? with "save" button? or maybe somewher else? Link to comment Share on other sites More sharing options...
Hueb Posted December 17, 2013 Share Posted December 17, 2013 Hi Guys, i also tried to insert the code for TinyMCE editor as descibed in http://mypresta.eu/en/art/know-how/tinymce-editor-full-options-all-html-tags.html, but as i cannot see a change with the editor i must have done something wrong. my prestashop version is 1.5.4.1, Theme is elation liquid I have changed: -classes/validation.php -admin/themes/default/template/controllers/products/helpers/form/form.tpl Can someone send me the adjusted files? or help me further? I realy appreciate your help. Thanks! Validate.php form.tpl.txt Link to comment Share on other sites More sharing options...
vekia Posted December 17, 2013 Share Posted December 17, 2013 validate.php - you forogot to change function: public static function isCleanHtml($html) { $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; $events .= '|onafterupdate|onbeforeactivate|onbeforecopy|onbeforecut|onbeforedeactivate|onbeforeeditfocus|onbeforepaste|onbeforeprint|onbeforeunload|onbeforeupdate|onmove'; $events .= '|onbounce|oncellchange|oncontextmenu|oncontrolselect|oncopy|oncut|ondataavailable|ondatasetchanged|ondatasetcomplete|ondeactivate|ondrag|ondragend|ondragenter|onmousewheel'; $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; $events .= '|onselectstart|onstart|onstop'; return (!preg_match('/<[ \t\n]*script/ims', $html) && !preg_match('/('.$events.')[ \t\n]*=/ims', $html) && !preg_match('/.*script\:/ims', $html) && !preg_match('/<[ \t\n]*i?frame/ims', $html)); } instead of code above use public static function isCleanHtml($html) { return true; } just follow guide carefully, especially section: Link to comment Share on other sites More sharing options...
Dennasz1 Posted January 6, 2014 Author Share Posted January 6, 2014 (edited) Hello Vekia, Changed the validate,php file as you mentioned but the tinymce enriched editor doesnt show up at all in the backoffice. Just the normal small editor.. Have u got another solution? or maybe the adjusted form.tpl and validate.php for default theme? Thanks in advance. Dennis for version 1.5.6.1 Edited January 6, 2014 by Dennasz1 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 6, 2014 Share Posted January 6, 2014 follow guide carefully especially part related to tinymce, validate.php isn't related to appearing of tinymce editor Link to comment Share on other sites More sharing options...
Dennasz1 Posted January 6, 2014 Author Share Posted January 6, 2014 (edited) Okay, the editor appears now. Only when i try it sends me to a error page; Property CMS->content is not validat line 878 in file classes/ObjectModel.php Are you familiar with this error? I am trying to link to a javascript file for a photo gallery in the html box Gr, Dennis Edited January 6, 2014 by Dennasz1 (see edit history) Link to comment Share on other sites More sharing options...
Dennasz1 Posted January 7, 2014 Author Share Posted January 7, 2014 Anyone? this is the last thing i have to do to finish my website Gr Dennis Link to comment Share on other sites More sharing options...
vekia Posted January 7, 2014 Share Posted January 7, 2014 hello you see this message because it's necessary to modify validate class, by default validate class doesnt allow to use javascripts etc. in text editor, so it's necessary to modify it. have you modified it as it is described in guide? if so, can you show me modified class? i will inspect it. Link to comment Share on other sites More sharing options...
Dennasz1 Posted January 8, 2014 Author Share Posted January 8, 2014 (edited) Hello Vekia, Thanks for answering, This is the validate file which i have adjusted as you said, *as example i tried to add the javascript code from fancybox in the html editor.. when saving it gives a blank page. Gr Dennis Validate.php Edited January 8, 2014 by Dennasz1 (see edit history) Link to comment Share on other sites More sharing options...
Dennasz1 Posted January 8, 2014 Author Share Posted January 8, 2014 Hello Vekia, It finally works:) i think there was after all just something wrong with the validate file. I download a default validate file and adjusted it again and it works now:) (silly me) Thank you for your patience, i will mark this topic as solved. *I have attached the correct validate file for version 1.5.6.1 in case more people have problems with this. Since i was trying to get it working for quite a time Gr Dennis Validate.php Link to comment Share on other sites More sharing options...
vekia Posted January 9, 2014 Share Posted January 9, 2014 thank you for information that it works it's always worth to check our modifications two times anyway, glad that it is okay now with regards, Milos Link to comment Share on other sites More sharing options...
Recommended Posts