| Index
» Projects
» phpMyEdit
» Forum
» apply/unapply html editor with phpMyEdit-mce-cal.class |
 |
bellini
Joined: 09 May 2008
Posts: 2
Posted: 2008-05-09 12:31
Back to top
Reply with quote
|
I found a problem with the last phpMyEdit-mce-cal.class.php (CVS), if you want apply /unapply to a htmltextarea field the mce_tiny editor class.
Below is the new code for phpMyEdit-mce-cal.class.php (row 333-368):
| Code: |
function htmlTextarea($name, $css, $k, $value = null, $js = NULL)
{
//$ret = '<textarea class="'.$css.'" name="'.$name.'"';
$ret = '<textarea class="'.$css; // daniele
if (isset($this->fdd[$k]['textarea']['html'])) { // daniele
$ret .=' mceEditor'; // daniele
} // daniele
$ret .='" name="'.$name.'"';
$ret .= ($this->readonly($k) ? ' disabled' : '');
if (intval($this->fdd[$k]['textarea']['rows']) > 0) {
$ret .= ' rows="'.$this->fdd[$k]['textarea']['rows'].'"';
}
if (intval($this->fdd[$k]['textarea']['cols']) > 0) {
$ret .= ' cols="'.$this->fdd[$k]['textarea']['cols'].'"';
}
if (isset($this->fdd[$k]['textarea']['wrap'])) {
$ret .= ' wrap="'.$this->fdd[$k]['textarea']['wrap'].'"';
} else {
$ret .= ' wrap="virtual"';
}
// daniele
// mce_cal mod start
//if (isset($this->fdd[$k]['textarea']['html'])) {
// $mce_tag = 'editable';
// if (is_string($this->fdd[$k]['textarea']['html'])) {
// $mce_tag = $this->fdd[$k]['textarea']['html'];
// }
// $ret .= ' mce_'.$mce_tag.'=true';
//}
// mce_cal mod end
$ret .= '>';
if($escape) $ret .= htmlspecialchars($value);
else $ret .= $value;
$ret .= '</textarea>'."\n";
return $ret;
} /* }}} */
|
This for the table.php:
| Code: |
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
editor_selector : "mceEditor",
width: "800",
height: "300"
});
</script>
...
...
$opts['fdd']['authors'] = array(
'name' => 'Authors',
'select' => 'T',
'maxlen' => -1,
'required' => true,
'textarea' => array(
'html' => true,
'rows' => 5,
'cols' => 50),
'sort' => true,
);
...
|
regards,
Daniele
|
ajh
Joined: 17 Dec 2003
Posts: 236
Posted: 2008-05-09 15:44
Back to top
Reply with quote
|
OK - I see the problem. TinyMCE has changed the way it selects the textarea's to convert to HTML editors. The code in the CVS does still work, but you have to use the 'textarea_trigger' config option, which is now deprecated, with the mode: specific_textarea.
Have a look at the comments in the mce_cal extension for the format of the MCE init that works.
Your alterations only allow for one format of HTML editor on a page, so it will need adapting to allow for multiple formats as per the current version.
I'll try and fix over the next day or so.
|
bellini
Joined: 09 May 2008
Posts: 2
Posted: 2008-05-11 19:42
Back to top
Reply with quote
|
Thank you for your answer in short time.
I'm in a hurry so I patched the code just for my actual project (I've to deploy in two days).
Thank's in advance if you'll feed to cvs with more elegant code.
bye from Italy,
daniele
|
ajh
Joined: 17 Dec 2003
Posts: 236
Posted: 2008-05-21 18:36
Back to top
Reply with quote
|
CVS now updated with new code that supports the new TinyMCE api. This will continue to support the ability to have multiple editor styles. Full documentation in the comments of the mce_cal extension.
|
franciscohm
Joined: 08 May 2008
Posts: 33
Posted: 2009-04-14 21:29
Back to top
Reply with quote
|
I had the same problem. Now it works OK.
THANK YOU GUYS!
|
|
Post new topic
Reply to topic
|
|
|
|