diff --git a/bin/cleandb.sh b/bin/cleandb.sh index ea905c873..3a3c2572e 100755 --- a/bin/cleandb.sh +++ b/bin/cleandb.sh @@ -48,7 +48,7 @@ $threshold = date('Y-m-d 00:00:00', time() - $days * 86400); foreach (array('contacts','contactgroups','identities') as $table) { - $sqltable = get_table_name($table); + $sqltable = $db->table_name($table); // also delete linked records // could be skipped for databases which respect foreign key constraints diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 4a00d5f58..a0fd2efa9 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -268,7 +268,7 @@ class archive extends rcube_plugin $archive_type->add($this->gettext('archivetypefolder'), 'folder'); $args['blocks']['archive'] = array( - 'name' => Q(rcube_label('settingstitle', 'archive')), + 'name' => Q($this->gettext('settingstitle')), 'options' => array('archive_type' => array( 'title' => $this->gettext('archivetype'), 'content' => $archive_type->show($rcmail->config->get('archive_type')) diff --git a/program/include/rcmail.php b/program/include/rcmail.php index cefbc4d14..dbf56e55f 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1870,7 +1870,7 @@ class rcmail extends rcube } $this->output->set_env('max_filesize', $max_filesize); - $max_filesize = self::show_bytes($max_filesize); + $max_filesize = $this->show_bytes($max_filesize); $this->output->set_env('filesizeerror', $this->gettext(array( 'name' => 'filesizeerror', 'vars' => array('size' => $max_filesize)))); diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php index 2d4aa0838..0da3e2c87 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -1618,11 +1618,12 @@ class rcube_ldap extends rcube_addressbook // special case: list groups from 'group_filters' config if ($vlv_page === null && !empty($this->prop['group_filters'])) { $groups = array(); + $rcube = rcube::get_instance(); // list regular groups configuration as special filter if (!empty($this->prop['groups']['filter'])) { $id = '__groups__'; - $groups[$id] = array('ID' => $id, 'name' => rcube_label('groups'), 'virtual' => true) + $this->prop['groups']; + $groups[$id] = array('ID' => $id, 'name' => $rcube->gettext('groups'), 'virtual' => true) + $this->prop['groups']; } foreach ($this->prop['group_filters'] as $id => $prop) { diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc index d4387194a..9af22ec35 100644 --- a/program/steps/addressbook/copy.inc +++ b/program/steps/addressbook/copy.inc @@ -25,8 +25,8 @@ if (!$OUTPUT->ajax_call) $cids = rcmail_get_cids(); -$target = get_input_value('_to', RCUBE_INPUT_POST); -$target_group = get_input_value('_togid', RCUBE_INPUT_POST); +$target = rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST); +$target_group = rcube_utils::get_input_value('_togid', rcube_utils::INPUT_POST); $success = 0; $errormsg = 'copyerror'; diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc index e8aafe5a9..b2aac8a71 100644 --- a/program/steps/addressbook/delete.inc +++ b/program/steps/addressbook/delete.inc @@ -61,8 +61,8 @@ foreach ($cids as $source => $cid) $error = 'contactdelerror'; } - $source = get_input_value('_source', RCUBE_INPUT_GPC); - $group = get_input_value('_gid', RCUBE_INPUT_GPC); + $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC); + $group = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC); $OUTPUT->show_message($error, 'error'); $OUTPUT->command('list_contacts', $source, $group); @@ -126,8 +126,8 @@ $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result)); if (!empty($_SESSION['contact_undo'])) { $_SESSION['contact_undo']['ts'] = time(); - $msg = html::span(null, rcube_label('contactdeleted')) - . ' ' . html::a(array('onclick' => JS_OBJECT_NAME.".command('undo', '', this)"), rcube_label('undo')); + $msg = html::span(null, $RCMAIL->gettext('contactdeleted')) + . ' ' . html::a(array('onclick' => rcmail_output::JS_OBJECT_NAME.".command('undo', '', this)"), $RCMAIL->gettext('undo')); $OUTPUT->show_message($msg, 'confirmation', null, true, $undo_time); } diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc index de78baa1b..b5f51d883 100644 --- a/program/steps/addressbook/edit.inc +++ b/program/steps/addressbook/edit.inc @@ -36,12 +36,12 @@ if ($RCMAIL->action == 'edit') { // editing not allowed here if ($CONTACTS->readonly || $record['readonly']) { $OUTPUT->show_message('sourceisreadonly'); - rcmail_overwrite_action('show'); + $RCMAIL->overwrite_action('show'); return; } } else { - $source = get_input_value('_source', RCUBE_INPUT_GPC); + $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC); if (strlen($source)) { $CONTACTS = $RCMAIL->get_address_book($source, true); @@ -125,7 +125,7 @@ function rcmail_contact_editform($attrib) $form = array( 'contact' => array( - 'name' => rcube_label('properties'), + 'name' => $RCMAIL->gettext('properties'), 'content' => array( 'email' => array('size' => $i_size, 'visible' => true), 'phone' => array('size' => $i_size, 'visible' => true), @@ -135,7 +135,7 @@ function rcmail_contact_editform($attrib) ), ), 'personal' => array( - 'name' => rcube_label('personalinfo'), + 'name' => $RCMAIL->gettext('personalinfo'), 'content' => array( 'gender' => array('visible' => true), 'maidenname' => array('size' => $i_size), @@ -150,7 +150,7 @@ function rcmail_contact_editform($attrib) if (isset($CONTACT_COLTYPES['notes'])) { $form['notes'] = array( - 'name' => rcube_label('notes'), + 'name' => $RCMAIL->gettext('notes'), 'content' => array( 'notes' => array('size' => $t_cols, 'rows' => $t_rows, 'label' => false, 'visible' => true, 'limit' => 1), ), @@ -169,7 +169,7 @@ function rcmail_contact_editform($attrib) function rcmail_upload_photo_form($attrib) { - global $OUTPUT; + global $RCMAIL, $OUTPUT; // set defaults $attrib += array('id' => 'rcmUploadform', 'buttons' => 'yes'); @@ -179,7 +179,7 @@ function rcmail_upload_photo_form($attrib) $max_postsize = parse_bytes(ini_get('post_max_size')); if ($max_postsize && $max_postsize < $max_filesize) $max_filesize = $max_postsize; - $max_filesize = show_bytes($max_filesize); + $max_filesize = $RCMAIL->show_bytes($max_filesize); $hidden = new html_hiddenfield(array('name' => '_cid', 'value' => $GLOBALS['cid'])); $input = new html_inputfield(array('type' => 'file', 'name' => '_photo', 'size' => $attrib['size'])); @@ -189,10 +189,10 @@ function rcmail_upload_photo_form($attrib) $OUTPUT->form_tag(array('id' => $attrib['id'].'Frm', 'name' => 'uploadform', 'method' => 'post', 'enctype' => 'multipart/form-data'), $hidden->show() . html::div(null, $input->show()) . - html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . - (get_boolean($attrib['buttons']) ? html::div('buttons', - $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' . - $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('upload-photo', this.form)")) + html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . + (rcube_utils::get_boolean($attrib['buttons']) ? html::div('buttons', + $button->show($RCMAIL->gettext('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' . + $button->show($RCMAIL->gettext('upload'), array('class' => 'button mainaction', 'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('upload-photo', this.form)")) ) : '') ) ); @@ -247,7 +247,7 @@ function rcmail_source_selector($attrib) $attrib['name'] = '_source'; $attrib['is_escaped'] = true; - $attrib['onchange'] = JS_OBJECT_NAME . ".command('save', 'reload', this.form)"; + $attrib['onchange'] = rcmail_output::JS_OBJECT_NAME . ".command('save', 'reload', this.form)"; $select = new html_select($attrib); diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc index 1e988feab..c112f08a3 100644 --- a/program/steps/addressbook/export.inc +++ b/program/steps/addressbook/export.inc @@ -140,7 +140,7 @@ else { } // send downlaod headers -header('Content-Type: text/x-vcard; charset='.RCMAIL_CHARSET); +header('Content-Type: text/x-vcard; charset='.RCUBE_CHARSET); header('Content-Disposition: attachment; filename="contacts.vcf"'); while ($result && ($row = $result->next())) { diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index f94d15338..db21be290 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -23,36 +23,36 @@ $SEARCH_MODS_DEFAULT = array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1 // general definition of contact coltypes $CONTACT_COLTYPES = array( - 'name' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('name'), 'category' => 'main'), - 'firstname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('firstname'), 'category' => 'main'), - 'surname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('surname'), 'category' => 'main'), - 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'), - 'middlename' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('middlename'), 'category' => 'main'), - 'prefix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => rcube_label('nameprefix'), 'category' => 'main'), - 'suffix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => rcube_label('namesuffix'), 'category' => 'main'), - 'nickname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('nickname'), 'category' => 'main'), - 'jobtitle' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('jobtitle'), 'category' => 'main'), - 'organization' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('organization'), 'category' => 'main'), - 'department' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('department'), 'category' => 'main'), - 'gender' => array('type' => 'select', 'limit' => 1, 'label' => rcube_label('gender'), 'options' => array('male' => rcube_label('male'), 'female' => rcube_label('female')), 'category' => 'personal'), - 'maidenname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('maidenname'), 'category' => 'personal'), - 'phone' => array('type' => 'text', 'size' => 40, 'maxlength' => 20, 'label' => rcube_label('phone'), 'subtypes' => array('home','home2','work','work2','mobile','main','homefax','workfax','car','pager','video','assistant','other'), 'category' => 'main'), - 'address' => array('type' => 'composite', 'label' => rcube_label('address'), 'subtypes' => array('home','work','other'), 'childs' => array( - 'street' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('street'), 'category' => 'main'), - 'locality' => array('type' => 'text', 'size' => 28, 'maxlength' => 50, 'label' => rcube_label('locality'), 'category' => 'main'), - 'zipcode' => array('type' => 'text', 'size' => 8, 'maxlength' => 15, 'label' => rcube_label('zipcode'), 'category' => 'main'), - 'region' => array('type' => 'text', 'size' => 12, 'maxlength' => 50, 'label' => rcube_label('region'), 'category' => 'main'), - 'country' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('country'), 'category' => 'main'), + 'name' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('name'), 'category' => 'main'), + 'firstname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('firstname'), 'category' => 'main'), + 'surname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('surname'), 'category' => 'main'), + 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => $RCMAIL->gettext('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'), + 'middlename' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('middlename'), 'category' => 'main'), + 'prefix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => $RCMAIL->gettext('nameprefix'), 'category' => 'main'), + 'suffix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => $RCMAIL->gettext('namesuffix'), 'category' => 'main'), + 'nickname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('nickname'), 'category' => 'main'), + 'jobtitle' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('jobtitle'), 'category' => 'main'), + 'organization' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('organization'), 'category' => 'main'), + 'department' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('department'), 'category' => 'main'), + 'gender' => array('type' => 'select', 'limit' => 1, 'label' => $RCMAIL->gettext('gender'), 'options' => array('male' => $RCMAIL->gettext('male'), 'female' => $RCMAIL->gettext('female')), 'category' => 'personal'), + 'maidenname' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('maidenname'), 'category' => 'personal'), + 'phone' => array('type' => 'text', 'size' => 40, 'maxlength' => 20, 'label' => $RCMAIL->gettext('phone'), 'subtypes' => array('home','home2','work','work2','mobile','main','homefax','workfax','car','pager','video','assistant','other'), 'category' => 'main'), + 'address' => array('type' => 'composite', 'label' => $RCMAIL->gettext('address'), 'subtypes' => array('home','work','other'), 'childs' => array( + 'street' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('street'), 'category' => 'main'), + 'locality' => array('type' => 'text', 'size' => 28, 'maxlength' => 50, 'label' => $RCMAIL->gettext('locality'), 'category' => 'main'), + 'zipcode' => array('type' => 'text', 'size' => 8, 'maxlength' => 15, 'label' => $RCMAIL->gettext('zipcode'), 'category' => 'main'), + 'region' => array('type' => 'text', 'size' => 12, 'maxlength' => 50, 'label' => $RCMAIL->gettext('region'), 'category' => 'main'), + 'country' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('country'), 'category' => 'main'), ), 'category' => 'main'), - 'birthday' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => rcube_label('birthday'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'), - 'anniversary' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => rcube_label('anniversary'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'), - 'website' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('website'), 'subtypes' => array('homepage','work','blog','profile','other'), 'category' => 'main'), - 'im' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('instantmessenger'), 'subtypes' => array('aim','icq','msn','yahoo','jabber','skype','other'), 'category' => 'main'), - 'notes' => array('type' => 'textarea', 'size' => 40, 'rows' => 15, 'maxlength' => 500, 'label' => rcube_label('notes'), 'limit' => 1), + 'birthday' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => $RCMAIL->gettext('birthday'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'), + 'anniversary' => array('type' => 'date', 'size' => 12, 'maxlength' => 16, 'label' => $RCMAIL->gettext('anniversary'), 'limit' => 1, 'render_func' => 'rcmail_format_date_col', 'category' => 'personal'), + 'website' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('website'), 'subtypes' => array('homepage','work','blog','profile','other'), 'category' => 'main'), + 'im' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => $RCMAIL->gettext('instantmessenger'), 'subtypes' => array('aim','icq','msn','yahoo','jabber','skype','other'), 'category' => 'main'), + 'notes' => array('type' => 'textarea', 'size' => 40, 'rows' => 15, 'maxlength' => 500, 'label' => $RCMAIL->gettext('notes'), 'limit' => 1), 'photo' => array('type' => 'image', 'limit' => 1, 'category' => 'main'), - 'assistant' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('assistant'), 'category' => 'personal'), - 'manager' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('manager'), 'category' => 'personal'), - 'spouse' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('spouse'), 'category' => 'personal'), + 'assistant' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('assistant'), 'category' => 'personal'), + 'manager' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('manager'), 'category' => 'personal'), + 'spouse' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => $RCMAIL->gettext('spouse'), 'category' => 'personal'), // TODO: define fields for vcards like GEO, KEY ); @@ -83,12 +83,12 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) { $OUTPUT->set_env('writable_source', $writeable); $OUTPUT->set_env('compose_extwin', $RCMAIL->config->get('compose_extwin',false)); - $OUTPUT->set_pagetitle(rcube_label('addressbook')); + $OUTPUT->set_pagetitle($RCMAIL->gettext('addressbook')); $_SESSION['addressbooks_count'] = $count; $_SESSION['addressbooks_count_writeable'] = $writeable; // select address book - $source = get_input_value('_source', RCUBE_INPUT_GPC); + $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC); // use first directory by default if (!strlen($source) || !isset($js_list[$source])) { @@ -115,7 +115,7 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false) global $RCMAIL, $OUTPUT, $CONTACT_COLTYPES, $PAGE_SIZE; if (!strlen($source)) { - $source = get_input_value('_source', RCUBE_INPUT_GPC); + $source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC); } // Get object @@ -129,7 +129,7 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false) $CONTACTS->set_page(isset($_SESSION['page']) ? $_SESSION['page'] : 1); if (!empty($_REQUEST['_gid'])) - $CONTACTS->set_group(get_input_value('_gid', RCUBE_INPUT_GPC)); + $CONTACTS->set_group(rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC)); if (!$init_env) return $CONTACTS; @@ -162,13 +162,13 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false) function rcmail_set_sourcename($abook) { - global $OUTPUT; + global $OUTPUT, $RCMAIL; // get address book name (for display) if ($abook && $_SESSION['addressbooks_count'] > 1) { $name = $abook->get_name(); if (!$name) { - $name = rcube_label('personaladrbook'); + $name = $RCMAIL->gettext('personaladrbook'); } $OUTPUT->set_env('sourcename', html_entity_decode($name, ENT_COMPAT, 'UTF-8')); } @@ -189,17 +189,17 @@ function rcmail_directory_list($attrib) 'id' => 'rcmli%s', 'class' => '%s', 'noclose' => true), html::a(array('href' => '%s', 'rel' => '%s', - 'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s')); + 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('list','%s',this)"), '%s')); $sources = (array) $OUTPUT->get_env('address_sources'); reset($sources); // currently selected source - $current = get_input_value('_source', RCUBE_INPUT_GPC); + $current = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC); foreach ($sources as $j => $source) { $id = strval(strlen($source['id']) ? $source['id'] : $j); - $js_id = JQ($id); + $js_id = rcube::JQ($id); // set class name(s) $class_name = 'addressbook'; @@ -214,7 +214,7 @@ function rcmail_directory_list($attrib) $out .= sprintf($line_templ, rcube_utils::html_identifier($id, true), $class_name, - Q(rcmail_url(null, array('_source' => $id))), + rcube::Q($RCMAIL->url(array('_source' => $id))), $source['id'], $js_id, $name); @@ -229,13 +229,13 @@ function rcmail_directory_list($attrib) $line_templ = html::tag('li', array( 'id' => 'rcmli%s', 'class' => '%s'), html::a(array('href' => '#', 'rel' => 'S%s', - 'onclick' => "return ".JS_OBJECT_NAME.".command('listsearch', '%s', this)"), '%s')); + 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('listsearch', '%s', this)"), '%s')); // Saved searches $sources = $RCMAIL->user->list_searches(rcube_user::SEARCH_ADDRESSBOOK); foreach ($sources as $j => $source) { $id = $source['id']; - $js_id = JQ($id); + $js_id = rcube::JQ($id); // set class name(s) $class_name = 'contactsearch'; @@ -248,7 +248,7 @@ function rcmail_directory_list($attrib) rcube_utils::html_identifier('S'.$id, true), $class_name, $id, - $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id))); + $js_id, (!empty($source['name']) ? rcube::Q($source['name']) : rcube::Q($id))); } $OUTPUT->set_env('contactgroups', $jsdata); @@ -275,7 +275,7 @@ function rcmail_contact_groups($args) 'id' => 'rcmli%s', 'class' => 'contactgroup'), html::a(array('href' => '#', 'rel' => '%s:%s', - 'onclick' => "return ".JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s')); + 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s')); // append collapse/expand toggle and open a new
' . Q($prefix) . "
\n"; + $prefix = '' . rcube::Q($prefix) . "
\n"; $prefix .= ''; if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting @@ -985,19 +985,19 @@ function rcmail_create_forward_body($body, $bodyIsHtml) if (!isset($COMPOSE['forward_attachments']) && is_array($MESSAGE->mime_parts)) $cid_map = rcmail_write_compose_attachments($MESSAGE, $bodyIsHtml); - $date = format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')); + $date = $RCMAIL->format_date($MESSAGE->headers->date, $RCMAIL->config->get('date_long')); if (!$bodyIsHtml) { - $prefix = "\n\n\n-------- " . rcube_label('originalmessage') . " --------\n"; - $prefix .= rcube_label('subject') . ': ' . $MESSAGE->subject . "\n"; - $prefix .= rcube_label('date') . ': ' . $date . "\n"; - $prefix .= rcube_label('from') . ': ' . $MESSAGE->get_header('from') . "\n"; - $prefix .= rcube_label('to') . ': ' . $MESSAGE->get_header('to') . "\n"; + $prefix = "\n\n\n-------- " . $RCMAIL->gettext('originalmessage') . " --------\n"; + $prefix .= $RCMAIL->gettext('subject') . ': ' . $MESSAGE->subject . "\n"; + $prefix .= $RCMAIL->gettext('date') . ': ' . $date . "\n"; + $prefix .= $RCMAIL->gettext('from') . ': ' . $MESSAGE->get_header('from') . "\n"; + $prefix .= $RCMAIL->gettext('to') . ': ' . $MESSAGE->get_header('to') . "\n"; if ($cc = $MESSAGE->headers->get('cc')) - $prefix .= rcube_label('cc') . ': ' . $cc . "\n"; + $prefix .= $RCMAIL->gettext('cc') . ': ' . $cc . "\n"; if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from')) - $prefix .= rcube_label('replyto') . ': ' . $replyto . "\n"; + $prefix .= $RCMAIL->gettext('replyto') . ': ' . $replyto . "\n"; $prefix .= "\n"; $body = trim($body, "\r\n"); @@ -1009,24 +1009,24 @@ function rcmail_create_forward_body($body, $bodyIsHtml) $body = rcmail_wash_html($body, array('safe' => $MESSAGE->is_safe), $cid_map); $prefix = sprintf( - "-------- " . rcube_label('originalmessage') . " --------
" . + "-------- " . $RCMAIL->gettext('originalmessage') . " --------
" . "" . "
" . " %s: %s " . " %s: %s " . " %s: %s ", - rcube_label('subject'), Q($MESSAGE->subject), - rcube_label('date'), Q($date), - rcube_label('from'), Q($MESSAGE->get_header('from'), 'replace'), - rcube_label('to'), Q($MESSAGE->get_header('to'), 'replace')); + $RCMAIL->gettext('subject'), rcube::Q($MESSAGE->subject), + $RCMAIL->gettext('date'), rcube::Q($date), + $RCMAIL->gettext('from'), rcube::Q($MESSAGE->get_header('from'), 'replace'), + $RCMAIL->gettext('to'), rcube::Q($MESSAGE->get_header('to'), 'replace')); if ($cc = $MESSAGE->headers->get('cc')) $prefix .= sprintf(" %s: %s ", - rcube_label('cc'), Q($cc, 'replace')); + $RCMAIL->gettext('cc'), rcube::Q($cc, 'replace')); if (($replyto = $MESSAGE->headers->get('reply-to')) && $replyto != $MESSAGE->get_header('from')) $prefix .= sprintf(" %s: %s ", - rcube_label('replyto'), Q($replyto, 'replace')); + $RCMAIL->gettext('replyto'), rcube::Q($replyto, 'replace')); $prefix .= " %s: %s
"; } @@ -1330,7 +1330,7 @@ function rcmail_save_image($path, $mimetype='') $attachment = array( 'group' => $COMPOSE['id'], 'name' => $name, - 'mimetype' => $mimetype ? $mimetype : rc_mime_content_type($path, $name), + 'mimetype' => $mimetype ? $mimetype : rcube_mime::file_content_type($path, $name), 'data' => $data, 'size' => strlen($data), ); @@ -1370,7 +1370,7 @@ function rcmail_compose_subject($attrib) // use subject from post if (isset($_POST['_subject'])) { - $subject = get_input_value('_subject', RCUBE_INPUT_POST, TRUE); + $subject = rcube_utils::get_input_value('_subject', rcube_utils::INPUT_POST, TRUE); } // create a reply-subject else if ($compose_mode == RCUBE_COMPOSE_REPLY) { @@ -1404,7 +1404,7 @@ function rcmail_compose_subject($attrib) function rcmail_compose_attachment_list($attrib) { - global $OUTPUT, $CONFIG, $COMPOSE; + global $RCMAIL, $OUTPUT, $CONFIG, $COMPOSE; // add ID if not given if (!$attrib['id']) @@ -1418,11 +1418,11 @@ function rcmail_compose_attachment_list($attrib) if ($attrib['deleteicon']) { $button = html::img(array( 'src' => $CONFIG['skin_path'] . $attrib['deleteicon'], - 'alt' => rcube_label('delete') + 'alt' => $RCMAIL->gettext('delete') )); } else if (rcube_utils::get_boolean($attrib['textbuttons'])) { - $button = Q(rcube_label('delete')); + $button = rcube::Q($RCMAIL->gettext('delete')); } foreach ($COMPOSE['attachments'] as $id => $a_prop) { @@ -1432,17 +1432,17 @@ function rcmail_compose_attachment_list($attrib) $out .= html::tag('li', array( 'id' => 'rcmfile'.$id, - 'class' => rcmail_filetype2classname($a_prop['mimetype'], $a_prop['name']), + 'class' => rcube_utils::file2class($a_prop['mimetype'], $a_prop['name']), 'onmouseover' => "rcube_webmail.long_subject_title_ex(this, 0)", ), html::a(array( 'href' => "#delete", - 'title' => rcube_label('delete'), - 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", JS_OBJECT_NAME, $id), + 'title' => $RCMAIL->gettext('delete'), + 'onclick' => sprintf("return %s.command('remove-attachment','rcmfile%s', this)", rcmail_output::JS_OBJECT_NAME, $id), 'class' => 'delete' ), $button - ) . Q($a_prop['name']) + ) . rcube::Q($a_prop['name']) ); $jslist['rcmfile'.$id] = array('name' => $a_prop['name'], 'complete' => true, 'mimetype' => $a_prop['mimetype']); @@ -1467,23 +1467,23 @@ function rcmail_compose_attachment_list($attrib) function rcmail_compose_attachment_form($attrib) { - global $OUTPUT; + global $OUTPUT, $RCMAIL; // set defaults $attrib += array('id' => 'rcmUploadbox', 'buttons' => 'yes'); // Get filesize, enable upload progress bar - $max_filesize = rcube_upload_init(); + $max_filesize = $RCMAIL->upload_init(); $button = new html_inputfield(array('type' => 'button')); $out = html::div($attrib, $OUTPUT->form_tag(array('id' => $attrib['id'].'Frm', 'name' => 'uploadform', 'method' => 'post', 'enctype' => 'multipart/form-data'), html::div(null, rcmail_compose_attachment_field()) . - html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . - (get_boolean($attrib['buttons']) ? html::div('buttons', - $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' . - $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('send-attachment', this.form)")) + html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . + (rcube_utils::get_boolean($attrib['buttons']) ? html::div('buttons', + $button->show($RCMAIL->gettext('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' . + $button->show($RCMAIL->gettext('upload'), array('class' => 'button mainaction', 'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('send-attachment', this.form)")) ) : '') ) ); @@ -1506,7 +1506,7 @@ function rcmail_compose_attachment_field($attrib = array()) function rcmail_priority_selector($attrib) { - global $MESSAGE; + global $RCMAIL, $MESSAGE; list($form_start, $form_end) = get_form_tags($attrib); unset($attrib['form']); @@ -1514,11 +1514,11 @@ function rcmail_priority_selector($attrib) $attrib['name'] = '_priority'; $selector = new html_select($attrib); - $selector->add(array(rcube_label('lowest'), - rcube_label('low'), - rcube_label('normal'), - rcube_label('high'), - rcube_label('highest')), + $selector->add(array($RCMAIL->gettext('lowest'), + $RCMAIL->gettext('low'), + $RCMAIL->gettext('normal'), + $RCMAIL->gettext('high'), + $RCMAIL->gettext('highest')), array('5', '4', '0', '2', '1')); if (isset($_POST['_priority'])) @@ -1594,6 +1594,8 @@ function rcmail_dsn_checkbox($attrib) function rcmail_editor_selector($attrib) { + global $RCMAIL; + // determine whether HTML or plain text should be checked $useHtml = rcmail_compose_editor_mode(); @@ -1607,15 +1609,15 @@ function rcmail_editor_selector($attrib) $select = new html_select($attrib); - $select->add(Q(rcube_label('htmltoggle')), 'html'); - $select->add(Q(rcube_label('plaintoggle')), 'plain'); + $select->add(rcube::Q($RCMAIL->gettext('htmltoggle')), 'html'); + $select->add(rcube::Q($RCMAIL->gettext('plaintoggle')), 'plain'); return $select->show($useHtml ? 'html' : 'plain'); /* foreach ($choices as $value => $text) { $attrib['id'] = '_' . $value; $attrib['value'] = $value; - $selector .= $radio->show($chosenvalue, $attrib) . html::label($attrib['id'], Q(rcube_label($text))); + $selector .= $radio->show($chosenvalue, $attrib) . html::label($attrib['id'], rcube::Q($RCMAIL->gettext($text))); } return $selector; @@ -1625,11 +1627,11 @@ function rcmail_editor_selector($attrib) function rcmail_store_target_selection($attrib) { - global $COMPOSE; + global $COMPOSE, $RCMAIL; $attrib['name'] = '_store_target'; - $select = rcmail_mailbox_select(array_merge($attrib, array( - 'noselection' => '- '.rcube_label('dontsave').' -', + $select = $RCMAIL->folder_selector(array_merge($attrib, array( + 'noselection' => '- ' . $RCMAIL->gettext('dontsave') . ' -', 'folder_filter' => 'mail', 'folder_rights' => 'w', ))); @@ -1701,11 +1703,11 @@ function rcmail_addressbook_list($attrib = array()) 'id' => 'rcmli%s', 'class' => '%s'), html::a(array('href' => '#list', 'rel' => '%s', - 'onclick' => "return ".JS_OBJECT_NAME.".command('list-adresses','%s',this)"), '%s')); + 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('list-adresses','%s',this)"), '%s')); foreach ($RCMAIL->get_address_sources(false, true) as $j => $source) { $id = strval(strlen($source['id']) ? $source['id'] : $j); - $js_id = JQ($id); + $js_id = rcube::JQ($id); // set class name(s) $class_name = 'addressbook'; @@ -1713,7 +1715,7 @@ function rcmail_addressbook_list($attrib = array()) $class_name .= ' ' . $source['class_name']; $out .= sprintf($line_templ, - html_identifier($id,true), + rcube_utils::html_identifier($id,true), $class_name, $source['id'], $js_id, (!empty($source['name']) ? $source['name'] : $id)); @@ -1727,7 +1729,7 @@ function rcmail_addressbook_list($attrib = array()) // return the contacts list as HTML table function rcmail_contacts_list($attrib = array()) { - global $OUTPUT; + global $RCMAIL, $OUTPUT; $attrib += array('id' => 'rcmAddressList'); @@ -1737,7 +1739,7 @@ function rcmail_contacts_list($attrib = array()) $OUTPUT->set_env('current_page', 0); $OUTPUT->include_script('list.js'); - return rcube_table_output($attrib, array(), array('name'), 'ID'); + return $RCMAIL->table_output($attrib, array(), array('name'), 'ID'); } @@ -1773,7 +1775,7 @@ function rcmail_compose_responses_list($attrib) 'class' => rtrim('insertresponse ' . $attrib['itemclass']), 'unselectable' => 'on', 'rel' => $key, - ), Q($response['name'])); + ), rcube::Q($response['name'])); $jsenv[$key] = $response; $list->add(array(), $item); diff --git a/program/steps/mail/copy.inc b/program/steps/mail/copy.inc index 876657485..4cebae6c6 100644 --- a/program/steps/mail/copy.inc +++ b/program/steps/mail/copy.inc @@ -25,15 +25,15 @@ if (!$OUTPUT->ajax_call) // move messages if (!empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) { - $uids = get_input_value('_uid', RCUBE_INPUT_POST); - $target = get_input_value('_target_mbox', RCUBE_INPUT_POST, true); - $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); + $uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST); + $target = rcube_utils::get_input_value('_target_mbox', rcube_utils::INPUT_POST, true); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); $copied = $RCMAIL->storage->copy_message($uids, $target, $mbox); if (!$copied) { // send error message - rcmail_display_server_error('errorcopying'); + $RCMAIL->display_server_error('errorcopying'); $OUTPUT->send(); exit; } @@ -43,7 +43,7 @@ if (!empty($_POST['_uid']) && strlen($_POST['_target_mbox'])) { rcmail_send_unread_count($target, true); - $OUTPUT->command('set_quota', rcmail_quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content()); } // unknown action or missing query param else { diff --git a/program/steps/mail/folders.inc b/program/steps/mail/folders.inc index 574d6e975..d7cfd93f3 100644 --- a/program/steps/mail/folders.inc +++ b/program/steps/mail/folders.inc @@ -23,7 +23,7 @@ if (!$OUTPUT->ajax_call) return; -$mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); +$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); // send EXPUNGE command if ($RCMAIL->action == 'expunge') { @@ -35,14 +35,14 @@ if ($RCMAIL->action == 'expunge') { $OUTPUT->show_message('folderexpunged', 'confirmation'); if (!empty($_REQUEST['_reload'])) { - $OUTPUT->command('set_quota', rcmail_quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content()); $OUTPUT->command('message_list.clear'); $RCMAIL->action = 'list'; return; } } else { - rcmail_display_server_error(); + $RCMAIL->display_server_error(); } } @@ -69,12 +69,12 @@ else if ($RCMAIL->action == 'purge') $OUTPUT->command('message_list.clear'); $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text(), $mbox); $OUTPUT->command('set_unread_count', $mbox, 0); - $OUTPUT->command('set_quota', rcmail_quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content()); rcmail_set_unseen_count($mbox, 0); } } else { - rcmail_display_server_error(); + $RCMAIL->display_server_error(); } } } diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index aefe1744c..00d66a0d0 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -32,7 +32,7 @@ $SEARCH_MODS_DEFAULT = array( $RCMAIL->storage_init(); // set imap properties and session vars -if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true)))) +if (strlen(trim($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)))) $RCMAIL->storage->set_folder(($_SESSION['mbox'] = $mbox)); else if ($RCMAIL->storage) $_SESSION['mbox'] = $RCMAIL->storage->get_folder(); @@ -78,7 +78,7 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') { $search_request = md5($mbox_name.$_SESSION['search_filter']); - $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, rcmail_sort_column()); + $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET, rcmail_sort_column()); $_SESSION['search'] = $RCMAIL->storage->get_search_set(); $_SESSION['search_request'] = $search_request; $OUTPUT->set_env('search_request', $search_request); @@ -131,10 +131,10 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { // register UI objects $OUTPUT->add_handlers(array( - 'mailboxlist' => 'rcmail_mailbox_list', + 'mailboxlist' => array($RCMAIL, 'folder_list'), 'messages' => 'rcmail_message_list', 'messagecountdisplay' => 'rcmail_messagecount_display', - 'quotadisplay' => 'rcmail_quota_display', + 'quotadisplay' => array($RCMAIL, 'quota_display'), 'mailboxname' => 'rcmail_mailbox_name_display', 'messageheaders' => 'rcmail_message_headers', 'messagefullheaders' => 'rcmail_message_full_headers', @@ -249,7 +249,7 @@ function rcmail_message_list($attrib) $OUTPUT->set_env('col_movable', !in_array('list_cols', (array)$CONFIG['dont_override'])); } else { - $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($attrib['columns'])); + $a_show_cols = preg_split('/[\s,;]+/', str_replace(array("'", '"'), '', $attrib['columns'])); $attrib['columns'] = $a_show_cols; } @@ -298,7 +298,7 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null } else { if (!is_array($a_show_cols)) - $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($a_show_cols)); + $a_show_cols = preg_split('/[\s,;]+/', str_replace(array("'", '"'), '', $a_show_cols)); $head_replace = true; } @@ -357,15 +357,15 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null $cont = rcmail_address_string($header->$col_name, 3, false, null, $header->charset); else if ($col == 'subject') { $cont = trim(rcube_mime::decode_header($header->$col, $header->charset)); - if (!$cont) $cont = rcube_label('nosubject'); - $cont = Q($cont); + if (!$cont) $cont = $RCMAIL->gettext('nosubject'); + $cont = rcube::Q($cont); } else if ($col == 'size') $cont = show_bytes($header->$col); else if ($col == 'date') - $cont = format_date($header->date); + $cont = $RCMAIL->format_date($header->date); else - $cont = Q($header->$col); + $cont = rcube::Q($header->$col); $a_msg_cols[$col] = $cont; } @@ -386,7 +386,7 @@ function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null if ($header->priority) $a_msg_flags['prio'] = (int) $header->priority; - $a_msg_flags['ctype'] = Q($header->ctype); + $a_msg_flags['ctype'] = rcube::Q($header->ctype); $a_msg_flags['mbox'] = $mbox; // merge with plugin result (Deprecated, use $header->flags) @@ -435,14 +435,14 @@ function rcmail_message_list_head($attrib, $a_show_cols) $a_sort_cols = array('subject', 'date', 'from', 'to', 'fromto', 'size', 'cc'); if (!empty($attrib['optionsmenuicon'])) { - $onclick = 'return ' . JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu')"; + $onclick = 'return ' . rcmail_output::JS_OBJECT_NAME . ".command('menu-open', 'messagelistmenu')"; if ($attrib['optionsmenuicon'] === true || $attrib['optionsmenuicon'] == 'true') $list_menu = html::div(array('onclick' => $onclick, 'class' => 'listmenu', - 'id' => 'listmenulink', 'title' => rcube_label('listoptions'))); + 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions'))); else $list_menu = html::a(array('href' => '#', 'onclick' => $onclick), html::img(array('src' => $skin_path . $attrib['optionsmenuicon'], - 'id' => 'listmenulink', 'title' => rcube_label('listoptions'))) + 'id' => 'listmenulink', 'title' => $RCMAIL->gettext('listoptions'))) ); } else @@ -470,15 +470,15 @@ function rcmail_message_list_head($attrib, $a_show_cols) $col_name = $list_menu; break; case 'fromto': - $col_name = Q(rcube_label($smart_col)); + $col_name = rcube::Q($RCMAIL->gettext($smart_col)); break; default: - $col_name = Q(rcube_label($col)); + $col_name = rcube::Q($RCMAIL->gettext($col)); } // make sort links if (in_array($col, $a_sort_cols)) - $col_name = html::a(array('href'=>"./#sort", 'onclick' => 'return '.JS_OBJECT_NAME.".command('sort','".$col."',this)", 'title' => rcube_label('sortby')), $col_name); + $col_name = html::a(array('href'=>"./#sort", 'onclick' => 'return '.rcmail_output::JS_OBJECT_NAME.".command('sort','".$col."',this)", 'title' => $RCMAIL->gettext('sortby')), $col_name); else if ($col_name[0] != '<') $col_name = '' . $col_name . ''; @@ -522,7 +522,7 @@ function rcmail_messagecount_display($attrib) $RCMAIL->output->add_gui_object('countdisplay', $attrib['id']); - $content = $RCMAIL->action != 'show' ? rcmail_get_messagecount_text() : rcube_label('loading'); + $content = $RCMAIL->action != 'show' ? rcmail_get_messagecount_text() : $RCMAIL->gettext('loading'); return html::span($attrib, $content); } @@ -545,14 +545,14 @@ function rcmail_get_messagecount_text($count=NULL, $page=NULL) $max = $RCMAIL->storage->count(NULL, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL'); if ($max==0) - $out = rcube_label('mailboxempty'); + $out = $RCMAIL->gettext('mailboxempty'); else - $out = rcube_label(array('name' => $RCMAIL->storage->get_threading() ? 'threadsfromto' : 'messagesfromto', + $out = $RCMAIL->gettext(array('name' => $RCMAIL->storage->get_threading() ? 'threadsfromto' : 'messagesfromto', 'vars' => array('from' => $start_msg, 'to' => min($max, $start_msg + $page_size - 1), 'count' => $max))); - return Q($out); + return rcube::Q($out); } @@ -572,7 +572,7 @@ function rcmail_mailbox_name_display($attrib) function rcmail_get_mailbox_name_text() { global $RCMAIL; - return rcmail_localize_foldername($RCMAIL->storage->get_folder()); + return $RCMAIL->localize_foldername($RCMAIL->storage->get_folder()); } @@ -671,7 +671,7 @@ function rcmail_wash_html($html, $p, $cid_replaces) // charset was converted to UTF-8 in rcube_storage::get_message_part(), // change/add charset specification in HTML accordingly, // washtml cannot work without that - $meta = ''; + $meta = ''; // remove old meta tag and add the new one, making sure // that it is placed in the head (#1488093) @@ -686,7 +686,7 @@ function rcmail_wash_html($html, $p, $cid_replaces) 'show_washed' => false, 'allow_remote' => $p['safe'], 'blocked_src' => "./program/resources/blocked.gif", - 'charset' => RCMAIL_CHARSET, + 'charset' => RCUBE_CHARSET, 'cid_map' => $cid_replaces, 'html_elements' => array('body'), ); @@ -716,7 +716,7 @@ function rcmail_wash_html($html, $p, $cid_replaces) $washer->add_callback('style', 'rcmail_washtml_callback'); // Remove non-UTF8 characters (#1487813) - $html = rc_utf8_clean($html); + $html = rcube_charset::clean($html); $html = $washer->wash($html); $REMOTE_OBJECTS = $washer->extlinks; @@ -840,7 +840,7 @@ function rcmail_plain_body($body) $body = join("\n", $body); - // quote plain text (don't use Q() here, to display entities "as is") + // quote plain text (don't use rcube::Q() here, to display entities "as is") $table = get_html_translation_table(HTML_SPECIALCHARS); unset($table['?']); $body = strtr($body, $table); @@ -877,7 +877,7 @@ function rcmail_washtml_callback($tagname, $attrib, $content, $washtml) case 'style': // decode all escaped entities and reduce to ascii strings - $stripped = preg_replace('/[^a-zA-Z\(:;]/', '', rcmail_xss_entity_decode($content)); + $stripped = preg_replace('/[^a-zA-Z\(:;]/', '', rcube_utils::xss_entity_decode($content)); // now check for evil strings like expression, behavior or url() if (!preg_match('/expression|behavior|javascript:|import[^a]/i', $stripped)) { @@ -945,13 +945,13 @@ function rcmail_message_headers($attrib, $headers=null) if (in_array($hkey, $exclude_headers)) continue; - $header_title = rcube_label(preg_replace('/(^mail-|-)/', '', $hkey)); + $header_title = $RCMAIL->gettext(preg_replace('/(^mail-|-)/', '', $hkey)); if ($hkey == 'date') { if ($PRINT_MODE) - $header_value = format_date($value, $RCMAIL->config->get('date_long', 'x')); + $header_value = $RCMAIL->format_date($value, $RCMAIL->config->get('date_long', 'x')); else - $header_value = format_date($value); + $header_value = $RCMAIL->format_date($value); } else if ($hkey == 'priority') { if ($value) { @@ -995,7 +995,7 @@ function rcmail_message_headers($attrib, $headers=null) $ishtml = true; } else if ($hkey == 'subject' && empty($value)) - $header_value = rcube_label('nosubject'); + $header_value = $RCMAIL->gettext('nosubject'); else $header_value = trim(rcube_mime::decode_header($value, $headers['charset'])); @@ -1012,14 +1012,14 @@ function rcmail_message_headers($attrib, $headers=null) // single header value is requested if (!empty($attrib['valueof'])) - return Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show')); + return rcube::Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show')); // compose html table $table = new html_table(array('cols' => 2)); foreach ($plugin['output'] as $hkey => $row) { - $table->add(array('class' => 'header-title'), Q($row['title'])); - $table->add(array('class' => 'header '.$hkey), $row['html'] ? $row['value'] : Q($row['value'], ($hkey == 'subject' ? 'strict' : 'show'))); + $table->add(array('class' => 'header-title'), rcube::Q($row['title'])); + $table->add(array('class' => 'header '.$hkey), $row['html'] ? $row['value'] : rcube::Q($row['value'], ($hkey == 'subject' ? 'strict' : 'show'))); } return $table->show($attrib); @@ -1030,6 +1030,8 @@ function rcmail_message_headers($attrib, $headers=null) */ function rcmail_localized_priority($value) { + global $RCMAIL; + $labels_map = array( '1' => 'highest', '2' => 'high', @@ -1039,7 +1041,7 @@ function rcmail_localized_priority($value) ); if ($value && $labels_map[$value]) - return rcube_label($labels_map[$value]); + return $RCMAIL->gettext($labels_map[$value]); return ''; } @@ -1049,10 +1051,10 @@ function rcmail_localized_priority($value) */ function rcmail_message_full_headers($attrib, $headers=NULL) { - global $OUTPUT; + global $OUTPUT, $RCMAIL; $html = html::div(array('id' => "all-headers", 'class' => "all", 'style' => 'display:none'), html::div(array('id' => 'headers-source'), '')); - $html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('show-headers','',this)", 'title' => rcube_label('togglefullheaders')), ''); + $html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".rcmail_output::JS_OBJECT_NAME.".command('show-headers','',this)", 'title' => $RCMAIL->gettext('togglefullheaders')), ''); $OUTPUT->add_gui_object('all_headers_row', 'all-headers'); $OUTPUT->add_gui_object('all_headers_box', 'headers-source'); @@ -1094,7 +1096,7 @@ function rcmail_message_body($attrib) // unsupported (e.g. encrypted) if ($part->realtype) { if ($part->realtype == 'multipart/encrypted' || $part->realtype == 'application/pkcs7-mime') { - $out .= html::span('part-notice', rcube_label('encryptedmessage')); + $out .= html::span('part-notice', $RCMAIL->gettext('encryptedmessage')); } continue; } @@ -1103,10 +1105,10 @@ function rcmail_message_body($attrib) } // Check if we have enough memory to handle the message in it // #1487424: we need up to 10x more memory than the body - else if (!rcmail_mem_check($part->size * 10)) { - $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' + else if (!rcube_utils::mem_check($part->size * 10)) { + $out .= html::span('part-notice', $RCMAIL->gettext('messagetoobig'). ' ' . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id - .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download'))); + .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download'))); continue; } @@ -1158,17 +1160,17 @@ function rcmail_message_body($attrib) else { // Check if we have enough memory to handle the message in it // #1487424: we need up to 10x more memory than the body - if (!rcmail_mem_check(strlen($MESSAGE->body) * 10)) { - $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' + if (!rcube_utils::mem_check(strlen($MESSAGE->body) * 10)) { + $out .= html::span('part-notice', $RCMAIL->gettext('messagetoobig'). ' ' . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part=0' - .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download'))); + .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download'))); } else { $plugin = $RCMAIL->plugins->exec_hook('message_body_prefix', array( 'part' => $MESSAGE, 'prefix' => '')); $out .= html::div('message-part', $plugin['prefix'] . html::tag('pre', array(), - rcmail_plain_body(Q($MESSAGE->body, 'strict', false)))); + rcmail_plain_body(rcube::Q($MESSAGE->body, 'strict', false)))); } } @@ -1191,7 +1193,7 @@ function rcmail_message_body($attrib) 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false), 'onclick' => sprintf( 'return %s.command(\'load-attachment\',\'%s\',this)', - JS_OBJECT_NAME, + rcmail_output::JS_OBJECT_NAME, $attach_prop->mime_id) ); $out .= html::p('image-attachment', @@ -1204,18 +1206,18 @@ function rcmail_message_body($attrib) 'style' => sprintf('max-width:%dpx; max-height:%dpx', $thumbnail_size, $thumbnail_size), )) ) . - html::span('image-filename', Q($attach_prop->filename)) . - html::span('image-filesize', Q($RCMAIL->message_part_size($attach_prop))) . + html::span('image-filename', rcube::Q($attach_prop->filename)) . + html::span('image-filesize', rcube::Q($RCMAIL->message_part_size($attach_prop))) . html::span('attachment-links', - (in_array($mimetype, $client_mimetypes) ? html::a($show_link, rcube_label('showattachment')) . ' ' : '') . - html::a($show_link['href'] . '&_download=1', rcube_label('download')) + (in_array($mimetype, $client_mimetypes) ? html::a($show_link, $RCMAIL->gettext('showattachment')) . ' ' : '') . + html::a($show_link['href'] . '&_download=1', $RCMAIL->gettext('download')) ) . html::br(array('style' => 'clear:both')) ); } else { $out .= html::tag('fieldset', 'image-attachment', - html::tag('legend', 'image-filename', Q($attach_prop->filename)) . + html::tag('legend', 'image-filename', rcube::Q($attach_prop->filename)) . html::p(array('align' => "center"), html::img(array( 'src' => $MESSAGE->get_part_url($attach_prop->mime_id, 'image'), @@ -1295,7 +1297,7 @@ function rcmail_html4inline($body, $container_id, $body_id='', &$attributes=null // replace all css definitions with #container [def] $styles = substr($body, $pos, $len); - $styles = rcmail_mod_css_styles($styles, $cont_id, $allow_remote); + $styles = rcube_utils::mod_css_styles($styles, $cont_id, $allow_remote); $body = substr_replace($body, $styles, $pos, $len); $last_style_pos = $pos2 + strlen($styles) - $len; @@ -1385,7 +1387,7 @@ function rcmail_alter_html_link($matches) global $RCMAIL; $tag = strtolower($matches[1]); - $attrib = parse_attrib_string($matches[2]); + $attrib = html::parse_attrib_string($matches[2]); $end = '>'; // Remove non-printable characters in URL (#1487805) @@ -1421,8 +1423,8 @@ function rcmail_alter_html_link($matches) $attrib['href'] = 'mailto:' . implode(',', $addresses); $attrib['onclick'] = sprintf( "return %s.command('compose','%s',this)", - JS_OBJECT_NAME, - JQ(implode(',', $mailto) . ($url ? "?$url" : ''))); + rcmail_output::JS_OBJECT_NAME, + rcube::JQ(implode(',', $mailto) . ($url ? "?$url" : ''))); } else { $attrib['href'] = '#NOP'; @@ -1477,7 +1479,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $name = $part['name']; $mailto = $part['mailto']; $string = $part['string']; - $valid = check_email($mailto, false); + $valid = rcube_utils::check_email($mailto, false); // phishing email prevention (#1488981), e.g. "valid@email.addr" if (!$show_email && $valid && $name && $name != $mailto && strpos($name, '@')) { @@ -1486,27 +1488,27 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, // IDNA ASCII to Unicode if ($name == $mailto) - $name = rcube_idn_to_utf8($name); + $name = rcube_utils::idn_to_utf8($name); if ($string == $mailto) - $string = rcube_idn_to_utf8($string); - $mailto = rcube_idn_to_utf8($mailto); + $string = rcube_utils::idn_to_utf8($string); + $mailto = rcube_utils::idn_to_utf8($mailto); if ($PRINT_MODE) { - $address = sprintf('%s <%s>', Q($name), Q($mailto)); + $address = sprintf('%s <%s>', rcube::Q($name), rcube::Q($mailto)); } else if ($valid) { if ($linked) { $attrs = array( 'href' => 'mailto:' . $mailto, - 'onclick' => sprintf("return %s.command('compose','%s',this)", JS_OBJECT_NAME, JQ(format_email_recipient($mailto, $name))), + 'onclick' => sprintf("return %s.command('compose','%s',this)", rcmail_output::JS_OBJECT_NAME, rcube::JQ(format_email_recipient($mailto, $name))), 'class' => "rcmContactAddress", ); if ($show_email && $name && $mailto) { - $content = Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto); + $content = rcube::Q($name ? sprintf('%s <%s>', $name, $mailto) : $mailto); } else { - $content = Q($name ? $name : $mailto); + $content = rcube::Q($name ? $name : $mailto); $attrs['title'] = $mailto; } @@ -1514,14 +1516,14 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, } else { $address = html::span(array('title' => $mailto, 'class' => "rcmContactAddress"), - Q($name ? $name : $mailto)); + rcube::Q($name ? $name : $mailto)); } if ($addicon && $_SESSION['writeable_abook']) { $address .= html::a(array( 'href' => "#add", - 'onclick' => sprintf("return %s.command('add-contact','%s',this)", JS_OBJECT_NAME, JQ($string)), - 'title' => rcube_label('addtoaddressbook'), + 'onclick' => sprintf("return %s.command('add-contact','%s',this)", rcmail_output::JS_OBJECT_NAME, rcube::JQ($string)), + 'title' => $RCMAIL->gettext('addtoaddressbook'), 'class' => 'rcmaddcontact', ), html::img(array( @@ -1533,9 +1535,9 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, else { $address = ''; if ($name) - $address .= Q($name); + $address .= rcube::Q($name); if ($mailto) - $address = trim($address . ' ' . Q($name ? sprintf('<%s>', $mailto) : $mailto)); + $address = trim($address . ' ' . rcube::Q($name ? sprintf('<%s>', $mailto) : $mailto)); } $address = html::span('adr', $address); @@ -1561,7 +1563,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, 'href' => '#more', 'class' => 'morelink', 'onclick' => '$(this).hide().next().show()', - ), Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))) . + ), rcube::Q($RCMAIL->gettext(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))) . html::span(array('style' => 'display:none'), join(', ', $allvalues)); } else { @@ -1569,11 +1571,11 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, 'href' => '#more', 'class' => 'morelink', 'onclick' => sprintf("return %s.show_popup_dialog('%s','%s')", - JS_OBJECT_NAME, - JQ(join(', ', $allvalues)), - JQ($title)) + rcmail_output::JS_OBJECT_NAME, + rcube::JQ(join(', ', $allvalues)), + rcube::JQ($title)) ), - Q(rcube_label(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))); + rcube::Q($RCMAIL->gettext(array('name' => 'andnmore', 'vars' => array('nr' => $moreadrs))))); } } @@ -1604,7 +1606,7 @@ function rcmail_wrap_and_quote($text, $length = 72) $line = '>' . rtrim($line); else if (mb_strlen($line) > $max) { $newline = ''; - foreach (explode("\n", rc_wordwrap($line, $length - 2)) as $l) { + foreach (explode("\n", rcube_mime::wordwrap($line, $length - 2)) as $l) { if (strlen($l)) $newline .= '> ' . $l . "\n"; else @@ -1690,17 +1692,17 @@ function rcmail_send_mdn($message, &$smtp_error) $compose->setParam('text_encoding', 'quoted-printable'); $compose->setParam('html_encoding', 'quoted-printable'); $compose->setParam('head_encoding', 'quoted-printable'); - $compose->setParam('head_charset', RCMAIL_CHARSET); - $compose->setParam('html_charset', RCMAIL_CHARSET); - $compose->setParam('text_charset', RCMAIL_CHARSET); + $compose->setParam('head_charset', RCUBE_CHARSET); + $compose->setParam('html_charset', RCUBE_CHARSET); + $compose->setParam('text_charset', RCUBE_CHARSET); // compose headers array $headers = array( - 'Date' => rcmail_user_date(), + 'Date' => $RCMAIL->user_date(), 'From' => $sender, 'To' => $message->headers->mdn_to, - 'Subject' => rcube_label('receiptread') . ': ' . $message->subject, - 'Message-ID' => rcmail_gen_message_id(), + 'Subject' => $RCMAIL->gettext('receiptread') . ': ' . $message->subject, + 'Message-ID' => $RCMAIL->gen_message_id(), 'X-Sender' => $identity['email'], 'References' => trim($message->headers->references . ' ' . $message->headers->messageID), ); @@ -1718,21 +1720,21 @@ function rcmail_send_mdn($message, &$smtp_error) $report .= "Reporting-UA: $agent\r\n"; } - $body = rcube_label("yourmessage") . "\r\n\r\n" . - "\t" . rcube_label("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" . - "\t" . rcube_label("subject") . ': ' . $message->subject . "\r\n" . - "\t" . rcube_label("sent") . ': ' . format_date($message->headers->date, $RCMAIL->config->get('date_long')) . "\r\n" . - "\r\n" . rcube_label("receiptnote"); + $body = $RCMAIL->gettext("yourmessage") . "\r\n\r\n" . + "\t" . $RCMAIL->gettext("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" . + "\t" . $RCMAIL->gettext("subject") . ': ' . $message->subject . "\r\n" . + "\t" . $RCMAIL->gettext("sent") . ': ' . $RCMAIL->format_date($message->headers->date, $RCMAIL->config->get('date_long')) . "\r\n" . + "\r\n" . $RCMAIL->gettext("receiptnote"); $compose->headers($headers); $compose->setContentType('multipart/report', array('report-type'=> 'disposition-notification')); - $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n")); + $compose->setTXTBody(rcube_mime::wordwrap($body, 75, "\r\n")); $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); if ($RCMAIL->config->get('mdn_use_from')) $options['mdn_use_from'] = true; - $sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options); + $sent = $RCMAIL->deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options); if ($sent) { $RCMAIL->storage->set_flag($message->uid, 'MDNSENT'); @@ -1868,16 +1870,18 @@ function rcmail_fix_mimetype($name) // return attachment filename, handle empty filename case function rcmail_attachment_name($attachment, $display = false) { + global $RCMAIL; + $filename = $attachment->filename; if ($filename === null || $filename === '') { if ($attachment->mimetype == 'text/html') { - $filename = rcube_label('htmlmessage'); + $filename = $RCMAIL->gettext('htmlmessage'); } else { $ext = (array) rcube_mime::get_mime_extensions($attachment->mimetype); $ext = array_shift($ext); - $filename = rcube_label('messagepart') . ' ' . $attachment->mime_id; + $filename = $RCMAIL->gettext('messagepart') . ' ' . $attachment->mime_id; if ($ext) { $filename .= '.' . $ext; } @@ -1889,7 +1893,7 @@ function rcmail_attachment_name($attachment, $display = false) // Display smart names for some known mimetypes if ($display) { if (preg_match('/application\/(pgp|pkcs7)-signature/i', $attachment->mimetype)) { - $filename = rcube_label('digitalsig'); + $filename = $RCMAIL->gettext('digitalsig'); } } @@ -1898,12 +1902,12 @@ function rcmail_attachment_name($attachment, $display = false) function rcmail_search_filter($attrib) { - global $OUTPUT, $CONFIG; + global $RCMAIL, $OUTPUT, $CONFIG; if (!strlen($attrib['id'])) $attrib['id'] = 'rcmlistfilter'; - $attrib['onchange'] = JS_OBJECT_NAME.'.filter_mailbox(this.value)'; + $attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.'.filter_mailbox(this.value)'; // Content-Type values of messages with attachments // the same as in app.js:add_message_row() @@ -1916,20 +1920,20 @@ function rcmail_search_filter($attrib) } $select_filter = new html_select($attrib); - $select_filter->add(rcube_label('all'), 'ALL'); - $select_filter->add(rcube_label('unread'), 'UNSEEN'); - $select_filter->add(rcube_label('flagged'), 'FLAGGED'); - $select_filter->add(rcube_label('unanswered'), 'UNANSWERED'); + $select_filter->add($RCMAIL->gettext('all'), 'ALL'); + $select_filter->add($RCMAIL->gettext('unread'), 'UNSEEN'); + $select_filter->add($RCMAIL->gettext('flagged'), 'FLAGGED'); + $select_filter->add($RCMAIL->gettext('unanswered'), 'UNANSWERED'); if (!$CONFIG['skip_deleted']) { - $select_filter->add(rcube_label('deleted'), 'DELETED'); - $select_filter->add(rcube_label('undeleted'), 'UNDELETED'); + $select_filter->add($RCMAIL->gettext('deleted'), 'DELETED'); + $select_filter->add($RCMAIL->gettext('undeleted'), 'UNDELETED'); } - $select_filter->add(rcube_label('withattachment'), $attachment); - $select_filter->add(rcube_label('priority').': '.rcube_label('highest'), 'HEADER X-PRIORITY 1'); - $select_filter->add(rcube_label('priority').': '.rcube_label('high'), 'HEADER X-PRIORITY 2'); - $select_filter->add(rcube_label('priority').': '.rcube_label('normal'), 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5'); - $select_filter->add(rcube_label('priority').': '.rcube_label('low'), 'HEADER X-PRIORITY 4'); - $select_filter->add(rcube_label('priority').': '.rcube_label('lowest'), 'HEADER X-PRIORITY 5'); + $select_filter->add($RCMAIL->gettext('withattachment'), $attachment); + $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('highest'), 'HEADER X-PRIORITY 1'); + $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('high'), 'HEADER X-PRIORITY 2'); + $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('normal'), 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5'); + $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('low'), 'HEADER X-PRIORITY 4'); + $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('lowest'), 'HEADER X-PRIORITY 5'); $out = $select_filter->show($_SESSION['search_filter']); @@ -1956,13 +1960,13 @@ function rcmail_message_error($uid=null) function rcmail_message_import_form($attrib = array()) { - global $OUTPUT; + global $OUTPUT, $RCMAIL; // set defaults $attrib += array('id' => 'rcmImportform', 'buttons' => 'yes'); // Get filesize, enable upload progress bar - $max_filesize = rcube_upload_init(); + $max_filesize = $RCMAIL->upload_init(); $button = new html_inputfield(array('type' => 'button')); $fileinput = new html_inputfield(array( @@ -1976,10 +1980,10 @@ function rcmail_message_import_form($attrib = array()) $OUTPUT->form_tag(array('id' => $attrib['id'].'Frm', 'method' => 'post', 'enctype' => 'multipart/form-data'), html::tag('input', array('type' => 'hidden', 'name' => '_unlock', 'value' => '')) . html::div(null, $fileinput->show()) . - html::div('hint', rcube_label(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . - (get_boolean($attrib['buttons']) ? html::div('buttons', - $button->show(rcube_label('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' . - $button->show(rcube_label('upload'), array('class' => 'button mainaction', 'onclick' => JS_OBJECT_NAME . ".command('import-messages', this.form)")) + html::div('hint', $RCMAIL->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) . + (rcube_utils::get_boolean($attrib['buttons']) ? html::div('buttons', + $button->show($RCMAIL->gettext('close'), array('class' => 'button', 'onclick' => "$('#$attrib[id]').hide()")) . ' ' . + $button->show($RCMAIL->gettext('upload'), array('class' => 'button mainaction', 'onclick' => rcmail_output::JS_OBJECT_NAME . ".command('import-messages', this.form)")) ) : '') ) ); diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index be1366dcf..d588343de 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -23,12 +23,12 @@ // show loading page if (!empty($_GET['_preload'])) { $url = preg_replace('/([&?]+)_preload=/', '\\1_mimewarning=1&_embed=', $_SERVER['REQUEST_URI']); - $message = rcube_label('loadingdata'); + $message = $RCMAIL->gettext('loadingdata'); - header('Content-Type: text/html; charset=' . RCMAIL_CHARSET); + header('Content-Type: text/html; charset=' . RCUBE_CHARSET); print "\n\n" - . '' . "\n" - . '' . "\n" + . '' . "\n" + . '' . "\n" . "\n\n$message\n\n"; exit; } @@ -38,7 +38,7 @@ ob_end_clean(); // similar code as in program/steps/mail/show.inc if (!empty($_GET['_uid'])) { - $uid = get_input_value('_uid', RCUBE_INPUT_GET); + $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET); $RCMAIL->config->set('prefer_html', true); $MESSAGE = new rcube_message($uid); } @@ -46,7 +46,7 @@ if (!empty($_GET['_uid'])) { // check connection status check_storage_status(); -$part_id = get_input_value('_part', RCUBE_INPUT_GPC); +$part_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GPC); // show part page if (!empty($_GET['_frame'])) { @@ -72,7 +72,7 @@ if (!empty($_GET['_frame'])) { // render thumbnail of an image attachment else if ($_GET['_thumb']) { - $pid = get_input_value('_part', RCUBE_INPUT_GET); + $pid = rcube_utils::get_input_value('_part', rcube_utils::INPUT_GET); if ($part = $MESSAGE->mime_parts[$pid]) { $thumbnail_size = $RCMAIL->config->get('image_thumbnail_size', 240); $temp_dir = $RCMAIL->config->get('temp_dir'); @@ -187,7 +187,7 @@ else if (strlen($part_id)) { $OUTPUT = new rcmail_html_page(); $OUTPUT->write(html::tag('html', null, html::tag('body', 'embed', html::div(array('class' => 'rcmail-inline-message rcmail-inline-warning'), - rcube_label(array( + $RCMAIL->gettext(array( 'name' => 'attachmentvalidationerror', 'vars' => array( 'expected' => $mimetype . ($file_extension ? " (.$file_extension)" : ''), @@ -197,7 +197,7 @@ else if (strlen($part_id)) { html::p(array('class' => 'rcmail-inline-buttons'), html::tag('button', array('onclick' => "location.href='" . $RCMAIL->url(array_merge($_GET, array('_nocheck' => 1))) . "'"), - rcube_label('showanyway'))) + $RCMAIL->gettext('showanyway'))) ) ))); } @@ -221,7 +221,7 @@ else if (strlen($part_id)) { list($ctype_primary, $ctype_secondary) = explode('/', $mimetype); if (!$plugin['download'] && $ctype_primary == 'text') { - header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCMAIL_CHARSET)); + header("Content-Type: text/$ctype_secondary; charset=" . ($part->charset ? $part->charset : RCUBE_CHARSET)); } else { header("Content-Type: $mimetype"); @@ -232,10 +232,10 @@ else if (strlen($part_id)) { if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($plugin['download'])) { // Check if we have enough memory to handle the message in it // #1487424: we need up to 10x more memory than the body - if (!rcmail_mem_check($part->size * 10)) { - $out = '' . rcube_label('messagetoobig'). ' ' + if (!rcube_utils::mem_check($part->size * 10)) { + $out = '' . $RCMAIL->gettext('messagetoobig'). ' ' . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id - .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), rcube_label('download')) . ''; + .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')) . '