From 6b3063030df5635bf7e4d0c0b4b37d50c6b77b29 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 29 Aug 2015 19:48:55 +0200 Subject: [PATCH] Don't use deprecated Roundcube constants --- plugins/calendar/calendar.php | 4 ++-- plugins/calendar/lib/calendar_ui.php | 4 ++-- plugins/kolab_addressbook/lib/kolab_addressbook_ui.php | 2 +- plugins/kolab_files/lib/kolab_files_engine.php | 6 +++--- plugins/kolab_notes/kolab_notes_ui.php | 2 +- plugins/libcalendaring/lib/libcalendaring_itip.php | 6 +++--- plugins/libcalendaring/libcalendaring.php | 8 ++++---- plugins/odfviewer/odfviewer.php | 2 +- plugins/tasklist/tasklist.php | 2 +- plugins/tasklist/tasklist_ui.php | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 238b0d36..6cb083e5 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -914,7 +914,7 @@ class calendar extends rcube_plugin // display message with Undo link. $msg = html::span(null, $this->gettext('successremoval')) . ' ' . html::a(array('onclick' => sprintf("%s.http_request('event', 'action=undo', %s.display_message('', 'loading'))", - JS_OBJECT_NAME, JS_OBJECT_NAME)), $this->gettext('undo')); + rcmail_output::JS_OBJECT_NAME, rcmail_output::JS_OBJECT_NAME)), $this->gettext('undo')); $this->rc->output->show_message($msg, 'confirmation', null, true, $undo_time); $got_msg = true; } @@ -3100,7 +3100,7 @@ class calendar extends rcube_plugin $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST); $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST); $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST); - $charset = RCMAIL_CHARSET; + $charset = RCUBE_CHARSET; // establish imap connection $imap = $this->rc->get_storage(); diff --git a/plugins/calendar/lib/calendar_ui.php b/plugins/calendar/lib/calendar_ui.php index 857e26dc..3a842fb8 100644 --- a/plugins/calendar/lib/calendar_ui.php +++ b/plugins/calendar/lib/calendar_ui.php @@ -291,7 +291,7 @@ class calendar_ui $classes = array('calendar', 'cal-' . asciiwords($id, true)); $title = $prop['title'] ?: ($prop['name'] != $prop['listname'] || strlen($prop['name']) > 25 ? - html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : ''); + html_entity_decode($prop['name'], ENT_COMPAT, RCUBE_CHARSET) : ''); if ($prop['virtual']) $classes[] = 'virtual'; @@ -617,7 +617,7 @@ class calendar_ui return html::div($attrib, html::div(null, $input->show()) . html::div('formbuttons', $button->show($this->rc->gettext('upload'), array('class' => 'button mainaction', - 'onclick' => JS_OBJECT_NAME . ".upload_file(this.form)"))) . + 'onclick' => rcmail_output::JS_OBJECT_NAME . ".upload_file(this.form)"))) . html::div('hint', $this->rc->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) ); } diff --git a/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php b/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php index 6fea8d0a..72d776b9 100644 --- a/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php +++ b/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php @@ -173,7 +173,7 @@ class kolab_addressbook_ui $hidden_fields[] = array('name' => '_source', 'value' => $folder); - $folder = rcube_charset::convert($folder, RCMAIL_CHARSET, 'UTF7-IMAP'); + $folder = rcube_charset::convert($folder, RCUBE_CHARSET, 'UTF7-IMAP'); $storage = $this->rc->get_storage(); $delim = $storage->get_hierarchy_delimiter(); diff --git a/plugins/kolab_files/lib/kolab_files_engine.php b/plugins/kolab_files/lib/kolab_files_engine.php index 2386cf10..b367a217 100644 --- a/plugins/kolab_files/lib/kolab_files_engine.php +++ b/plugins/kolab_files/lib/kolab_files_engine.php @@ -464,7 +464,7 @@ class kolab_files_engine $a_sort_cols = $this->sort_cols; if (!empty($attrib['optionsmenuicon'])) { - $onclick = 'return ' . JS_OBJECT_NAME . ".command('menu-open', 'filelistmenu', this, event)"; + $onclick = 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('menu-open', 'filelistmenu', this, event)"; $inner = $this->rc->gettext('listoptions'); if (is_string($attrib['optionsmenuicon']) && $attrib['optionsmenuicon'] != 'true') { @@ -505,7 +505,7 @@ class kolab_files_engine if (in_array($col, $a_sort_cols)) { $col_name = html::a(array( 'href' => "#sort", - 'onclick' => 'return '.JS_OBJECT_NAME.".command('files-sort','".$col."',this)", + 'onclick' => 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('files-sort','$col',this)", 'title' => $this->plugin->gettext('sortby') ), $col_name); } @@ -1095,7 +1095,7 @@ class kolab_files_engine $content = html::a(array( 'href' => "#delete", - 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id), + 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", rcmail_output::JS_OBJECT_NAME, $id), 'title' => $this->rc->gettext('delete'), 'class' => 'delete', ), $button); diff --git a/plugins/kolab_notes/kolab_notes_ui.php b/plugins/kolab_notes/kolab_notes_ui.php index 080a586c..394d138a 100644 --- a/plugins/kolab_notes/kolab_notes_ui.php +++ b/plugins/kolab_notes/kolab_notes_ui.php @@ -206,7 +206,7 @@ class kolab_notes_ui } $title = $prop['title'] ?: ($prop['name'] != $prop['listname'] || strlen($prop['name']) > 25 ? - html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : ''); + html_entity_decode($prop['name'], ENT_COMPAT, RCUBE_CHARSET) : ''); $label_id = 'nl:' . $id; $attr = $prop['virtual'] ? array('tabindex' => '0') : array('href' => $this->rc->url(array('_list' => $id))); diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php index f7feab3a..9405d050 100644 --- a/plugins/libcalendaring/lib/libcalendaring_itip.php +++ b/plugins/libcalendaring/lib/libcalendaring_itip.php @@ -265,8 +265,8 @@ class libcalendaring_itip $message = new Mail_mime("\r\n"); $message->setParam('text_encoding', 'quoted-printable'); $message->setParam('head_encoding', 'quoted-printable'); - $message->setParam('head_charset', RCMAIL_CHARSET); - $message->setParam('text_charset', RCMAIL_CHARSET . ";\r\n format=flowed"); + $message->setParam('head_charset', RCUBE_CHARSET); + $message->setParam('text_charset', RCUBE_CHARSET . ";\r\n format=flowed"); $message->setContentType('multipart/alternative'); // compose common headers array @@ -286,7 +286,7 @@ class libcalendaring_itip $ical = libcalendaring::get_ical(); $ics = $ical->export(array($event), $method, false, $method == 'REQUEST' && $this->plugin->driver ? array($this->plugin->driver, 'get_attachment_body') : false); $filename = $event['_type'] == 'task' ? 'todo.ics' : 'event.ics'; - $message->addAttachment($ics, 'text/calendar', $filename, false, '8bit', '', RCMAIL_CHARSET . "; method=" . $method); + $message->addAttachment($ics, 'text/calendar', $filename, false, '8bit', '', RCUBE_CHARSET . "; method=" . $method); return $message; } diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php index 07dc23ab..3b86fd12 100644 --- a/plugins/libcalendaring/libcalendaring.php +++ b/plugins/libcalendaring/libcalendaring.php @@ -1114,7 +1114,7 @@ class libcalendaring extends rcube_plugin $content = html::a(array( 'href' => "#delete", 'class' => 'delete', - 'onclick' => sprintf("return %s.remove_from_attachment_list('rcmfile%s')", JS_OBJECT_NAME, $id), + 'onclick' => sprintf("return %s.remove_from_attachment_list('rcmfile%s')", rcmail_output::JS_OBJECT_NAME, $id), 'title' => $this->rc->gettext('delete'), 'aria-label' => $this->rc->gettext('delete') . ' ' . $attachment['name'], ), $button); @@ -1208,7 +1208,7 @@ class libcalendaring extends rcube_plugin // display page, @TODO: support text/plain (and maybe some other text formats) if ($mimetype == 'text/html' && empty($_GET['_download'])) { - $OUTPUT = new rcube_html_page(); + $OUTPUT = new rcmail_html_page(); // @TODO: use washtml on $body $OUTPUT->write($plugin['body']); } @@ -1345,7 +1345,7 @@ class libcalendaring extends rcube_plugin foreach ($this->ical_parts as $mime_id) { $part = $this->ical_message->mime_parts[$mime_id]; - $charset = $part->ctype_parameters['charset'] ?: RCMAIL_CHARSET; + $charset = $part->ctype_parameters['charset'] ?: RCUBE_CHARSET; $this->mail_ical_parser->import($this->ical_message->get_part_body($mime_id, true), $charset); // check if the parsed object is an instance of a recurring event/task @@ -1384,7 +1384,7 @@ class libcalendaring extends rcube_plugin */ public function mail_get_itip_object($mbox, $uid, $mime_id, $type = null) { - $charset = RCMAIL_CHARSET; + $charset = RCUBE_CHARSET; // establish imap connection $imap = $this->rc->get_storage(); diff --git a/plugins/odfviewer/odfviewer.php b/plugins/odfviewer/odfviewer.php index 5fcde31c..42332e5a 100644 --- a/plugins/odfviewer/odfviewer.php +++ b/plugins/odfviewer/odfviewer.php @@ -77,7 +77,7 @@ class odfviewer extends rcube_plugin // send webODF viewer page $html = file_get_contents($this->home . '/odf.html'); - header("Content-Type: text/html; charset=" . RCMAIL_CHARSET); + header("Content-Type: text/html; charset=" . RCUBE_CHARSET); echo strtr($html, array( '%%PARAMS%%' => rcube_output::json_serialize($params), '%%viewer.css%%' => $this->asset_path('viewer.css'), diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php index e569f218..2fb81c71 100644 --- a/plugins/tasklist/tasklist.php +++ b/plugins/tasklist/tasklist.php @@ -1785,7 +1785,7 @@ class tasklist extends rcube_plugin $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST); $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST); $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST); - $charset = RCMAIL_CHARSET; + $charset = RCUBE_CHARSET; // establish imap connection $imap = $this->rc->get_storage(); diff --git a/plugins/tasklist/tasklist_ui.php b/plugins/tasklist/tasklist_ui.php index ea5a7b20..2a18713f 100644 --- a/plugins/tasklist/tasklist_ui.php +++ b/plugins/tasklist/tasklist_ui.php @@ -256,7 +256,7 @@ class tasklist_ui $classes = array('tasklist'); $title = $prop['title'] ?: ($prop['name'] != $prop['listname'] || strlen($prop['name']) > 25 ? - html_entity_decode($prop['name'], ENT_COMPAT, RCMAIL_CHARSET) : ''); + html_entity_decode($prop['name'], ENT_COMPAT, RCUBE_CHARSET) : ''); if ($prop['virtual']) $classes[] = 'virtual'; @@ -448,7 +448,7 @@ class tasklist_ui return html::div($attrib, html::div(null, $input->show()) . html::div('formbuttons', $button->show($this->rc->gettext('upload'), array('class' => 'button mainaction', - 'onclick' => JS_OBJECT_NAME . ".upload_file(this.form)"))) . + 'onclick' => rcmail_output::JS_OBJECT_NAME . ".upload_file(this.form)"))) . html::div('hint', $this->rc->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) ); }