Modules » News » News Management » Edit

Discuss everything related to ApPHP MicroCMS. Any questions related to developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

hugomp
Master
Master
Posts: 217
Joined: Feb 20th, '09, 12:44

Modules » News » News Management » Edit

Postby hugomp » Dec 11th, '12, 08:55

As it is, "Modules » News » News Management » Edit" does not properly save iframes when coded on the HTML source side of WYSIWYG.
It will if "body_text" is picked-up from its posted value:

$this->params['body_text'] = $_POST['body_text'];
added to:
public function UpdateRecord($rid = "0") of MicroGrid.class.php before $sql = "UPDATE `".$this->tableName."` SET ";

It looks like that the iframe information in "$this->params['body_text']" got lost somewhere...

administrator
Site Admin
Site Admin
Posts: 5997
Joined: Jan 7th, '09, 23:18
Contact:

Re: Modules » News » News Management » Edit

Postby administrator » Dec 12th, '12, 08:28

To allow saving iframes you have to change in include/functions.common.inc.php
in prepare_input()
$level = 'high' --> $level = 'low'

hugomp
Master
Master
Posts: 217
Joined: Feb 20th, '09, 12:44

Re: Modules » News » News Management » Edit

Postby hugomp » Dec 12th, '12, 13:24

No, that does not do it even in adding '<iframe' in low level bad_string array.

administrator
Site Admin
Site Admin
Posts: 5997
Joined: Jan 7th, '09, 23:18
Contact:

Re: Modules » News » News Management » Edit

Postby administrator » Dec 13th, '12, 08:45

Try following, go to include\classes\js\microgrid_tinymce.js, find there
extended_valid_elements : "..."

and make sure it contains iframe in following way
extended_valid_elements : "iframe[src|width|height|name|align]"

Clear your cache in browser and try again.
You have to find who is responsible for removing iframe tag -WYSWYG editor or PHP code.

hugomp
Master
Master
Posts: 217
Joined: Feb 20th, '09, 12:44

Re: Modules » News » News Management » Edit

Postby hugomp » Dec 13th, '12, 10:26

It is there OK.

Hints for you:

1) when calling the public function UpdateRecord($rid = "0") from MicroGrid.class.php, the string "body_text" is correct in $_POST['body_text']) but not in array $this->params['body_text'].

2) I have replaced MicroGrid WYSIWYG with WYSIWYG CKEditor 3.0.2. The same situation occurs whether tho one or the other is used.

3) When $this->params['body_text'] = $_POST['body_text']; is added to UpdateRecord() and also to AddRecord(), everything is fine.

For me, this points to the PHP-code i.e. the setup in params array. Maybe a double quote story...


Return to “ApPHP MicroCMS Talk {developers/users}”