From 63ce7e998867170877065017a30f37d7ebeac7d8 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 29 Aug 2015 20:23:34 +0200 Subject: [PATCH] Don't use depracated Roundcube functions --- plugins/calendar/calendar.php | 22 +++++----- .../calendar/drivers/kolab/kolab_driver.php | 8 ++-- plugins/calendar/lib/calendar_ui.php | 4 +- plugins/kolab_activesync/kolab_activesync.php | 2 +- .../kolab_activesync/kolab_activesync_ui.php | 8 ++-- .../kolab_addressbook/kolab_addressbook.php | 2 +- .../lib/kolab_addressbook_ui.php | 8 ++-- plugins/kolab_auth/kolab_auth.php | 4 +- plugins/kolab_delegation/kolab_delegation.php | 6 +-- plugins/kolab_notes/kolab_notes.php | 4 +- plugins/kolab_notes/kolab_notes_ui.php | 6 +-- plugins/kolab_zpush/kolab_zpush.php | 2 +- plugins/kolab_zpush/kolab_zpush_ui.php | 6 +-- .../lib/libcalendaring_itip.php | 36 ++++++++--------- plugins/libcalendaring/libcalendaring.php | 40 +++++++++---------- .../drivers/kolab/tasklist_kolab_driver.php | 10 ++--- 16 files changed, 84 insertions(+), 84 deletions(-) diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 6cb083e5..c217c25c 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -369,7 +369,7 @@ class calendar extends rcube_plugin $select->add($this->gettext('month'), "month"); $select->add($this->gettext('agenda'), "table"); $p['blocks']['view']['options']['default_view'] = array( - 'title' => html::label($field_id, Q($this->gettext('default_view'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('default_view'))), 'content' => $select->show($this->rc->config->get('calendar_default_view', $this->defaults['calendar_default_view'])), ); } @@ -385,7 +385,7 @@ class calendar extends rcube_plugin $select = new html_select(array('name' => '_timeslots', 'id' => $field_id)); $select->add($choices); $p['blocks']['view']['options']['timeslots'] = array( - 'title' => html::label($field_id, Q($this->gettext('timeslots'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('timeslots'))), 'content' => $select->show(strval($this->rc->config->get('calendar_timeslots', $this->defaults['calendar_timeslots']))), ); } @@ -406,7 +406,7 @@ class calendar extends rcube_plugin $select->add($this->gettext('friday'), '5'); $select->add($this->gettext('saturday'), '6'); $p['blocks']['view']['options']['first_day'] = array( - 'title' => html::label($field_id, Q($this->gettext('first_day'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('first_day'))), 'content' => $select->show(strval($this->rc->config->get('calendar_first_day', $this->defaults['calendar_first_day']))), ); } @@ -424,7 +424,7 @@ class calendar extends rcube_plugin $field_id = 'rcmfd_firsthour'; $p['blocks']['view']['options']['first_hour'] = array( - 'title' => html::label($field_id, Q($this->gettext('first_hour'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('first_hour'))), 'content' => $select_hours->show($this->rc->config->get('calendar_first_hour', $this->defaults['calendar_first_hour']), array('name' => '_first_hour', 'id' => $field_id)), ); } @@ -437,7 +437,7 @@ class calendar extends rcube_plugin $field_id = 'rcmfd_workstart'; $p['blocks']['view']['options']['workinghours'] = array( - 'title' => html::label($field_id, Q($this->gettext('workinghours'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('workinghours'))), 'content' => $select_hours->show($this->rc->config->get('calendar_work_start', $this->defaults['calendar_work_start']), array('name' => '_work_start', 'id' => $field_id)) . ' — ' . $select_hours->show($this->rc->config->get('calendar_work_end', $this->defaults['calendar_work_end']), array('name' => '_work_end', 'id' => $field_id)), ); @@ -457,7 +457,7 @@ class calendar extends rcube_plugin $select_colors->add($this->gettext('coloringmode3'), 3); $p['blocks']['view']['options']['eventcolors'] = array( - 'title' => html::label($field_id . 'value', Q($this->gettext('eventcoloring'))), + 'title' => html::label($field_id . 'value', rcube::Q($this->gettext('eventcoloring'))), 'content' => $select_colors->show($this->rc->config->get('calendar_event_coloring', $this->defaults['calendar_event_coloring'])), ); } @@ -478,7 +478,7 @@ class calendar extends rcube_plugin $select_type->add($this->gettext(strtolower("alarm{$type}option"), 'libcalendaring'), $type); $p['blocks']['view']['options']['alarmtype'] = array( - 'title' => html::label($field_id, Q($this->gettext('defaultalarmtype'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('defaultalarmtype'))), 'content' => $select_type->show($this->rc->config->get('calendar_default_alarm_type', '')), ); } @@ -497,7 +497,7 @@ class calendar extends rcube_plugin $preset = libcalendaring::parse_alarm_value($this->rc->config->get('calendar_default_alarm_offset', '-15M')); $p['blocks']['view']['options']['alarmoffset'] = array( - 'title' => html::label($field_id . 'value', Q($this->gettext('defaultalarmoffset'))), + 'title' => html::label($field_id . 'value', rcube::Q($this->gettext('defaultalarmoffset'))), 'content' => $input_value->show($preset[0]) . ' ' . $select_offset->show($preset[1]), ); } @@ -516,7 +516,7 @@ class calendar extends rcube_plugin $default_calendar = $id; } $p['blocks']['view']['options']['defaultcalendar'] = array( - 'title' => html::label($field_id . 'value', Q($this->gettext('defaultcalendar'))), + 'title' => html::label($field_id . 'value', rcube::Q($this->gettext('defaultcalendar'))), 'content' => $select_cal->show($this->rc->config->get('calendar_default_calendar', $default_calendar)), ); } @@ -556,7 +556,7 @@ class calendar extends rcube_plugin )); $p['blocks']['itip']['options']['after_action'] = array( - 'title' => html::label($field_id, Q($this->gettext('afteraction'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('afteraction'))), 'content' => $select->show($val) . $folders->show($folder), ); } @@ -2647,7 +2647,7 @@ class calendar extends rcube_plugin return html::div(rtrim('event-row ' . $class), html::span('event-date', $time) . - html::span('event-title', Q($event['title'])) + html::span('event-title', rcube::Q($event['title'])) ); } diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php index 4b17ead1..8f47a457 100644 --- a/plugins/calendar/drivers/kolab/kolab_driver.php +++ b/plugins/calendar/drivers/kolab/kolab_driver.php @@ -2388,7 +2388,7 @@ class kolab_driver extends calendar_driver if ($action != 'form-new') { $form['sharing'] = array( - 'name' => Q($this->cal->gettext('tabsharing')), + 'name' => rcube::Q($this->cal->gettext('tabsharing')), 'content' => html::tag('iframe', array( 'src' => $this->cal->rc->url(array('_action' => 'calendar-acl', 'id' => $calendar['id'], 'framed' => 1)), 'width' => '100%', @@ -2414,7 +2414,7 @@ class kolab_driver extends calendar_driver foreach ($tab['fieldsets'] as $fieldset) { $subcontent = $this->get_form_part($fieldset); if ($subcontent) { - $content .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $subcontent) ."\n"; + $content .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($fieldset['name'])) . $subcontent) ."\n"; } } } @@ -2423,7 +2423,7 @@ class kolab_driver extends calendar_driver } if ($content) { - $this->form_html .= html::tag('fieldset', null, html::tag('legend', null, Q($tab['name'])) . $content) ."\n"; + $this->form_html .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) ."\n"; } } @@ -2452,7 +2452,7 @@ class kolab_driver extends calendar_driver foreach ($form['content'] as $col => $colprop) { $label = !empty($colprop['label']) ? $colprop['label'] : $this->cal->gettext($col); - $table->add('title', html::label($colprop['id'], Q($label))); + $table->add('title', html::label($colprop['id'], rcube::Q($label))); $table->add(null, $colprop['value']); } $content = $table->show(); diff --git a/plugins/calendar/lib/calendar_ui.php b/plugins/calendar/lib/calendar_ui.php index 3a842fb8..8d47099f 100644 --- a/plugins/calendar/lib/calendar_ui.php +++ b/plugins/calendar/lib/calendar_ui.php @@ -308,7 +308,7 @@ class calendar_ui if (!$activeonly || $prop['active']) { $label_id = 'cl:' . $id; $content = html::div(join(' ', $classes), - html::span(array('class' => 'calname', 'id' => $label_id, 'title' => $title), $prop['editname'] ? Q($prop['editname']) : $prop['listname']) . + html::span(array('class' => 'calname', 'id' => $label_id, 'title' => $title), $prop['editname'] ? rcube::Q($prop['editname']) : $prop['listname']) . ($prop['virtual'] ? '' : html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active'], 'aria-labelledby' => $label_id), '') . html::span('actions', @@ -790,7 +790,7 @@ class calendar_ui html::tag('table', array('id' => $attrib['id'] . '-owner', 'style' => 'display:none') + $attrib, html::tag('thead', null, html::tag('tr', null, - html::tag('td', array('colspan' => 2), Q($this->cal->gettext('resourceowner'))) + html::tag('td', array('colspan' => 2), rcube::Q($this->cal->gettext('resourceowner'))) ) ) . html::tag('tbody', null, ''), diff --git a/plugins/kolab_activesync/kolab_activesync.php b/plugins/kolab_activesync/kolab_activesync.php index f886c8d5..80c1052e 100644 --- a/plugins/kolab_activesync/kolab_activesync.php +++ b/plugins/kolab_activesync/kolab_activesync.php @@ -148,7 +148,7 @@ class kolab_activesync extends rcube_plugin } $this->rc->output->command('plugin.activesync_save_complete', array( - 'success' => !$err, 'id' => $imei, 'alias' => Q($devicealias))); + 'success' => !$err, 'id' => $imei, 'alias' => rcube::Q($devicealias))); } if ($err) diff --git a/plugins/kolab_activesync/kolab_activesync_ui.php b/plugins/kolab_activesync/kolab_activesync_ui.php index edf64114..5200e4af 100644 --- a/plugins/kolab_activesync/kolab_activesync_ui.php +++ b/plugins/kolab_activesync/kolab_activesync_ui.php @@ -52,7 +52,7 @@ class kolab_activesync_ui foreach ($devices as $id => $device) { $name = $device['ALIAS'] ? $device['ALIAS'] : $id; $table->add_row(array('id' => 'rcmrow' . $id)); - $table->add(null, html::span('devicealias', Q($name)) . html::span('devicetype', Q($device['TYPE']))); + $table->add(null, html::span('devicealias', rcube::Q($name)) . html::span('devicetype', rcube::Q($device['TYPE']))); } $this->rc->output->add_gui_object('devicelist', $attrib['id']); @@ -79,8 +79,8 @@ class kolab_activesync_ui if (!empty($info)) { foreach ($info as $key => $value) { if ($value) { - $table->add('title', Q($this->plugin->gettext($key))); - $table->add(null, Q($value)); + $table->add('title', rcube::Q($this->plugin->gettext($key))); + $table->add(null, rcube::Q($value)); } } } @@ -176,7 +176,7 @@ class kolab_activesync_ui } } - $folder_id = 'rcmf' . html_identifier($folder); + $folder_id = 'rcmf' . rcube_utils::html_identifier($folder); $names[] = $origname; $classes = array('mailbox'); diff --git a/plugins/kolab_addressbook/kolab_addressbook.php b/plugins/kolab_addressbook/kolab_addressbook.php index 7dd23e2c..3b1451d3 100644 --- a/plugins/kolab_addressbook/kolab_addressbook.php +++ b/plugins/kolab_addressbook/kolab_addressbook.php @@ -839,7 +839,7 @@ class kolab_addressbook extends rcube_plugin $select->add($this->gettext('personalonly'), self::PERSONAL_ONLY); $args['blocks']['main']['options']['kolab_addressbook_prio'] = array( - 'title' => html::label($field_id, Q($this->gettext('addressbookprio'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('addressbookprio'))), 'content' => $select->show($prio), ); } diff --git a/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php b/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php index 72d776b9..26455cf1 100644 --- a/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php +++ b/plugins/kolab_addressbook/lib/kolab_addressbook_ui.php @@ -213,7 +213,7 @@ class kolab_addressbook_ui ); if (!empty($options) && ($options['norename'] || $options['protected'])) { - $foldername = Q(str_replace($delim, ' » ', kolab_storage::object_name($folder))); + $foldername = rcube::Q(str_replace($delim, ' » ', kolab_storage::object_name($folder))); } else { $foldername = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30)); @@ -264,7 +264,7 @@ class kolab_addressbook_ui foreach ($tab['fieldsets'] as $fieldset) { $subcontent = $this->get_form_part($fieldset); if ($subcontent) { - $content .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $subcontent) ."\n"; + $content .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($fieldset['name'])) . $subcontent) ."\n"; } } } @@ -273,7 +273,7 @@ class kolab_addressbook_ui } if ($content) { - $out .= html::tag('fieldset', null, html::tag('legend', null, Q($tab['name'])) . $content) ."\n"; + $out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) ."\n"; } } @@ -307,7 +307,7 @@ class kolab_addressbook_ui $colprop['id'] = '_'.$col; $label = !empty($colprop['label']) ? $colprop['label'] : $this->rc->gettext($col); - $table->add('title', sprintf('', $colprop['id'], Q($label))); + $table->add('title', sprintf('', $colprop['id'], rcube::Q($label))); $table->add(null, $colprop['value']); } $content = $table->show(); diff --git a/plugins/kolab_auth/kolab_auth.php b/plugins/kolab_auth/kolab_auth.php index ac4cc03a..926c5065 100644 --- a/plugins/kolab_auth/kolab_auth.php +++ b/plugins/kolab_auth/kolab_auth.php @@ -361,7 +361,7 @@ class kolab_auth extends rcube_plugin $input = new html_inputfield(array('name' => '_loginas', 'id' => 'rcmloginas', 'type' => 'text', 'autocomplete' => 'off')); $row = html::tag('tr', null, - html::tag('td', 'title', html::label('rcmloginas', Q($this->gettext('loginas')))) + html::tag('td', 'title', html::label('rcmloginas', rcube::Q($this->gettext('loginas')))) . html::tag('td', 'input', $input->show(trim(rcube_utils::get_input_value('_loginas', rcube_utils::INPUT_POST)))) ); $args['content'] = preg_replace('/<\/tbody>/i', $row . '', $args['content']); @@ -546,7 +546,7 @@ class kolab_auth extends rcube_plugin $args['abort'] = true; $args['error'] = $this->gettext(array( 'name' => 'loginasnotallowed', - 'vars' => array('user' => Q($loginas)), + 'vars' => array('user' => rcube::Q($loginas)), )); $message = sprintf( diff --git a/plugins/kolab_delegation/kolab_delegation.php b/plugins/kolab_delegation/kolab_delegation.php index c828093c..31e55d34 100644 --- a/plugins/kolab_delegation/kolab_delegation.php +++ b/plugins/kolab_delegation/kolab_delegation.php @@ -404,7 +404,7 @@ class kolab_delegation extends rcube_plugin foreach ($list as $id => $delegate) { $table->add_row(array('id' => 'rcmrow' . $id)); - $table->add(null, Q($delegate)); + $table->add(null, rcube::Q($delegate)); } $this->rc->output->add_gui_object('delegatelist', $attrib['id']); @@ -429,7 +429,7 @@ class kolab_delegation extends rcube_plugin if ($delegate) { $input = new html_hiddenfield(array('name' => $field_id, 'id' => $field_id, 'size' => 40)); - $input = Q($delegate['name']) . $input->show($id); + $input = rcube::Q($delegate['name']) . $input->show($id); $this->rc->output->set_env('active_delegate', $id); $this->rc->output->command('parent.enable_command','delegate-delete', true); @@ -522,7 +522,7 @@ class kolab_delegation extends rcube_plugin } } - $folder_id = 'rcmf' . html_identifier($folder); + $folder_id = 'rcmf' . rcube_utils::html_identifier($folder); $names[] = $origname; $classes = array('mailbox'); diff --git a/plugins/kolab_notes/kolab_notes.php b/plugins/kolab_notes/kolab_notes.php index 6d17e197..20341359 100644 --- a/plugins/kolab_notes/kolab_notes.php +++ b/plugins/kolab_notes/kolab_notes.php @@ -752,7 +752,7 @@ class kolab_notes extends rcube_plugin $saved = $folder->save($object, 'note', $note['uid']); if (!$saved) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error saving note object to Kolab server"), @@ -1188,7 +1188,7 @@ class kolab_notes extends rcube_plugin 'class' => 'kolabnotesref', 'rel' => $note['uid'] . '@' . $note['list'], 'target' => '_blank', - ), Q($note['title'])); + ), rcube::Q($note['title'])); } // prepend note links to message body diff --git a/plugins/kolab_notes/kolab_notes_ui.php b/plugins/kolab_notes/kolab_notes_ui.php index 394d138a..99cce46a 100644 --- a/plugins/kolab_notes/kolab_notes_ui.php +++ b/plugins/kolab_notes/kolab_notes_ui.php @@ -352,7 +352,7 @@ class kolab_notes_ui // add folder ACL tab if ($action != 'form-new') { $form['sharing'] = array( - 'name' => Q($this->plugin->gettext('tabsharing')), + 'name' => rcube::Q($this->plugin->gettext('tabsharing')), 'content' => html::tag('iframe', array( 'src' => $this->rc->url(array('_action' => 'folder-acl', '_folder' => $folder_name, 'framed' => 1)), 'width' => '100%', @@ -378,7 +378,7 @@ class kolab_notes_ui foreach ($tab['fields'] as $col => $colprop) { $label = !empty($colprop['label']) ? $colprop['label'] : $this->plugin->gettext($col); - $table->add('title', html::label($colprop['id'], Q($label))); + $table->add('title', html::label($colprop['id'], rcube::Q($label))); $table->add(null, $colprop['value']); } $content = $table->show(); @@ -388,7 +388,7 @@ class kolab_notes_ui } if (!empty($content)) { - $form_html .= html::tag('fieldset', null, html::tag('legend', null, Q($tab['name'])) . $content) . "\n"; + $form_html .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) . "\n"; } } diff --git a/plugins/kolab_zpush/kolab_zpush.php b/plugins/kolab_zpush/kolab_zpush.php index e9d1170e..6107f2c0 100644 --- a/plugins/kolab_zpush/kolab_zpush.php +++ b/plugins/kolab_zpush/kolab_zpush.php @@ -169,7 +169,7 @@ class kolab_zpush extends rcube_plugin $this->cache->remove('folders'); $this->cache->write('folders', $this->folders_meta); - $this->rc->output->command('plugin.zpush_save_complete', array('success' => !$err, 'id' => $imei, 'devicealias' => Q($devicealias))); + $this->rc->output->command('plugin.zpush_save_complete', array('success' => !$err, 'id' => $imei, 'devicealias' => rcube::Q($devicealias))); } if ($err) diff --git a/plugins/kolab_zpush/kolab_zpush_ui.php b/plugins/kolab_zpush/kolab_zpush_ui.php index 0e8e6e9d..780426d9 100644 --- a/plugins/kolab_zpush/kolab_zpush_ui.php +++ b/plugins/kolab_zpush/kolab_zpush_ui.php @@ -49,7 +49,7 @@ class kolab_zpush_ui foreach ($devices as $id => $device) { $name = $device['ALIAS'] ? $device['ALIAS'] : $id; $table->add_row(array('id' => 'rcmrow' . $id)); - $table->add(null, html::span('devicealias', Q($name)) . html::span('devicetype', Q($device['TYPE']))); + $table->add(null, html::span('devicealias', rcube::Q($name)) . html::span('devicetype', rcube::Q($device['TYPE']))); } $this->rc->output->add_gui_object('devicelist', $attrib['id']); @@ -150,7 +150,7 @@ class kolab_zpush_ui $classes[] = $folder_class; } - $folder_id = 'rcmf' . html_identifier($folder); + $folder_id = 'rcmf' . rcube_utils::html_identifier($folder); $table->add_row(); $table->add('subscription', $checkbox_sync->show('', array('value' => $folder, 'id' => $folder_id))); @@ -160,7 +160,7 @@ class kolab_zpush_ui else $table->add('alarm', ''); - $table->add(join(' ', $classes), html::label($folder_id, Q($foldername))); + $table->add(join(' ', $classes), html::label($folder_id, rcube::Q($foldername))); } return $table->show(); diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php index 9405d050..a36f27cc 100644 --- a/plugins/libcalendaring/lib/libcalendaring_itip.php +++ b/plugins/libcalendaring/lib/libcalendaring_itip.php @@ -103,7 +103,7 @@ class libcalendaring_itip $message = $this->compose_itip_message($event, $method, $rsvp); } - $mailto = rcube_idn_to_ascii($recipient['email']); + $mailto = rcube_utils::idn_to_ascii($recipient['email']); $headers = $message->headers(); $headers['To'] = format_email_recipient($mailto, $recipient['name']); @@ -212,9 +212,9 @@ class libcalendaring_itip */ public function compose_itip_message($event, $method, $rsvp = true) { - $from = rcube_idn_to_ascii($this->sender['email']); + $from = rcube_utils::idn_to_ascii($this->sender['email']); $from_utf = rcube_utils::idn_to_utf8($from); - $sender = format_email_recipient($from, $this->sender['name']); + $sender = format_email_recipient($from, $this->sender['name']); // truncate list attendees down to the recipient of the iTip Reply. // constraints for a METHOD:REPLY according to RFC 5546 @@ -426,7 +426,7 @@ class libcalendaring_itip $html = html::div('rsvp-status ' . $status_lc, $this->gettext(array( 'name' => 'attendee' . $status_lc, 'vars' => array( - 'delegatedto' => Q($event['delegated-to'] ?: ($attendee['delegated-to'] ?: '?')), + 'delegatedto' => rcube::Q($event['delegated-to'] ?: ($attendee['delegated-to'] ?: '?')), ) ))); } @@ -506,7 +506,7 @@ class libcalendaring_itip $update_button = html::tag('input', array( 'type' => 'button', 'class' => 'button', - 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task')", + 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . rcube::JQ($mime_id) . "', '$task')", 'value' => $this->gettext('updateattendeestatus'), )); @@ -514,13 +514,13 @@ class libcalendaring_itip $accept_buttons = html::tag('input', array( 'type' => 'button', 'class' => "button accept", - 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task')", + 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . rcube::JQ($mime_id) . "', '$task')", 'value' => $this->gettext('acceptattendee'), )); $accept_buttons .= html::tag('input', array( 'type' => 'button', 'class' => "button decline", - 'onclick' => "rcube_libcalendaring.decline_attendee_reply('" . JQ($mime_id) . "', '$task')", + 'onclick' => "rcube_libcalendaring.decline_attendee_reply('" . rcube::JQ($mime_id) . "', '$task')", 'value' => $this->gettext('declineattendee'), )); @@ -549,7 +549,7 @@ class libcalendaring_itip $rsvp_buttons .= html::tag('input', array( 'type' => 'button', 'class' => "button $method", - 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task', '$method', '$dom_id')", + 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . rcube::JQ($mime_id) . "', '$task', '$method', '$dom_id')", 'value' => $this->gettext('itip' . $method), )); } @@ -560,7 +560,7 @@ class libcalendaring_itip $rsvp_buttons .= html::tag('input', array( 'type' => 'button', 'class' => "button preview", - 'onclick' => "rcube_libcalendaring.open_itip_preview('" . JQ($preview_url) . "', '" . JQ($msgref) . "')", + 'onclick' => "rcube_libcalendaring.open_itip_preview('" . rcube::JQ($preview_url) . "', '" . rcube::JQ($msgref) . "')", 'value' => $this->gettext('openpreview'), )); } @@ -569,7 +569,7 @@ class libcalendaring_itip $update_button = html::tag('input', array( 'type' => 'button', 'class' => 'button', - 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task')", + 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . rcube::JQ($mime_id) . "', '$task')", 'value' => $this->gettext('updatemycopy'), )); @@ -577,7 +577,7 @@ class libcalendaring_itip $import_button = html::tag('input', array( 'type' => 'button', 'class' => 'button', - 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task')", + 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . rcube::JQ($mime_id) . "', '$task')", 'value' => $this->gettext('importtocalendar'), )); @@ -615,7 +615,7 @@ class libcalendaring_itip $button_remove = html::tag('input', array( 'type' => 'button', 'class' => 'button', - 'onclick' => "rcube_libcalendaring.remove_from_itip(" . rcube_output::json_serialize($event_prop) . ", '$task', '" . JQ($event['title']) . "')", + 'onclick' => "rcube_libcalendaring.remove_from_itip(" . rcube_output::json_serialize($event_prop) . ", '$task', '" . rcube::JQ($event['title']) . "')", 'value' => $this->gettext('removefromcalendar'), )); @@ -623,7 +623,7 @@ class libcalendaring_itip $button_update = html::tag('input', array( 'type' => 'button', 'class' => 'button', - 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . JQ($mime_id) . "', '$task')", + 'onclick' => "rcube_libcalendaring.add_from_itip_mail('" . rcube::JQ($mime_id) . "', '$task')", 'value' => $this->gettext('updatemycopy'), )); @@ -734,14 +734,14 @@ class libcalendaring_itip { $table = new html_table(array('cols' => 2, 'border' => 0, 'class' => 'calendar-eventdetails')); $table->add('ititle', $title); - $table->add('title', Q($event['title'])); + $table->add('title', rcube::Q($event['title'])); if ($event['start'] && $event['end']) { $table->add('label', $this->gettext('date')); - $table->add('date', Q($this->lib->event_date_text($event))); + $table->add('date', rcube::Q($this->lib->event_date_text($event))); } else if ($event['due'] && $event['_type'] == 'task') { $table->add('label', $this->gettext('date')); - $table->add('date', Q($this->lib->event_date_text($event))); + $table->add('date', rcube::Q($this->lib->event_date_text($event))); } if (!empty($event['recurrence_date'])) { $table->add('label', ''); @@ -753,7 +753,7 @@ class libcalendaring_itip } if ($event['location']) { $table->add('label', $this->gettext('location')); - $table->add('location', Q($event['location'])); + $table->add('location', rcube::Q($event['location'])); } if ($event['sensitivity'] && $event['sensitivity'] != 'public') { $table->add('label', $this->gettext('sensitivity')); @@ -765,7 +765,7 @@ class libcalendaring_itip } if ($event['comment']) { $table->add('label', $this->gettext('comment')); - $table->add('location', Q($event['comment'])); + $table->add('location', rcube::Q($event['comment'])); } return $table->show(); diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php index 3b86fd12..9c9405ce 100644 --- a/plugins/libcalendaring/libcalendaring.php +++ b/plugins/libcalendaring/libcalendaring.php @@ -310,17 +310,17 @@ class libcalendaring extends rcube_plugin $time_format = self::to_php_date_format($this->rc->config->get('calendar_time_format', $this->defaults['calendar_time_format'])); if ($event['allday']) { - $fromto = format_date($event['start'], $date_format); - if (($todate = format_date($event['end'], $date_format)) != $fromto) + $fromto = $this->rc->format_date($event['start'], $date_format); + if (($todate = $this->rc->format_date($event['end'], $date_format)) != $fromto) $fromto .= ' - ' . $todate; } else if ($duration < 86400 && $event['start']->format('d') == $event['end']->format('d')) { - $fromto = format_date($event['start'], $date_format) . ' ' . format_date($event['start'], $time_format) . - ' - ' . format_date($event['end'], $time_format); + $fromto = $this->rc->format_date($event['start'], $date_format) . ' ' . $this->rc->format_date($event['start'], $time_format) . + ' - ' . $this->rc->format_date($event['end'], $time_format); } else { - $fromto = format_date($event['start'], $date_format) . ' ' . format_date($event['start'], $time_format) . - ' - ' . format_date($event['end'], $date_format) . ' ' . format_date($event['end'], $time_format); + $fromto = $this->rc->format_date($event['start'], $date_format) . ' ' . $this->rc->format_date($event['start'], $time_format) . + ' - ' . $this->rc->format_date($event['end'], $date_format) . ' ' . $this->rc->format_date($event['end'], $time_format); } // add timezone information @@ -825,7 +825,7 @@ class libcalendaring extends rcube_plugin $until = $this->gettext(array('name' => 'forntimes', 'vars' => array('nr' => $rrule['COUNT']))); } else if ($rrule['UNTIL']) { - $until = $this->gettext('recurrencend') . ' ' . format_date($rrule['UNTIL'], self::to_php_date_format($this->rc->config->get('calendar_date_format', $this->defaults['calendar_date_format']))); + $until = $this->gettext('recurrencend') . ' ' . $this->rc->format_date($rrule['UNTIL'], self::to_php_date_format($this->rc->config->get('calendar_date_format', $this->defaults['calendar_date_format']))); } else { $until = $this->gettext('forever'); @@ -835,7 +835,7 @@ class libcalendaring extends rcube_plugin if (is_array($rrule['EXDATE']) && !empty($rrule['EXDATE'])) { $format = self::to_php_date_format($this->rc->config->get('calendar_date_format', $this->defaults['calendar_date_format'])); $exdates = array_map( - function($dt) use ($format) { return format_date($dt, $format); }, + function($dt) use ($format) { return rcmail::get_instance()->format_date($dt, $format); }, array_slice($rrule['EXDATE'], 0, 10) ); $except = '; ' . $this->gettext('except') . ' ' . join(', ', $exdates); @@ -1108,7 +1108,7 @@ class libcalendaring extends rcube_plugin )); } else { - $button = Q($this->rc->gettext('delete')); + $button = rcube::Q($this->rc->gettext('delete')); } $content = html::a(array( @@ -1119,7 +1119,7 @@ class libcalendaring extends rcube_plugin 'aria-label' => $this->rc->gettext('delete') . ' ' . $attachment['name'], ), $button); - $content .= Q($attachment['name']); + $content .= rcube::Q($attachment['name']); $this->rc->output->command('add2attachment_list', "rcmfile$id", array( 'html' => $content, @@ -1131,7 +1131,7 @@ class libcalendaring extends rcube_plugin else { // upload failed if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { $msg = $this->rc->gettext(array('name' => 'filesizeerror', 'vars' => array( - 'size' => show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); + 'size' => $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); } else if ($attachment['error']) { $msg = $attachment['error']; @@ -1150,7 +1150,7 @@ class libcalendaring extends rcube_plugin // show filesizeerror instead of fileuploaderror if ($maxsize = ini_get('post_max_size')) $msg = $this->rc->gettext(array('name' => 'filesizeerror', 'vars' => array( - 'size' => show_bytes(parse_bytes($maxsize))))); + 'size' => $this->rc->show_bytes(parse_bytes($maxsize))))); else $msg = $this->rc->gettext('fileuploaderror'); @@ -1250,7 +1250,7 @@ class libcalendaring extends rcube_plugin header('Content-Type: text/html; charset=' . RCUBE_CHARSET); print "\n\n" - . '' . "\n" + . '' . "\n" . '' . "\n" . "\n\n$message\n\n"; exit; @@ -1283,21 +1283,21 @@ class libcalendaring extends rcube_plugin $table = new html_table(array('cols' => $dl_link ? 3 : 2)); if (!empty($this->attachment['name'])) { - $table->add('title', Q($this->rc->gettext('filename'))); - $table->add('header', Q($this->attachment['name'])); + $table->add('title', rcube::Q($this->rc->gettext('filename'))); + $table->add('header', rcube::Q($this->attachment['name'])); if ($dl_link) { - $table->add('download-link', html::a($dl_url, Q($this->rc->gettext('download')))); + $table->add('download-link', html::a($dl_url, rcube::Q($this->rc->gettext('download')))); } } if (!empty($this->attachment['mimetype'])) { - $table->add('title', Q($this->rc->gettext('type'))); - $table->add('header', Q($this->attachment['mimetype'])); + $table->add('title', rcube::Q($this->rc->gettext('type'))); + $table->add('header', rcube::Q($this->attachment['mimetype'])); } if (!empty($this->attachment['size'])) { - $table->add('title', Q($this->rc->gettext('filesize'))); - $table->add('header', Q(show_bytes($this->attachment['size']))); + $table->add('title', rcube::Q($this->rc->gettext('filesize'))); + $table->add('header', rcube::Q($this->rc->show_bytes($this->attachment['size']))); } $this->rc->output->set_env('attachment_download_url', $dl_url); diff --git a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php index de702677..614799bc 100644 --- a/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php +++ b/plugins/tasklist/drivers/kolab/tasklist_kolab_driver.php @@ -1362,7 +1362,7 @@ class tasklist_kolab_driver extends tasklist_driver $this->_parse_id($task); $list_id = $task['list']; if (!$list_id || !($folder = $this->get_folder($list_id))) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Invalid list identifer to save taks: " . var_dump($list_id, true)), @@ -1399,7 +1399,7 @@ class tasklist_kolab_driver extends tasklist_driver $saved = $folder->save($object, 'task', $task['uid']); if (!$saved) { - raise_error(array( + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "Error saving task object to Kolab server"), @@ -1657,7 +1657,7 @@ class tasklist_kolab_driver extends tasklist_driver // add folder ACL tab if ($action != 'form-new') { $form['sharing'] = array( - 'name' => Q($this->plugin->gettext('tabsharing')), + 'name' => rcube::Q($this->plugin->gettext('tabsharing')), 'content' => html::tag('iframe', array( 'src' => $this->rc->url(array('_action' => 'folder-acl', '_folder' => $folder_name, 'framed' => 1)), 'width' => '100%', @@ -1683,7 +1683,7 @@ class tasklist_kolab_driver extends tasklist_driver foreach ($tab['fields'] as $col => $colprop) { $label = !empty($colprop['label']) ? $colprop['label'] : $this->plugin->gettext($col); - $table->add('title', html::label($colprop['id'], Q($label))); + $table->add('title', html::label($colprop['id'], rcube::Q($label))); $table->add(null, $colprop['value']); } $content = $table->show(); @@ -1693,7 +1693,7 @@ class tasklist_kolab_driver extends tasklist_driver } if (!empty($content)) { - $form_html .= html::tag('fieldset', null, html::tag('legend', null, Q($tab['name'])) . $content) . "\n"; + $form_html .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) . "\n"; } }