Ignore:
Timestamp:
Aug 15, 2008 5:47:31 PM (5 years ago)
Author:
thomasb
Message:

Enable spellchecker for HTML editor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r1621 r1651  
    383383  $OUTPUT->include_script('tiny_mce/tiny_mce.js'); 
    384384  $OUTPUT->include_script("editor.js"); 
    385   $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.$tinylang.'");'); 
     385  $OUTPUT->add_script('rcmail_editor_init("$__skin_path", "'.JQ($tinylang).'", '.intval($CONFIG['enable_spellcheck']).');'); 
    386386 
    387387  $out = $form_start ? "$form_start\n" : ''; 
     
    403403 
    404404  // include GoogieSpell 
    405   if (!empty($CONFIG['enable_spellcheck']) && !$isHtml) 
    406     { 
    407     $lang_set = ''; 
    408     if (!empty($CONFIG['spellcheck_languages']) && is_array($CONFIG['spellcheck_languages'])) 
    409       $lang_set = "googie.setLanguages(".array2js($CONFIG['spellcheck_languages']).");\n"; 
     405  if (!empty($CONFIG['enable_spellcheck'])) { 
     406    $googie_lang_set = $editor_lang_set = ''; 
     407    if (!empty($CONFIG['spellcheck_languages']) && is_array($CONFIG['spellcheck_languages'])) { 
     408      $googie_lang_set = "googie.setLanguages(".json_serialize($CONFIG['spellcheck_languages']).");\n"; 
     409      foreach ($CONFIG['spellcheck_languages'] as $key => $name) 
     410        $editor_lang_set .= ($editor_lang_set ? ',' : '') . ($key == $tinylang ? '+' : '') . JQ($name).'='.JQ($key); 
     411    } 
    410412     
    411413    $OUTPUT->include_script('googiespell.js'); 
     
    426428      JQ(Q(rcube_label('revertto'))), 
    427429      JQ(Q(rcube_label('nospellerrors'))), 
    428       $lang_set, 
     430      $googie_lang_set, 
    429431      substr($_SESSION['language'], 0, 2), 
    430432      $attrib['id'], 
     
    432434 
    433435    rcube_add_label('checking'); 
    434     } 
     436    $OUTPUT->set_env('spellcheck_langs', $editor_lang_set); 
     437  } 
    435438  
    436439  $out .= "\n".'<iframe name="savetarget" src="program/blank.gif" style="width:0;height:0;border:none;visibility:hidden;"></iframe>'; 
Note: See TracChangeset for help on using the changeset viewer.