RTE now able to be used w/Safari 3+ and Chrome.
break;
case 'new':
- $rte = ($browser->hasFeature('rte') && $prefs->getValue('compose_html'));
- if ($rte) {
- $show_editor = true;
- }
+ $rte = $show_editor = ($prefs->getValue('compose_html') && $_SESSION['imp']['rteavail']);
break;
}
/* Determine the composition type - text or HTML.
$rtemode is null if browser does not support it. */
$rtemode = null;
-if ($browser->hasFeature('rte')) {
+if ($_SESSION['imp']['rteavail']) {
if ($prefs->isLocked('compose_html')) {
$rtemode = $prefs->getValue('compose_html');
} else {
$body_id = null;
$mode = 'text';
- if (!empty($options['html']) &&
- $GLOBALS['browser']->hasFeature('rte')) {
+ if (!empty($options['html']) && $_SESSION['imp']['rteavail']) {
$body_id = $contents->findBody('html');
if (!is_null($body_id)) {
$mode = 'html';
* 'maildomain' -- See config/servers.php.
* 'notepadavail' -- Is listing of notepads available?
* 'protocol' -- Either 'imap' or 'pop'.
+ * 'rteavail' -- Is the HTML editor available?
* 'search' -- Settings used by the IMP_Search library.
* 'smime' -- Settings related to the S/MIME viewer.
* 'smtp' -- SMTP options ('host' and 'port')
$sess['notepadavail'] = true;
}
+ /* Is the HTML editor available? */
+ $imp_ui = new IMP_UI_Compose();
+ $editor = $imp_ui->initRTE(null, true);
+ $sess['rteavail'] = $editor->supportedByBrowser();
+
/* Cache autologin check. */
$sess['autologin'] = self::canAutologin();
/**
*/
- function initRTE($mode = 'imp')
+ function initRTE($mode = 'imp', $editoronly = false)
{
$editor = &Horde_Editor::singleton('Fckeditor', array('id' => 'message', 'no_notify' => true));
+ if ($editoronly) {
+ return $editor;
+ }
$fck_buttons = $GLOBALS['prefs']->getValue('fckeditor_buttons');
if (!empty($fck_buttons)) {
);
$compose_html = $rte = false;
- if ($GLOBALS['browser']->hasFeature('rte')) {
+ if ($_SESSION['imp']['rteavail']) {
$compose_html = $GLOBALS['prefs']->getValue('compose_html');
$rte = true;