Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  apply/unapply html editor with phpMyEdit-mce-cal.class

phpMyEdit General     apply/unapply html editor with phpMyEdit-mce-cal.class
Odoslať novú tému   Odpovedať na tému    
 
bellini     Založený: 09.05.2008   Príspevky: 2  
Príspevok Zaslal: 2008-05-09 12:31
Návrat hore  Odpovedať s citátom     

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):

Kód:

  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:

Kód:

<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     Založený: 17.12.2003   Príspevky: 236  
Príspevok Zaslal: 2008-05-09 15:44
Návrat hore  Odpovedať s citátom     

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     Založený: 09.05.2008   Príspevky: 2  
Príspevok Zaslal: 2008-05-11 19:42
Návrat hore  Odpovedať s citátom     

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     Založený: 17.12.2003   Príspevky: 236  
Príspevok Zaslal: 2008-05-21 18:36
Návrat hore  Odpovedať s citátom     

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     Založený: 08.05.2008   Príspevky: 33  
Príspevok Zaslal: 2009-04-14 21:29
Návrat hore  Odpovedať s citátom     

I had the same problem. Now it works OK.

THANK YOU GUYS!

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov