diff options
Diffstat (limited to 'program/steps/settings')
-rw-r--r-- | program/steps/settings/about.inc | 24 | ||||
-rw-r--r-- | program/steps/settings/delete_identity.inc | 10 | ||||
-rw-r--r-- | program/steps/settings/edit_folder.inc | 86 | ||||
-rw-r--r-- | program/steps/settings/edit_identity.inc | 30 | ||||
-rw-r--r-- | program/steps/settings/edit_prefs.inc | 4 | ||||
-rw-r--r-- | program/steps/settings/edit_response.inc | 14 | ||||
-rw-r--r-- | program/steps/settings/folders.inc | 63 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 278 | ||||
-rw-r--r-- | program/steps/settings/identities.inc | 2 | ||||
-rw-r--r-- | program/steps/settings/responses.inc | 16 | ||||
-rw-r--r-- | program/steps/settings/save_folder.inc | 28 | ||||
-rw-r--r-- | program/steps/settings/save_identity.inc | 38 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 35 |
13 files changed, 313 insertions, 315 deletions
diff --git a/program/steps/settings/about.inc b/program/steps/settings/about.inc index 0fdefddda..eae4da842 100644 --- a/program/steps/settings/about.inc +++ b/program/steps/settings/about.inc @@ -28,7 +28,7 @@ function rcmail_supportlink($attrib) if ($url = $RCMAIL->config->get('support_url')) { $label = $attrib['label'] ? $attrib['label'] : 'support'; $attrib['href'] = $url; - return html::a($attrib, rcube_label($label)); + return html::a($attrib, $RCMAIL->gettext($label)); } } @@ -66,10 +66,10 @@ function rcmail_plugins_list($attrib) $table = new html_table($attrib); // add table header - $table->add_header('name', rcube_label('plugin')); - $table->add_header('version', rcube_label('version')); - $table->add_header('license', rcube_label('license')); - $table->add_header('source', rcube_label('source')); + $table->add_header('name', $RCMAIL->gettext('plugin')); + $table->add_header('version', $RCMAIL->gettext('version')); + $table->add_header('license', $RCMAIL->gettext('license')); + $table->add_header('source', $RCMAIL->gettext('source')); foreach ($plugin_info as $name => $data) { $uri = $data['src_uri'] ? $data['src_uri'] : $data['uri']; @@ -78,19 +78,19 @@ function rcmail_plugins_list($attrib) } $table->add_row(); - $table->add('name', Q($data['name'] ? $data['name'] : $name)); - $table->add('version', Q($data['version'])); - $table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> Q($data['license_uri'])), - Q($data['license'])) : $data['license']); - $table->add('source', $uri ? html::a(array('target' => '_blank', href=> Q($uri)), - Q(rcube_label('download'))) : ''); + $table->add('name', rcube::Q($data['name'] ? $data['name'] : $name)); + $table->add('version', rcube::Q($data['version'])); + $table->add('license', $data['license_uri'] ? html::a(array('target' => '_blank', href=> rcube::Q($data['license_uri'])), + rcube::Q($data['license'])) : $data['license']); + $table->add('source', $uri ? html::a(array('target' => '_blank', href=> rcube::Q($uri)), + rcube::Q($RCMAIL->gettext('download'))) : ''); } return $table->show(); } -$OUTPUT->set_pagetitle(rcube_label('about')); +$OUTPUT->set_pagetitle($RCMAIL->gettext('about')); $OUTPUT->add_handler('supportlink', 'rcmail_supportlink'); $OUTPUT->add_handler('pluginlist', 'rcmail_plugins_list'); diff --git a/program/steps/settings/delete_identity.inc b/program/steps/settings/delete_identity.inc index d5146db66..85d128c8f 100644 --- a/program/steps/settings/delete_identity.inc +++ b/program/steps/settings/delete_identity.inc @@ -19,19 +19,19 @@ +-----------------------------------------------------------------------+ */ -$iid = get_input_value('_iid', RCUBE_INPUT_GPC); +$iid = rcube_utils::get_input_value('_iid', rcube_utils::INPUT_GPC); // check request token -if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(RCUBE_INPUT_GPC)) { +if (!$OUTPUT->ajax_call && !$RCMAIL->check_request(rcube_utils::INPUT_GPC)) { $OUTPUT->show_message('invalidrequest', 'error'); - rcmail_overwrite_action('identities'); + $RCMAIL->overwrite_action('identities'); return; } if ($iid && preg_match('/^[0-9]+(,[0-9]+)*$/', $iid)) { $plugin = $RCMAIL->plugins->exec_hook('identity_delete', array('id' => $iid)); - + $deleted = !$plugin['abort'] ? $RCMAIL->user->delete_identity($iid) : $plugin['result']; if ($deleted > 0 && $deleted !== false) @@ -48,4 +48,4 @@ if ($OUTPUT->ajax_call) exit; // go to identities page -rcmail_overwrite_action('identities'); +$RCMAIL->overwrite_action('identities'); diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc index 7f2a10ebc..ff28d04c8 100644 --- a/program/steps/settings/edit_folder.inc +++ b/program/steps/settings/edit_folder.inc @@ -19,7 +19,7 @@ +-----------------------------------------------------------------------+ */ -// WARNING: folder names in UI are encoded with RCMAIL_CHARSET +// WARNING: folder names in UI are encoded with RCUBE_CHARSET function rcmail_folder_form($attrib) { @@ -28,12 +28,12 @@ function rcmail_folder_form($attrib) $storage = $RCMAIL->get_storage(); // edited folder name (empty in create-folder mode) - $mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true); - $mbox_imap = rcube_charset_convert($mbox, RCMAIL_CHARSET, 'UTF7-IMAP'); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true); + $mbox_imap = rcube_charset::convert($mbox, RCUBE_CHARSET, 'UTF7-IMAP'); // predefined path for new folder - $parent = get_input_value('_path', RCUBE_INPUT_GPC, true); - $parent_imap = rcube_charset_convert($parent, RCMAIL_CHARSET, 'UTF7-IMAP'); + $parent = rcube_utils::get_input_value('_path', rcube_utils::INPUT_GPC, true); + $parent_imap = rcube_charset::convert($parent, RCUBE_CHARSET, 'UTF7-IMAP'); $threading_supported = $storage->get_capability('THREAD'); $delimiter = $storage->get_hierarchy_delimiter(); @@ -46,7 +46,7 @@ function rcmail_folder_form($attrib) $path = explode($delimiter, $mbox_imap); $folder = array_pop($path); $path = implode($delimiter, $path); - $folder = rcube_charset_convert($folder, 'UTF7-IMAP'); + $folder = rcube_charset::convert($folder, 'UTF7-IMAP'); $hidden_fields = array('name' => '_mbox', 'value' => $mbox); } @@ -73,33 +73,33 @@ function rcmail_folder_form($attrib) // General tab $form['props'] = array( - 'name' => rcube_label('properties'), + 'name' => $RCMAIL->gettext('properties'), ); // Location (name) if ($options['protected']) { - $foldername = str_replace($delimiter, ' » ', Q(rcmail_localize_folderpath($mbox_imap))); + $foldername = str_replace($delimiter, ' » ', rcube::Q($RCMAIL->localize_folderpath($mbox_imap))); } else if ($options['norename']) { - $foldername = Q($folder); + $foldername = rcube::Q($folder); } else { if (isset($_POST['_name'])) - $folder = trim(get_input_value('_name', RCUBE_INPUT_POST, true)); + $folder = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); $foldername = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30)); $foldername = $foldername->show($folder); if ($options['special']) { - $foldername .= ' (' . Q(rcmail_localize_foldername($mbox_imap)) .')'; + $foldername .= ' (' . rcube::Q($RCMAIL->localize_foldername($mbox_imap)) .')'; } } $form['props']['fieldsets']['location'] = array( - 'name' => rcube_label('location'), + 'name' => $RCMAIL->gettext('location'), 'content' => array( 'name' => array( - 'label' => rcube_label('foldername'), + 'label' => $RCMAIL->gettext('foldername'), 'value' => $foldername, ), ), @@ -121,7 +121,7 @@ function rcmail_folder_form($attrib) $exceptions[] = substr($prefix, 0, -1); } - $select = rcmail_mailbox_select(array( + $select = $RCMAIL->folder_selector(array( 'name' => '_parent', 'noselection' => '---', 'realnames' => false, @@ -132,21 +132,21 @@ function rcmail_folder_form($attrib) )); $form['props']['fieldsets']['location']['content']['path'] = array( - 'label' => rcube_label('parentfolder'), + 'label' => $RCMAIL->gettext('parentfolder'), 'value' => $select->show($selected), ); } // Settings $form['props']['fieldsets']['settings'] = array( - 'name' => rcube_label('settings'), + 'name' => $RCMAIL->gettext('settings'), ); // Settings: threading if ($threading_supported && ($mbox_imap == 'INBOX' || (!$options['noselect'] && !$options['is_root']))) { $select = new html_select(array('name' => '_viewmode', 'id' => '_listmode')); - $select->add(rcube_label('list'), 0); - $select->add(rcube_label('threads'), 1); + $select->add($RCMAIL->gettext('list'), 0); + $select->add($RCMAIL->gettext('threads'), 1); if (isset($_POST['_viewmode'])) { $value = (int) $_POST['_viewmode']; @@ -157,38 +157,38 @@ function rcmail_folder_form($attrib) } $form['props']['fieldsets']['settings']['content']['viewmode'] = array( - 'label' => rcube_label('listmode'), + 'label' => $RCMAIL->gettext('listmode'), 'value' => $select->show($value), ); } /* // Settings: sorting column $select = new html_select(array('name' => '_sortcol', 'id' => '_sortcol')); - $select->add(rcube_label('nonesort'), ''); - $select->add(rcube_label('arrival'), 'arrival'); - $select->add(rcube_label('sentdate'), 'date'); - $select->add(rcube_label('subject'), 'subject'); - $select->add(rcube_label('fromto'), 'from'); - $select->add(rcube_label('replyto'), 'replyto'); - $select->add(rcube_label('cc'), 'cc'); - $select->add(rcube_label('size'), 'size'); + $select->add($RCMAIL->gettext('nonesort'), ''); + $select->add($RCMAIL->gettext('arrival'), 'arrival'); + $select->add($RCMAIL->gettext('sentdate'), 'date'); + $select->add($RCMAIL->gettext('subject'), 'subject'); + $select->add($RCMAIL->gettext('fromto'), 'from'); + $select->add($RCMAIL->gettext('replyto'), 'replyto'); + $select->add($RCMAIL->gettext('cc'), 'cc'); + $select->add($RCMAIL->gettext('size'), 'size'); $value = isset($_POST['_sortcol']) ? $_POST['_sortcol'] : ''; $form['props']['fieldsets']['settings']['content']['sortcol'] = array( - 'label' => rcube_label('listsorting'), + 'label' => $RCMAIL->gettext('listsorting'), 'value' => $select->show($value), ); // Settings: sorting order $select = new html_select(array('name' => '_sortord', 'id' => '_sortord')); - $select->add(rcube_label('asc'), 'ASC'); - $select->add(rcube_label('desc'), 'DESC'); + $select->add($RCMAIL->gettext('asc'), 'ASC'); + $select->add($RCMAIL->gettext('desc'), 'DESC'); $value = isset($_POST['_sortord']) ? $_POST['_sortord'] : ''; $form['props']['fieldsets']['settings']['content']['sortord'] = array( - 'label' => rcube_label('listorder'), + 'label' => $RCMAIL->gettext('listorder'), 'value' => $select->show(), ); */ @@ -196,7 +196,7 @@ function rcmail_folder_form($attrib) if (strlen($mbox)) { // Number of messages $form['props']['fieldsets']['info'] = array( - 'name' => rcube_label('info'), + 'name' => $RCMAIL->gettext('info'), 'content' => array() ); @@ -207,9 +207,9 @@ function rcmail_folder_form($attrib) if ($msgcount) { // create link with folder-size command $onclick = sprintf("return %s.command('folder-size', '%s', this)", - JS_OBJECT_NAME, JQ($mbox_imap)); + rcmail_output::JS_OBJECT_NAME, rcube::JQ($mbox_imap)); $size = html::a(array('href' => '#', 'onclick' => $onclick, - 'id' => 'folder-size'), rcube_label('getfoldersize')); + 'id' => 'folder-size'), $RCMAIL->gettext('getfoldersize')); } else { // no messages -> zero size @@ -217,11 +217,11 @@ function rcmail_folder_form($attrib) } $form['props']['fieldsets']['info']['content']['count'] = array( - 'label' => rcube_label('messagecount'), + 'label' => $RCMAIL->gettext('messagecount'), 'value' => (int) $msgcount ); $form['props']['fieldsets']['info']['content']['size'] = array( - 'label' => rcube_label('size'), + 'label' => $RCMAIL->gettext('size'), 'value' => $size, ); } @@ -229,8 +229,8 @@ function rcmail_folder_form($attrib) // show folder type only if we have non-private namespaces if (!empty($namespace['shared']) || !empty($namespace['others'])) { $form['props']['fieldsets']['info']['content']['foldertype'] = array( - 'label' => rcube_label('foldertype'), - 'value' => rcube_label($options['namespace'] . 'folder')); + 'label' => $RCMAIL->gettext('foldertype'), + 'value' => $RCMAIL->gettext($options['namespace'] . 'folder')); } } @@ -256,7 +256,7 @@ function rcmail_folder_form($attrib) foreach ($tab['fieldsets'] as $fieldset) { $subcontent = rcmail_get_form_part($fieldset, $attrib); 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"; } } } @@ -265,7 +265,7 @@ function rcmail_folder_form($attrib) } if ($content && sizeof($form) > 1) { - $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"; } else { $out .= $content ."\n"; @@ -287,9 +287,9 @@ function rcmail_get_form_part($form, $attrib = array()) $table = new html_table(array('cols' => 2)); foreach ($form['content'] as $col => $colprop) { $colprop['id'] = '_'.$col; - $label = !empty($colprop['label']) ? $colprop['label'] : rcube_label($col); + $label = !empty($colprop['label']) ? $colprop['label'] : $RCMAIL->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($attrib); @@ -302,7 +302,7 @@ function rcmail_get_form_part($form, $attrib = array()) } -//$OUTPUT->set_pagetitle(rcube_label('folders')); +//$OUTPUT->set_pagetitle($RCMAIL->gettext('folders')); // register UI objects $OUTPUT->add_handlers(array( diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index edd4ba60d..974acb42a 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -23,14 +23,14 @@ define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0))); // edit-identity if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity') { - $IDENTITY_RECORD = $RCMAIL->user->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC)); + $IDENTITY_RECORD = $RCMAIL->user->get_identity(rcube_utils::get_input_value('_iid', rcube_utils::INPUT_GPC)); if (is_array($IDENTITY_RECORD)) $OUTPUT->set_env('iid', $IDENTITY_RECORD['identity_id']); else { $OUTPUT->show_message('dberror', 'error'); // go to identities page - rcmail_overwrite_action('identities'); + $RCMAIL->overwrite_action('identities'); return; } } @@ -39,7 +39,7 @@ else { if (IDENTITIES_LEVEL > 1) { $OUTPUT->show_message('opnotpermitted', 'error'); // go to identities page - rcmail_overwrite_action('identities'); + $RCMAIL->overwrite_action('identities'); return; } else if (IDENTITIES_LEVEL == 1) { @@ -53,7 +53,7 @@ function rcube_identity_form($attrib) global $IDENTITY_RECORD, $RCMAIL, $OUTPUT; // Add HTML editor script(s) - rcube_html_editor('identity'); + $RCMAIL->html_editor('identity'); // add some labels to client $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning'); @@ -65,21 +65,21 @@ function rcube_identity_form($attrib) // list of available cols $form = array( 'addressing' => array( - 'name' => rcube_label('settings'), + 'name' => $RCMAIL->gettext('settings'), 'content' => array( 'name' => array('type' => 'text', 'size' => $i_size), 'email' => array('type' => 'text', 'size' => $i_size), 'organization' => array('type' => 'text', 'size' => $i_size), 'reply-to' => array('type' => 'text', 'size' => $i_size), 'bcc' => array('type' => 'text', 'size' => $i_size), - 'standard' => array('type' => 'checkbox', 'label' => rcube_label('setdefault')), + 'standard' => array('type' => 'checkbox', 'label' => $RCMAIL->gettext('setdefault')), )), 'signature' => array( - 'name' => rcube_label('signature'), + 'name' => $RCMAIL->gettext('signature'), 'content' => array( 'signature' => array('type' => 'textarea', 'size' => $t_cols, 'rows' => $t_rows, 'spellcheck' => true), - 'html_signature' => array('type' => 'checkbox', 'label' => rcube_label('htmlsignature'), + 'html_signature' => array('type' => 'checkbox', 'label' => $RCMAIL->gettext('htmlsignature'), 'onclick' => 'return rcmail_toggle_editor(this, \'rcmfd_signature\');'), )) ); @@ -90,7 +90,7 @@ function rcube_identity_form($attrib) $form['signature']['content']['signature']['is_escaped'] = true; // Correctly handle HTML entities in HTML editor (#1488483) - $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCMAIL_CHARSET); + $IDENTITY_RECORD['signature'] = htmlspecialchars($IDENTITY_RECORD['signature'], ENT_NOQUOTES, RCUBE_CHARSET); } // disable some field according to access level @@ -106,7 +106,7 @@ function rcube_identity_form($attrib) } } - $IDENTITY_RECORD['email'] = rcube_idn_to_utf8($IDENTITY_RECORD['email']); + $IDENTITY_RECORD['email'] = rcube_utils::idn_to_utf8($IDENTITY_RECORD['email']); // Allow plugins to modify identity form content $plugin = $RCMAIL->plugins->exec_hook('identity_form', array( @@ -137,12 +137,12 @@ function rcube_identity_form($attrib) $colprop['id'] = 'rcmfd_'.$col; $label = !empty($colprop['label']) ? $colprop['label'] : - rcube_label(str_replace('-', '', $col)); + $RCMAIL->gettext(str_replace('-', '', $col)); $value = !empty($colprop['value']) ? $colprop['value'] : - rcmail_get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']); + rcube_output::get_edit_field($col, $IDENTITY_RECORD[$col], $colprop, $colprop['type']); - $table->add('title', html::label($colprop['id'], Q($label))); + $table->add('title', html::label($colprop['id'], rcube::Q($label))); $table->add(null, $value); } $content = $table->show($attrib); @@ -151,7 +151,7 @@ function rcube_identity_form($attrib) $content = $fieldset['content']; } - $out .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $content) ."\n"; + $out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($fieldset['name'])) . $content) ."\n"; } $out .= $form_end; @@ -164,7 +164,7 @@ $OUTPUT->add_handler('identityform', 'rcube_identity_form'); $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); $OUTPUT->add_label('deleteidentityconfirm'); -$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem'))); +$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action=='add-identity' ? 'newidentity' : 'edititem'))); if ($RCMAIL->action=='add-identity' && $OUTPUT->template_exists('identityadd')) $OUTPUT->send('identityadd'); diff --git a/program/steps/settings/edit_prefs.inc b/program/steps/settings/edit_prefs.inc index adf6b1623..93e27aedc 100644 --- a/program/steps/settings/edit_prefs.inc +++ b/program/steps/settings/edit_prefs.inc @@ -20,10 +20,10 @@ */ if (!$OUTPUT->ajax_call) - $OUTPUT->set_pagetitle(rcube_label('preferences')); + $OUTPUT->set_pagetitle($RCMAIL->gettext('preferences')); -$CURR_SECTION = get_input_value('_section', RCUBE_INPUT_GPC); +$CURR_SECTION = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GPC); list($SECTIONS,) = rcmail_user_prefs($CURR_SECTION); function rcmail_user_prefs_form($attrib) diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc index 49856775a..371d7ecc4 100644 --- a/program/steps/settings/edit_response.inc +++ b/program/steps/settings/edit_response.inc @@ -22,7 +22,7 @@ $responses = $RCMAIL->get_compose_responses(); // edit-response -if (($key = get_input_value('_key', RCUBE_INPUT_GPC))) { +if (($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC))) { foreach ($responses as $i => $response) { if ($response['key'] == $key) { $RESPONSE_RECORD = $response; @@ -34,8 +34,8 @@ if (($key = get_input_value('_key', RCUBE_INPUT_GPC))) { // save response if ($RCMAIL->action == 'save-response' && isset($_POST['_name']) && !$RESPONSE_RECORD['static']) { - $name = trim(get_input_value('_name', RCUBE_INPUT_POST)); - $text = trim(get_input_value('_text', RCUBE_INPUT_POST)); + $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST)); + $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST)); if (!empty($name) && !empty($text)) { $dupes = 0; @@ -85,12 +85,12 @@ function rcube_response_form($attrib) $out = "$form_start\n"; $table = new html_table(array('cols' => 2)); - $label = rcube_label('responsename'); + $label = $RCMAIL->gettext('responsename'); - $table->add('title', html::label('ffname', Q(rcube_label('responsename')))); + $table->add('title', html::label('ffname', rcube::Q($RCMAIL->gettext('responsename')))); $table->add(null, rcube_output::get_edit_field('name', $RESPONSE_RECORD['name'], array('id' => 'ffname', 'size' => $attrib['size'], 'disabled' => $disabled), 'text')); - $table->add('title', html::label('fftext', Q(rcube_label('responsetext')))); + $table->add('title', html::label('fftext', rcube::Q($RCMAIL->gettext('responsetext')))); $table->add(null, rcube_output::get_edit_field('text', $RESPONSE_RECORD['text'], array('id' => 'fftext', 'size' => $attrib['textareacols'], 'rows' => $attrib['textarearows'], 'disabled' => $disabled), 'textarea')); $out .= $table->show($attrib); @@ -101,7 +101,7 @@ function rcube_response_form($attrib) $OUTPUT->set_env('readonly', !empty($RESPONSE_RECORD['static'])); $OUTPUT->add_handler('responseform', 'rcube_response_form'); -$OUTPUT->set_pagetitle(rcube_label(($RCMAIL->action=='add-response' ? 'savenewresponse' : 'editresponse'))); +$OUTPUT->set_pagetitle($RCMAIL->gettext($RCMAIL->action == 'add-response' ? 'savenewresponse' : 'editresponse')); $OUTPUT->send('responseedit'); diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 44482e938..118590318 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -20,7 +20,7 @@ +-----------------------------------------------------------------------+ */ -// WARNING: folder names in UI are encoded with RCMAIL_CHARSET +// WARNING: folder names in UI are encoded with RCUBE_CHARSET // init IMAP connection $STORAGE = $RCMAIL->get_storage(); @@ -28,7 +28,7 @@ $STORAGE = $RCMAIL->get_storage(); // subscribe mailbox if ($RCMAIL->action == 'subscribe') { - $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true, 'UTF7-IMAP'); if (strlen($mbox)) { $result = $STORAGE->subscribe(array($mbox)); @@ -53,28 +53,28 @@ if ($RCMAIL->action == 'subscribe') $OUTPUT->show_message('foldersubscribed', 'confirmation'); } else - rcmail_display_server_error('errorsaving'); + $RCMAIL->display_server_error('errorsaving'); } } // unsubscribe mailbox else if ($RCMAIL->action == 'unsubscribe') { - $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); + $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true, 'UTF7-IMAP'); if (strlen($mbox)) { $result = $STORAGE->unsubscribe(array($mbox)); if ($result) $OUTPUT->show_message('folderunsubscribed', 'confirmation'); else - rcmail_display_server_error('errorsaving'); + $RCMAIL->display_server_error('errorsaving'); } } // delete an existing mailbox else if ($RCMAIL->action == 'delete-folder') { - $mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true); - $mbox = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); + $mbox_utf8 = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); + $mbox = rcube_charset::convert($mbox_utf8, RCUBE_CHARSET, 'UTF7-IMAP'); if (strlen($mbox)) { $plugin = $RCMAIL->plugins->exec_hook('folder_delete', array('name' => $mbox)); @@ -98,22 +98,22 @@ else if ($RCMAIL->action == 'delete-folder') $OUTPUT->show_message('folderdeleted', 'confirmation'); // Clear content frame $OUTPUT->command('subscription_select'); - $OUTPUT->command('set_quota', rcmail_quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content()); } else if (!$deleted) { - rcmail_display_server_error('errorsaving'); + $RCMAIL->display_server_error('errorsaving'); } } // rename an existing mailbox else if ($RCMAIL->action == 'rename-folder') { - $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, true)); - $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST, true); + $name_utf8 = trim(rcube_utils::get_input_value('_folder_newname', rcube_utils::INPUT_POST, true)); + $oldname_utf8 = rcube_utils::get_input_value('_folder_oldname', rcube_utils::INPUT_POST, true); if (strlen($name_utf8) && strlen($oldname_utf8)) { - $name = rcube_charset_convert($name_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); - $oldname = rcube_charset_convert($oldname_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); + $name = rcube_charset::convert($name_utf8, RCUBE_CHARSET, 'UTF7-IMAP'); + $oldname = rcube_charset::convert($oldname_utf8, RCUBE_CHARSET, 'UTF7-IMAP'); $rename = rcmail_rename_folder($oldname, $name); } @@ -122,15 +122,15 @@ else if ($RCMAIL->action == 'rename-folder') rcmail_update_folder_row($name, $oldname); } else if (!$rename) { - rcmail_display_server_error('errorsaving'); + $RCMAIL->display_server_error('errorsaving'); } } // clear mailbox else if ($RCMAIL->action == 'purge') { - $mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true); - $mbox = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); + $mbox_utf8 = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); + $mbox = rcube_charset::convert($mbox_utf8, RCUBE_CHARSET, 'UTF7-IMAP'); $delimiter = $STORAGE->get_hierarchy_delimiter(); $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; @@ -151,7 +151,7 @@ else if ($RCMAIL->action == 'purge') $OUTPUT->set_env('messagecount', 0); if ($delete) { $OUTPUT->show_message('folderpurged', 'confirmation'); - $OUTPUT->command('set_quota', rcmail_quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content()); } else { $OUTPUT->show_message('messagemoved', 'confirmation'); @@ -160,24 +160,24 @@ else if ($RCMAIL->action == 'purge') $OUTPUT->command('show_folder', $mbox_utf8, null, true); } else { - rcmail_display_server_error('errorsaving'); + $RCMAIL->display_server_error('errorsaving'); } } // get mailbox size else if ($RCMAIL->action == 'folder-size') { - $name = get_input_value('_mbox', RCUBE_INPUT_POST, true); + $name = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); $size = $STORAGE->folder_size($name); // @TODO: check quota and show percentage usage of specified mailbox? if ($size !== false) { - $OUTPUT->command('folder_size_update', show_bytes($size)); + $OUTPUT->command('folder_size_update', $RCMAIL->show_bytes($size)); } else { - rcmail_display_server_error(); + $RCMAIL->display_server_error(); } } @@ -200,7 +200,7 @@ function rcube_subscription_form($attrib) if ($attrib['noheader'] !== true && $attrib['noheader'] != "true") { // add table header - $table->add_header('name', rcube_label('foldername')); + $table->add_header('name', $RCMAIL->gettext('foldername')); $table->add_header('subscribed', ''); } @@ -225,7 +225,7 @@ function rcube_subscription_form($attrib) $folder_id = $folder; $folder = $STORAGE->mod_folder($folder); $foldersplit = explode($delimiter, $folder); - $name = rcube_charset_convert(array_pop($foldersplit), 'UTF7-IMAP'); + $name = rcube_charset::convert(array_pop($foldersplit), 'UTF7-IMAP'); $parent_folder = join($delimiter, $foldersplit); $level = count($foldersplit); @@ -234,7 +234,7 @@ function rcube_subscription_form($attrib) for ($i=1; $i<=$level; $i++) { $ancestor_folder = join($delimiter, array_slice($foldersplit, 0, $i)); if ($ancestor_folder && !$seen[$ancestor_folder]++) { - $ancestor_name = rcube_charset_convert($foldersplit[$i-1], 'UTF7-IMAP'); + $ancestor_name = rcube_charset::convert($foldersplit[$i-1], 'UTF7-IMAP'); $list_folders[] = array( 'id' => $ancestor_folder, 'name' => $ancestor_name, @@ -270,8 +270,8 @@ function rcube_subscription_form($attrib) $checkbox_subscribe = new html_checkbox(array( 'name' => '_subscribed[]', - 'title' => rcube_label('changesubscription'), - 'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)", + 'title' => $RCMAIL->gettext('changesubscription'), + 'onclick' => rcmail_output::JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)", )); // create list of available folders @@ -283,9 +283,9 @@ function rcube_subscription_form($attrib) $noselect = false; $classes = array($i%2 ? 'even' : 'odd'); - $folder_utf8 = rcube_charset_convert($folder['id'], 'UTF7-IMAP'); + $folder_utf8 = rcube_charset::convert($folder['id'], 'UTF7-IMAP'); $display_folder = str_repeat(' ', $folder['level']) - . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']); + . rcube::Q($protected ? $RCMAIL->localize_foldername($folder['id']) : $folder['name']); if ($folder['virtual']) { $classes[] = 'virtual'; @@ -418,7 +418,7 @@ function rcmail_rename_folder($oldname, $newname) } -$OUTPUT->set_pagetitle(rcube_label('folders')); +$OUTPUT->set_pagetitle($RCMAIL->gettext('folders')); $OUTPUT->include_script('list.js'); $OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix')); if ($STORAGE->get_capability('QUOTA')) { @@ -432,9 +432,8 @@ $OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting' // register UI objects $OUTPUT->add_handlers(array( 'foldersubscription' => 'rcube_subscription_form', - 'folderframe' => 'rcmail_folder_frame', - 'quotadisplay' => 'rcmail_quota_display', + 'folderframe' => 'rcmail_folder_frame', + 'quotadisplay' => array($RCMAIL, 'quota_display'), )); $OUTPUT->send('folders'); - diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 81744d904..c504e6c40 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -20,7 +20,7 @@ */ if (!$OUTPUT->ajax_call) { - $OUTPUT->set_pagetitle(rcube_label('preferences')); + $OUTPUT->set_pagetitle($RCMAIL->gettext('preferences')); } // similar function as /steps/settings/identities.inc::rcmail_identity_frame() @@ -48,7 +48,7 @@ function rcmail_sections_list($attrib) list($list, $cols) = rcmail_user_prefs(); // create XHTML table - $out = rcube_table_output($attrib, $list, $cols, 'id'); + $out = $RCMAIL->table_output($attrib, $list, $cols, 'id'); // set client env $RCMAIL->output->add_gui_object('sectionslist', $attrib['id']); @@ -70,7 +70,7 @@ function rcmail_identities_list($attrib) // get identities list and define 'mail' column $list = $RCMAIL->user->list_identities(); foreach ($list as $idx => $row) { - $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>'); + $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_utils::idn_to_utf8($row['email']) .'>'); } // get all identites from DB and define list of cols to be displayed @@ -81,7 +81,7 @@ function rcmail_identities_list($attrib) // @TODO: use <UL> instead of <TABLE> for identities list // create XHTML table - $out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id'); + $out = $RCMAIL->table_output($attrib, $plugin['list'], $plugin['cols'], 'identity_id'); // set client env $OUTPUT->add_gui_object('identitieslist', $attrib['id']); @@ -127,13 +127,13 @@ function rcmail_user_prefs($current = null) { global $RCMAIL; - $sections['general'] = array('id' => 'general', 'section' => rcube_label('uisettings')); - $sections['mailbox'] = array('id' => 'mailbox', 'section' => rcube_label('mailboxview')); - $sections['mailview'] = array('id' => 'mailview','section' => rcube_label('messagesdisplaying')); - $sections['compose'] = array('id' => 'compose', 'section' => rcube_label('messagescomposition')); - $sections['addressbook'] = array('id' => 'addressbook','section' => rcube_label('addressbook')); - $sections['folders'] = array('id' => 'folders', 'section' => rcube_label('specialfolders')); - $sections['server'] = array('id' => 'server', 'section' => rcube_label('serversettings')); + $sections['general'] = array('id' => 'general', 'section' => $RCMAIL->gettext('uisettings')); + $sections['mailbox'] = array('id' => 'mailbox', 'section' => $RCMAIL->gettext('mailboxview')); + $sections['mailview'] = array('id' => 'mailview','section' => $RCMAIL->gettext('messagesdisplaying')); + $sections['compose'] = array('id' => 'compose', 'section' => $RCMAIL->gettext('messagescomposition')); + $sections['addressbook'] = array('id' => 'addressbook','section' => $RCMAIL->gettext('addressbook')); + $sections['folders'] = array('id' => 'folders', 'section' => $RCMAIL->gettext('specialfolders')); + $sections['server'] = array('id' => 'server', 'section' => $RCMAIL->gettext('serversettings')); // hook + define list cols $plugin = $RCMAIL->plugins->exec_hook('preferences_sections_list', @@ -155,10 +155,10 @@ function rcmail_user_prefs($current = null) // general case 'general': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'skin' => array('name' => Q(rcube_label('skin'))), - 'browser' => array('name' => Q(rcube_label('browseroptions'))), - 'advanced'=> array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'skin' => array('name' => rcube::Q($RCMAIL->gettext('skin'))), + 'browser' => array('name' => rcube::Q($RCMAIL->gettext('browseroptions'))), + 'advanced'=> array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); // language selection @@ -175,7 +175,7 @@ function rcmail_user_prefs($current = null) $select->add(array_values($a_lang), array_keys($a_lang)); $blocks['main']['options']['language'] = array( - 'title' => html::label($field_id, Q(rcube_label('language'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('language'))), 'content' => $select->show($RCMAIL->user->language), ); } @@ -188,7 +188,7 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_timezone'; $select = new html_select(array('name' => '_timezone', 'id' => $field_id)); - $select->add(rcube_label('autodetect'), 'auto'); + $select->add($RCMAIL->gettext('autodetect'), 'auto'); $zones = array(); foreach (DateTimeZone::listIdentifiers() as $i => $tzs) { @@ -210,7 +210,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['timezone'] = array( - 'title' => html::label($field_id, Q(rcube_label('timezone'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('timezone'))), 'content' => $select->show((string)$config['timezone']), ); } @@ -232,7 +232,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['time_format'] = array( - 'title' => html::label($field_id, Q(rcube_label('timeformat'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('timeformat'))), 'content' => $select->show($RCMAIL->config->get('time_format')), ); } @@ -253,7 +253,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['date_format'] = array( - 'title' => html::label($field_id, Q(rcube_label('dateformat'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('dateformat'))), 'content' => $select->show($config['date_format']), ); } @@ -268,7 +268,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_pretty_date', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['prettydate'] = array( - 'title' => html::label($field_id, Q(rcube_label('prettydate'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('prettydate'))), 'content' => $input->show($config['prettydate']?1:0), ); } @@ -281,16 +281,16 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_refresh_interval'; $select = new html_select(array('name' => '_refresh_interval', 'id' => $field_id)); - $select->add(rcube_label('never'), 0); + $select->add($RCMAIL->gettext('never'), 0); foreach (array(1, 3, 5, 10, 15, 30, 60) as $min) { if (!$config['min_refresh_interval'] || $config['min_refresh_interval'] <= $min * 60) { - $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))); + $label = $RCMAIL->gettext(array('name' => 'everynminutes', 'vars' => array('n' => $min))); $select->add($label, $min); } } $blocks['main']['options']['refresh_interval'] = array( - 'title' => html::label($field_id, Q(rcube_label('refreshinterval'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('refreshinterval'))), 'content' => $select->show($config['refresh_interval']/60), ); } @@ -318,16 +318,16 @@ function rcmail_user_prefs($current = null) if (is_array($meta) && $meta['name']) { $skinname = $meta['name']; - $author_link = $meta['url'] ? html::a(array('href' => $meta['url'], 'target' => '_blank'), Q($meta['author'])) : Q($meta['author']); - $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), Q($meta['license'])) : Q($meta['license']); + $author_link = $meta['url'] ? html::a(array('href' => $meta['url'], 'target' => '_blank'), rcube::Q($meta['author'])) : rcube::Q($meta['author']); + $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), rcube::Q($meta['license'])) : rcube::Q($meta['license']); } $blocks['skin']['options'][$skin]['content'] = html::label(array('class' => 'skinselection'), html::span('skinitem', $input->show($config['skin'], array('value' => $skin, 'id' => $field_id.$skin))) . html::span('skinitem', html::img(array('src' => $thumbnail, 'class' => 'skinthumbnail', 'alt' => $skin, 'width' => 64, 'height' => 64))) . - html::span('skinitem', html::span('skinname', Q($skinname)) . html::br() . + html::span('skinitem', html::span('skinname', rcube::Q($skinname)) . html::br() . html::span('skinauthor', $author_link ? 'by ' . $author_link : '') . html::br() . - html::span('skinlicense', $license_link ? rcube_label('license').': ' . $license_link : '')) + html::span('skinlicense', $license_link ? $RCMAIL->gettext('license').': ' . $license_link : '')) ); } } @@ -344,7 +344,7 @@ function rcmail_user_prefs($current = null) $checkbox = new html_checkbox(array('name' => '_standard_windows', 'id' => $field_id, 'value' => 1)); $blocks['browser']['options']['standard_windows'] = array( - 'title' => html::label($field_id, Q(rcube_label('standardwindows'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('standardwindows'))), 'content' => $checkbox->show($config['standard_windows']?1:0), ); } @@ -352,13 +352,13 @@ function rcmail_user_prefs($current = null) if ($current) { $product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail'); $RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');", - JS_OBJECT_NAME, JQ($product_name)), 'foot'); + rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'foot'); } $blocks['browser']['options']['mailtoprotohandler'] = array( 'content' => html::a(array( 'href' => '#', - 'id' => 'mailtoprotohandler'), Q(rcube_label('mailtoprotohandler'))), + 'id' => 'mailtoprotohandler'), rcube::Q($RCMAIL->gettext('mailtoprotohandler'))), ); break; @@ -366,9 +366,9 @@ function rcmail_user_prefs($current = null) // Mailbox view (mail screen) case 'mailbox': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'new_message' => array('name' => Q(rcube_label('newmessage'))), - 'advanced' => array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'new_message' => array('name' => rcube::Q($RCMAIL->gettext('newmessage'))), + 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); // show config parameter for preview pane @@ -382,7 +382,7 @@ function rcmail_user_prefs($current = null) 'onchange' => "$('#rcmfd_preview_pane_mark_read').prop('disabled', !this.checked)")); $blocks['main']['options']['preview_pane'] = array( - 'title' => html::label($field_id, Q(rcube_label('previewpane'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('previewpane'))), 'content' => $input->show($config['preview_pane']?1:0), ); } @@ -400,16 +400,16 @@ function rcmail_user_prefs($current = null) $select = new html_select(array('name' => '_preview_pane_mark_read', 'id' => $field_id, 'disabled' => $config['preview_pane']?0:1)); - $select->add(rcube_label('never'), '-1'); - $select->add(rcube_label('immediately'), 0); + $select->add($RCMAIL->gettext('never'), '-1'); + $select->add($RCMAIL->gettext('immediately'), 0); foreach (array(5, 10, 20, 30) as $sec) { - $label = rcube_label(array('name' => 'afternseconds', 'vars' => array('n' => $sec))); + $label = $RCMAIL->gettext(array('name' => 'afternseconds', 'vars' => array('n' => $sec))); $select->add($label, $sec); } $blocks['main']['options']['preview_pane_mark_read'] = array( - 'title' => html::label($field_id, Q(rcube_label('previewpanemarkread'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('previewpanemarkread'))), 'content' => $select->show(intval($config['preview_pane_mark_read'])), ); } @@ -421,14 +421,14 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_mdn_requests'; $select = new html_select(array('name' => '_mdn_requests', 'id' => $field_id)); - $select->add(rcube_label('askuser'), 0); - $select->add(rcube_label('autosend'), 1); - $select->add(rcube_label('autosendknown'), 3); - $select->add(rcube_label('autosendknownignore'), 4); - $select->add(rcube_label('ignore'), 2); + $select->add($RCMAIL->gettext('askuser'), 0); + $select->add($RCMAIL->gettext('autosend'), 1); + $select->add($RCMAIL->gettext('autosendknown'), 3); + $select->add($RCMAIL->gettext('autosendknownignore'), 4); + $select->add($RCMAIL->gettext('ignore'), 2); $blocks['main']['options']['mdn_requests'] = array( - 'title' => html::label($field_id, Q(rcube_label('mdnrequests'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('mdnrequests'))), 'content' => $select->show($config['mdn_requests']), ); } @@ -444,12 +444,12 @@ function rcmail_user_prefs($current = null) if ($supported) { $field_id = 'rcmfd_autoexpand_threads'; $select = new html_select(array('name' => '_autoexpand_threads', 'id' => $field_id)); - $select->add(rcube_label('never'), 0); - $select->add(rcube_label('do_expand'), 1); - $select->add(rcube_label('expand_only_unread'), 2); + $select->add($RCMAIL->gettext('never'), 0); + $select->add($RCMAIL->gettext('do_expand'), 1); + $select->add($RCMAIL->gettext('expand_only_unread'), 2); $blocks['main']['options']['autoexpand_threads'] = array( - 'title' => html::label($field_id, Q(rcube_label('autoexpand_threads'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autoexpand_threads'))), 'content' => $select->show($config['autoexpand_threads']), ); } @@ -466,7 +466,7 @@ function rcmail_user_prefs($current = null) $size = intval($config['mail_pagesize'] ? $config['mail_pagesize'] : $config['pagesize']); $blocks['main']['options']['pagesize'] = array( - 'title' => html::label($field_id, Q(rcube_label('pagesize'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('pagesize'))), 'content' => $input->show($size ? $size : 50), ); } @@ -480,7 +480,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1)); $blocks['new_message']['options']['check_all_folders'] = array( - 'title' => html::label($field_id, Q(rcube_label('checkallfolders'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('checkallfolders'))), 'content' => $input->show($config['check_all_folders']?1:0), ); } @@ -489,8 +489,8 @@ function rcmail_user_prefs($current = null) // Message viewing case 'mailview': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'advanced' => array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); // show checkbox to open message view in new window @@ -503,7 +503,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_message_extwin', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['message_extwin'] = array( - 'title' => html::label($field_id, Q(rcube_label('showinextwin'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showinextwin'))), 'content' => $input->show($config['message_extwin']?1:0), ); } @@ -518,7 +518,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_message_show_email', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['message_show_email'] = array( - 'title' => html::label($field_id, Q(rcube_label('showemail'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showemail'))), 'content' => $input->show($config['message_show_email']?1:0), ); } @@ -534,7 +534,7 @@ function rcmail_user_prefs($current = null) 'onchange' => "$('#rcmfd_show_images').prop('disabled', !this.checked).val(0)")); $blocks['main']['options']['prefer_html'] = array( - 'title' => html::label($field_id, Q(rcube_label('preferhtml'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('preferhtml'))), 'content' => $input->show($config['prefer_html']?1:0), ); } @@ -547,7 +547,7 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_default_charset'; $blocks['advanced']['options']['default_charset'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultcharset'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('defaultcharset'))), 'content' => $RCMAIL->output->charset_selector(array( 'id' => $field_id, 'name' => '_default_charset', 'selected' => $config['default_charset'] ))); @@ -562,12 +562,12 @@ function rcmail_user_prefs($current = null) $input = new html_select(array('name' => '_show_images', 'id' => $field_id, 'disabled' => !$config['prefer_html'])); - $input->add(rcube_label('never'), 0); - $input->add(rcube_label('fromknownsenders'), 1); - $input->add(rcube_label('always'), 2); + $input->add($RCMAIL->gettext('never'), 0); + $input->add($RCMAIL->gettext('fromknownsenders'), 1); + $input->add($RCMAIL->gettext('always'), 2); $blocks['main']['options']['show_images'] = array( - 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showremoteimages'))), 'content' => $input->show($config['prefer_html'] ? $config['show_images'] : 0), ); } @@ -581,7 +581,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_inline_images', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['inline_images'] = array( - 'title' => html::label($field_id, Q(rcube_label('showinlineimages'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('showinlineimages'))), 'content' => $input->show($config['inline_images']?1:0), ); } @@ -596,7 +596,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['display_next'] = array( - 'title' => html::label($field_id, Q(rcube_label('displaynext'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('displaynext'))), 'content' => $input->show($config['display_next']?1:0), ); } @@ -605,10 +605,10 @@ function rcmail_user_prefs($current = null) // Mail composition case 'compose': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'sig' => array('name' => Q(rcube_label('signatureoptions'))), - 'spellcheck' => array('name' => Q(rcube_label('spellcheckoptions'))), - 'advanced' => array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'sig' => array('name' => rcube::Q($RCMAIL->gettext('signatureoptions'))), + 'spellcheck' => array('name' => rcube::Q($RCMAIL->gettext('spellcheckoptions'))), + 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); // show checkbox to compose messages in a new window @@ -621,7 +621,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_compose_extwin', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['compose_extwin'] = array( - 'title' => html::label($field_id, Q(rcube_label('composeextwin'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('composeextwin'))), 'content' => $input->show($config['compose_extwin']?1:0), ); } @@ -634,13 +634,13 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_htmleditor'; $select = new html_select(array('name' => '_htmleditor', 'id' => $field_id)); - $select->add(rcube_label('never'), 0); - $select->add(rcube_label('always'), 1); - $select->add(rcube_label('htmlonreply'), 2); - $select->add(rcube_label('htmlonreplyandforward'), 3); + $select->add($RCMAIL->gettext('never'), 0); + $select->add($RCMAIL->gettext('always'), 1); + $select->add($RCMAIL->gettext('htmlonreply'), 2); + $select->add($RCMAIL->gettext('htmlonreplyandforward'), 3); $blocks['main']['options']['htmleditor'] = array( - 'title' => html::label($field_id, Q(rcube_label('htmleditor'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('htmleditor'))), 'content' => $select->show(intval($config['htmleditor'])), ); } @@ -653,14 +653,14 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_autosave'; $select = new html_select(array('name' => '_draft_autosave', 'id' => $field_id, 'disabled' => empty($config['drafts_mbox']))); - $select->add(rcube_label('never'), 0); + $select->add($RCMAIL->gettext('never'), 0); foreach (array(1, 3, 5, 10) as $i => $min) { - $label = rcube_label(array('name' => 'everynminutes', 'vars' => array('n' => $min))); + $label = $RCMAIL->gettext(array('name' => 'everynminutes', 'vars' => array('n' => $min))); $select->add($label, $min*60); } $blocks['main']['options']['draft_autosave'] = array( - 'title' => html::label($field_id, Q(rcube_label('autosavedraft'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autosavedraft'))), 'content' => $select->show($config['draft_autosave']), ); } @@ -673,12 +673,12 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_param_folding'; $select = new html_select(array('name' => '_mime_param_folding', 'id' => $field_id)); - $select->add(rcube_label('2231folding'), 0); - $select->add(rcube_label('miscfolding'), 1); - $select->add(rcube_label('2047folding'), 2); + $select->add($RCMAIL->gettext('2231folding'), 0); + $select->add($RCMAIL->gettext('miscfolding'), 1); + $select->add($RCMAIL->gettext('2047folding'), 2); $blocks['advanced']['options']['mime_param_folding'] = array( - 'title' => html::label($field_id, Q(rcube_label('mimeparamfolding'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('mimeparamfolding'))), 'content' => $select->show($config['mime_param_folding']), ); } @@ -692,7 +692,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_force_7bit', 'id' => $field_id, 'value' => 1)); $blocks['advanced']['options']['force_7bit'] = array( - 'title' => html::label($field_id, Q(rcube_label('force7bit'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('force7bit'))), 'content' => $input->show($config['force_7bit']?1:0), ); } @@ -706,7 +706,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['mdn_default'] = array( - 'title' => html::label($field_id, Q(rcube_label('reqmdn'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('reqmdn'))), 'content' => $input->show($config['mdn_default']?1:0), ); } @@ -720,7 +720,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_dsn_default', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['dsn_default'] = array( - 'title' => html::label($field_id, Q(rcube_label('reqdsn'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('reqdsn'))), 'content' => $input->show($config['dsn_default']?1:0), ); } @@ -734,7 +734,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_reply_same_folder', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['reply_same_folder'] = array( - 'title' => html::label($field_id, Q(rcube_label('replysamefolder'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replysamefolder'))), 'content' => $input->show($config['reply_same_folder']?1:0), ); } @@ -747,12 +747,12 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_reply_mode'; $select = new html_select(array('name' => '_reply_mode', 'id' => $field_id)); - $select->add(rcube_label('replyempty'), -1); - $select->add(rcube_label('replybottomposting'), 0); - $select->add(rcube_label('replytopposting'), 1); + $select->add($RCMAIL->gettext('replyempty'), -1); + $select->add($RCMAIL->gettext('replybottomposting'), 0); + $select->add($RCMAIL->gettext('replytopposting'), 1); $blocks['main']['options']['reply_mode'] = array( - 'title' => html::label($field_id, Q(rcube_label('whenreplying'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('whenreplying'))), 'content' => $select->show(intval($config['reply_mode'])), ); } @@ -766,7 +766,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1)); $blocks['spellcheck']['options']['spellcheck_before_send'] = array( - 'title' => html::label($field_id, Q(rcube_label('spellcheckbeforesend'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('spellcheckbeforesend'))), 'content' => $input->show($config['spellcheck_before_send']?1:0), ); } @@ -782,7 +782,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_'.$key, 'id' => 'rcmfd_'.$key, 'value' => 1)); $blocks['spellcheck']['options'][$key] = array( - 'title' => html::label($field_id, Q(rcube_label(str_replace('_', '', $key)))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext(str_replace('_', '', $key)))), 'content' => $input->show($config[$key]?1:0), ); } @@ -797,13 +797,13 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_show_sig'; $select = new html_select(array('name' => '_show_sig', 'id' => $field_id)); - $select->add(rcube_label('never'), 0); - $select->add(rcube_label('always'), 1); - $select->add(rcube_label('newmessageonly'), 2); - $select->add(rcube_label('replyandforwardonly'), 3); + $select->add($RCMAIL->gettext('never'), 0); + $select->add($RCMAIL->gettext('always'), 1); + $select->add($RCMAIL->gettext('newmessageonly'), 2); + $select->add($RCMAIL->gettext('replyandforwardonly'), 3); $blocks['sig']['options']['show_sig'] = array( - 'title' => html::label($field_id, Q(rcube_label('autoaddsignature'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autoaddsignature'))), 'content' => $select->show($RCMAIL->config->get('show_sig', 1)), ); } @@ -817,7 +817,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_strip_existing_sig', 'id' => $field_id, 'value' => 1)); $blocks['sig']['options']['strip_existing_sig'] = array( - 'title' => html::label($field_id, Q(rcube_label('replyremovesignature'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replyremovesignature'))), 'content' => $input->show($config['strip_existing_sig']?1:0), ); } @@ -830,11 +830,11 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_forward_attachment'; $select = new html_select(array('name' => '_forward_attachment', 'id' => $field_id)); - $select->add(rcube_label('inline'), 0); - $select->add(rcube_label('asattachment'), 1); + $select->add($RCMAIL->gettext('inline'), 0); + $select->add($RCMAIL->gettext('asattachment'), 1); $blocks['main']['options']['forward_attachment'] = array( - 'title' => html::label($field_id, Q(rcube_label('forwardmode'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('forwardmode'))), 'content' => $select->show(intval($config['forward_attachment'])), ); } @@ -858,13 +858,13 @@ function rcmail_user_prefs($current = null) $select_default_font = new html_select(array('name' => '_default_font', 'id' => $field_id)); $select_default_font->add('', ''); - $fonts = rcube_fontdefs(); + $fonts = rcmail::font_defs(); foreach ($fonts as $fname => $font) { $select_default_font->add($fname, $fname); } $blocks['main']['options']['default_font'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultfont'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('defaultfont'))), 'content' => $select_default_font->show($RCMAIL->config->get('default_font', 1)) . $select_default_font_size->show($RCMAIL->config->get('default_font_size', 1)) ); @@ -878,11 +878,11 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_reply_all_mode'; $select = new html_select(array('name' => '_reply_all_mode', 'id' => $field_id)); - $select->add(rcube_label('replyalldefault'), 0); - $select->add(rcube_label('replyalllist'), 1); + $select->add($RCMAIL->gettext('replyalldefault'), 0); + $select->add($RCMAIL->gettext('replyalllist'), 1); $blocks['main']['options']['reply_all_mode'] = array( - 'title' => html::label($field_id, Q(rcube_label('replyallmode'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('replyallmode'))), 'content' => $select->show(intval($config['reply_all_mode'])), ); } @@ -892,8 +892,8 @@ function rcmail_user_prefs($current = null) // Addressbook config case 'addressbook': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'advanced' => array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); if (!isset($no_override['default_addressbook']) @@ -911,7 +911,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['default_addressbook'] = array( - 'title' => html::label($field_id, Q(rcube_label('defaultabook'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('defaultabook'))), 'content' => $select->show($config['default_addressbook']), ); } @@ -925,13 +925,13 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_addressbook_name_listing'; $select = new html_select(array('name' => '_addressbook_name_listing', 'id' => $field_id)); - $select->add(rcube_label('name'), 0); - $select->add(rcube_label('firstname') . ' ' . rcube_label('surname'), 1); - $select->add(rcube_label('surname') . ' ' . rcube_label('firstname'), 2); - $select->add(rcube_label('surname') . ', ' . rcube_label('firstname'), 3); + $select->add($RCMAIL->gettext('name'), 0); + $select->add($RCMAIL->gettext('firstname') . ' ' . $RCMAIL->gettext('surname'), 1); + $select->add($RCMAIL->gettext('surname') . ' ' . $RCMAIL->gettext('firstname'), 2); + $select->add($RCMAIL->gettext('surname') . ', ' . $RCMAIL->gettext('firstname'), 3); $blocks['main']['options']['list_name_listing'] = array( - 'title' => html::label($field_id, Q(rcube_label('listnamedisplay'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('listnamedisplay'))), 'content' => $select->show($config['addressbook_name_listing']), ); } @@ -945,12 +945,12 @@ function rcmail_user_prefs($current = null) $field_id = 'rcmfd_addressbook_sort_col'; $select = new html_select(array('name' => '_addressbook_sort_col', 'id' => $field_id)); - $select->add(rcube_label('name'), 'name'); - $select->add(rcube_label('firstname'), 'firstname'); - $select->add(rcube_label('surname'), 'surname'); + $select->add($RCMAIL->gettext('name'), 'name'); + $select->add($RCMAIL->gettext('firstname'), 'firstname'); + $select->add($RCMAIL->gettext('surname'), 'surname'); $blocks['main']['options']['sort_col'] = array( - 'title' => html::label($field_id, Q(rcube_label('listsorting'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('listsorting'))), 'content' => $select->show($config['addressbook_sort_col']), ); } @@ -966,7 +966,7 @@ function rcmail_user_prefs($current = null) $size = intval($config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']); $blocks['main']['options']['pagesize'] = array( - 'title' => html::label($field_id, Q(rcube_label('pagesize'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('pagesize'))), 'content' => $input->show($size ? $size : 50), ); } @@ -980,7 +980,7 @@ function rcmail_user_prefs($current = null) $checkbox = new html_checkbox(array('name' => '_autocomplete_single', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['autocomplete_single'] = array( - 'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('autocompletesingle'))), 'content' => $checkbox->show($config['autocomplete_single']?1:0), ); } @@ -989,8 +989,8 @@ function rcmail_user_prefs($current = null) // Special IMAP folders case 'folders': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'advanced' => array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); if (!isset($no_override['show_real_foldernames'])) { @@ -1002,14 +1002,14 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_show_real_foldernames', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['show_real_foldernames'] = array( - 'title' => html::label($field_id, Q(rcube_label('show_real_foldernames'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('show_real_foldernames'))), 'content' => $input->show($config['show_real_foldernames']?1:0), ); } // Configure special folders if (!isset($no_override['default_folders']) && $current) { - $select = rcmail_mailbox_select(array( + $select = $RCMAIL->folder_selector(array( 'noselection' => '---', 'realnames' => true, 'maxlength' => 30, @@ -1027,7 +1027,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['drafts_mbox'] = array( - 'title' => Q(rcube_label('drafts')), + 'title' => rcube::Q($RCMAIL->gettext('drafts')), 'content' => $select->show($config['drafts_mbox'], array('name' => "_drafts_mbox", 'onchange' => $onchange)), ); } @@ -1038,7 +1038,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['sent_mbox'] = array( - 'title' => Q(rcube_label('sent')), + 'title' => rcube::Q($RCMAIL->gettext('sent')), 'content' => $select->show($config['sent_mbox'], array('name' => "_sent_mbox", 'onchange' => '')), ); } @@ -1049,7 +1049,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['junk_mbox'] = array( - 'title' => Q(rcube_label('junk')), + 'title' => rcube::Q($RCMAIL->gettext('junk')), 'content' => $select->show($config['junk_mbox'], array('name' => "_junk_mbox", 'onchange' => $onchange)), ); } @@ -1060,7 +1060,7 @@ function rcmail_user_prefs($current = null) } $blocks['main']['options']['trash_mbox'] = array( - 'title' => Q(rcube_label('trash')), + 'title' => rcube::Q($RCMAIL->gettext('trash')), 'content' => $select->show($config['trash_mbox'], array('name' => "_trash_mbox", 'onchange' => $onchange)), ); } @@ -1069,9 +1069,9 @@ function rcmail_user_prefs($current = null) // Server settings case 'server': $blocks = array( - 'main' => array('name' => Q(rcube_label('mainoptions'))), - 'maintenance' => array('name' => Q(rcube_label('maintenance'))), - 'advanced' => array('name' => Q(rcube_label('advancedoptions'))), + 'main' => array('name' => rcube::Q($RCMAIL->gettext('mainoptions'))), + 'maintenance' => array('name' => rcube::Q($RCMAIL->gettext('maintenance'))), + 'advanced' => array('name' => rcube::Q($RCMAIL->gettext('advancedoptions'))), ); if (!isset($no_override['read_when_deleted'])) { @@ -1083,7 +1083,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_read_when_deleted', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['read_when_deleted'] = array( - 'title' => html::label($field_id, Q(rcube_label('readwhendeleted'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('readwhendeleted'))), 'content' => $input->show($config['read_when_deleted']?1:0), ); } @@ -1097,7 +1097,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_flag_for_deletion', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['flag_for_deletion'] = array( - 'title' => html::label($field_id, Q(rcube_label('flagfordeletion'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('flagfordeletion'))), 'content' => $input->show($config['flag_for_deletion']?1:0), ); } @@ -1112,7 +1112,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_skip_deleted', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['skip_deleted'] = array( - 'title' => html::label($field_id, Q(rcube_label('skipdeleted'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('skipdeleted'))), 'content' => $input->show($config['skip_deleted']?1:0), ); } @@ -1126,7 +1126,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_delete_always', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['delete_always'] = array( - 'title' => html::label($field_id, Q(rcube_label('deletealways'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('deletealways'))), 'content' => $input->show($config['delete_always']?1:0), ); } @@ -1140,7 +1140,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_delete_junk', 'id' => $field_id, 'value' => 1)); $blocks['main']['options']['delete_junk'] = array( - 'title' => html::label($field_id, Q(rcube_label('deletejunk'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('deletejunk'))), 'content' => $input->show($config['delete_junk']?1:0), ); } @@ -1155,7 +1155,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_logout_purge', 'id' => $field_id, 'value' => 1)); $blocks['maintenance']['options']['logout_purge'] = array( - 'title' => html::label($field_id, Q(rcube_label('logoutclear'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('logoutclear'))), 'content' => $input->show($config['logout_purge']?1:0), ); } @@ -1170,7 +1170,7 @@ function rcmail_user_prefs($current = null) $input = new html_checkbox(array('name' => '_logout_expunge', 'id' => $field_id, 'value' => 1)); $blocks['maintenance']['options']['logout_expunge'] = array( - 'title' => html::label($field_id, Q(rcube_label('logoutcompact'))), + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('logoutcompact'))), 'content' => $input->show($config['logout_expunge']?1:0), ); } @@ -1265,19 +1265,19 @@ function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class $storage = $RCMAIL->get_storage(); $delimiter = $storage->get_hierarchy_delimiter(); - $name_utf8 = rcube_charset_convert($name, 'UTF7-IMAP'); + $name_utf8 = rcube_charset::convert($name, 'UTF7-IMAP'); $protected = $protect_folders && in_array($name, $default_folders); $foldersplit = explode($delimiter, $storage->mod_folder($name)); $level = count($foldersplit) - 1; $display_name = str_repeat(' ', $level) - . Q($protected ? rcmail_localize_foldername($name) : rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP')); + . rcube::Q($protected ? $RCMAIL->localize_foldername($name) : rcube_charset::convert($foldersplit[$level], 'UTF7-IMAP')); if ($oldname === null) $OUTPUT->command('add_folder_row', $name_utf8, $display_name, $protected, $subscribe, false, $class_name); else - $OUTPUT->command('replace_folder_row', rcube_charset_convert($oldname, 'UTF7-IMAP'), + $OUTPUT->command('replace_folder_row', rcube_charset::convert($oldname, 'UTF7-IMAP'), $name_utf8, $display_name, $protected, $class_name); } diff --git a/program/steps/settings/identities.inc b/program/steps/settings/identities.inc index 82a1841a3..7072acf72 100644 --- a/program/steps/settings/identities.inc +++ b/program/steps/settings/identities.inc @@ -21,7 +21,7 @@ define('IDENTITIES_LEVEL', intval($RCMAIL->config->get('identities_level', 0))); -$OUTPUT->set_pagetitle(rcube_label('identities')); +$OUTPUT->set_pagetitle($RCMAIL->gettext('identities')); $OUTPUT->include_script('list.js'); diff --git a/program/steps/settings/responses.inc b/program/steps/settings/responses.inc index cfc4148c3..45d1405f7 100644 --- a/program/steps/settings/responses.inc +++ b/program/steps/settings/responses.inc @@ -21,8 +21,8 @@ if (!empty($_POST['_insert'])) { - $name = trim(get_input_value('_name', RCUBE_INPUT_POST)); - $text = trim(get_input_value('_text', RCUBE_INPUT_POST)); + $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST)); + $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST)); if (!empty($name) && !empty($text)) { $dupes = 0; @@ -40,10 +40,10 @@ if (!empty($_POST['_insert'])) { if ($RCMAIL->user->save_prefs(array('compose_responses' => $responses))) { $RCMAIL->output->command('add_response_item', $response); - $RCMAIL->output->command('display_message', rcube_label('successfullysaved'), 'confirmation'); + $RCMAIL->output->command('display_message', $RCMAIL->gettext('successfullysaved'), 'confirmation'); } else { - $RCMAIL->output->command('display_message', rcube_label('errorsaving'), 'error'); + $RCMAIL->output->command('display_message', $RCMAIL->gettext('errorsaving'), 'error'); } } @@ -53,7 +53,7 @@ if (!empty($_POST['_insert'])) { if ($RCMAIL->action == 'delete-response') { - if ($key = get_input_value('_key', RCUBE_INPUT_GPC)) { + if ($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC)) { $responses = $RCMAIL->get_compose_responses(false, true); foreach ($responses as $i => $response) { if (empty($response['key'])) @@ -67,7 +67,7 @@ if ($RCMAIL->action == 'delete-response') { } if ($deleted) { - $RCMAIL->output->command('display_message', rcube_label('deletedsuccessfully'), 'confirmation'); + $RCMAIL->output->command('display_message', $RCMAIL->gettext('deletedsuccessfully'), 'confirmation'); $RCMAIL->output->command('remove_response', $key); } @@ -77,7 +77,7 @@ if ($RCMAIL->action == 'delete-response') { } -$OUTPUT->set_pagetitle(rcube_label('responses')); +$OUTPUT->set_pagetitle($RCMAIL->gettext('responses')); $OUTPUT->include_script('list.js'); @@ -95,7 +95,7 @@ function rcmail_responses_list($attrib) 'cols' => array('name') )); - $out = rcube_table_output($attrib, $plugin['list'], $plugin['cols'], 'key'); + $out = $RCMAIL->table_output($attrib, $plugin['list'], $plugin['cols'], 'key'); // set client env $OUTPUT->add_gui_object('responseslist', $attrib['id']); diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc index 72a631cfc..f876ff8e0 100644 --- a/program/steps/settings/save_folder.inc +++ b/program/steps/settings/save_folder.inc @@ -19,18 +19,18 @@ +-----------------------------------------------------------------------+ */ -// WARNING: folder names in UI are encoded with RCMAIL_CHARSET +// WARNING: folder names in UI are encoded with RCUBE_CHARSET // init IMAP connection $STORAGE = $RCMAIL->get_storage(); -$name = trim(get_input_value('_name', RCUBE_INPUT_POST, true)); -$old = get_input_value('_mbox', RCUBE_INPUT_POST, true); -$path = get_input_value('_parent', RCUBE_INPUT_POST, true); +$name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); +$old = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); +$path = rcube_utils::get_input_value('_parent', rcube_utils::INPUT_POST, true); -$name_imap = rcube_charset_convert($name, RCMAIL_CHARSET, 'UTF7-IMAP'); -$old_imap = rcube_charset_convert($old, RCMAIL_CHARSET, 'UTF7-IMAP'); +$name_imap = rcube_charset::convert($name, RCUBE_CHARSET, 'UTF7-IMAP'); +$old_imap = rcube_charset::convert($old, RCUBE_CHARSET, 'UTF7-IMAP'); // $path is in UTF7-IMAP already $delimiter = $STORAGE->get_hierarchy_delimiter(); @@ -40,16 +40,16 @@ $options = strlen($old_imap) ? rcmail_folder_options($old_imap) : array(); if ($options['protected'] || $options['norename']) { } else if (!strlen($name)) { - $error = rcube_label('namecannotbeempty'); + $error = $RCMAIL->gettext('namecannotbeempty'); } else if (mb_strlen($name) > 128) { - $error = rcube_label('nametoolong'); + $error = $RCMAIL->gettext('nametoolong'); } else { // these characters are problematic e.g. when used in LIST/LSUB foreach (array($delimiter, '%', '*') as $char) { if (strpos($name, $delimiter) !== false) { - $error = rcube_label('forbiddencharacter') . " ($char)"; + $error = $RCMAIL->gettext('forbiddencharacter') . " ($char)"; break; } } @@ -76,7 +76,7 @@ if (!$error && strlen($path) && (!strlen($old_imap) || $old_imap != $name_imap)) if ($parent_opts['namespace'] != 'personal' && (empty($parent_opts['rights']) || !preg_match('/[ck]/', implode($parent_opts['rights']))) ) { - $error = rcube_label('parentnotwritable'); + $error = $RCMAIL->gettext('parentnotwritable'); } } @@ -90,9 +90,9 @@ else { $folder['options'] = $options; $folder['settings'] = array( // List view mode: 0-list, 1-threads - 'view_mode' => (int) get_input_value('_viewmode', RCUBE_INPUT_POST), - 'sort_column' => get_input_value('_sortcol', RCUBE_INPUT_POST), - 'sort_order' => get_input_value('_sortord', RCUBE_INPUT_POST), + 'view_mode' => (int) rcube_utils::get_input_value('_viewmode', rcube_utils::INPUT_POST), + 'sort_column' => rcube_utils::get_input_value('_sortcol', rcube_utils::INPUT_POST), + 'sort_order' => rcube_utils::get_input_value('_sortord', rcube_utils::INPUT_POST), ); } @@ -199,4 +199,4 @@ else if (!$error) { } } -rcmail_overwrite_action('edit-folder'); +$RCMAIL->overwrite_action('edit-folder'); diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index d3b132f8b..5bd04003d 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -28,7 +28,7 @@ $updated = $default_id = false; // check input if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) { $OUTPUT->show_message('formincomplete', 'warning'); - rcmail_overwrite_action('edit-identity'); + $RCMAIL->overwrite_action('edit-identity'); return; } @@ -36,7 +36,7 @@ $save_data = array(); foreach ($a_save_cols as $col) { $fname = '_'.$col; if (isset($_POST[$fname])) - $save_data[$col] = get_input_value($fname, RCUBE_INPUT_POST, true); + $save_data[$col] = rcube_utils::get_input_value($fname, rcube_utils::INPUT_POST, true); } // set "off" values for checkboxes that were not checked, and therefore @@ -61,17 +61,17 @@ else if (IDENTITIES_LEVEL == 4) { } // Validate e-mail addresses -$email_checks = array(rcube_idn_to_ascii($save_data['email'])); +$email_checks = array(rcube_utils::idn_to_ascii($save_data['email'])); foreach (array('reply-to', 'bcc') as $item) { foreach (rcube_mime::decode_address_list($save_data[$item], null, false) as $rcpt) - $email_checks[] = rcube_idn_to_ascii($rcpt['mailto']); + $email_checks[] = rcube_utils::idn_to_ascii($rcpt['mailto']); } foreach ($email_checks as $email) { - if ($email && !check_email($email)) { + if ($email && !rcube_utils::check_email($email)) { // show error message - $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_idn_to_utf8($email)), false); - rcmail_overwrite_action('edit-identity'); + $OUTPUT->show_message('emailformaterror', 'error', array('email' => rcube_utils::idn_to_utf8($email)), false); + $RCMAIL->overwrite_action('edit-identity'); return; } } @@ -87,7 +87,7 @@ if (!empty($save_data['signature']) && !empty($save_data['html_signature'])) { // update an existing contact if ($_POST['_iid']) { - $iid = get_input_value('_iid', RCUBE_INPUT_POST); + $iid = rcube_utils::get_input_value('_iid', rcube_utils::INPUT_POST); if (in_array(IDENTITIES_LEVEL, array(1,3,4))) { // merge with old identity data, fixes #1488834 @@ -100,7 +100,7 @@ if ($_POST['_iid']) { $save_data = $plugin['record']; if ($save_data['email']) - $save_data['email'] = rcube_idn_to_ascii($save_data['email']); + $save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']); if (!$plugin['abort']) $updated = $RCMAIL->user->update_identity($iid, $save_data); else @@ -114,13 +114,13 @@ if ($_POST['_iid']) { if ($_POST['_framed']) { // update the changed col in list - $OUTPUT->command('parent.update_identity_row', $iid, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>'))); + $OUTPUT->command('parent.update_identity_row', $iid, rcube::Q(trim($save_data['name'] . ' <' . rcube_utils::idn_to_utf8($save_data['email']) .'>'))); } } else { // show error message $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false); - rcmail_overwrite_action('edit-identity'); + $RCMAIL->overwrite_action('edit-identity'); return; } } @@ -135,7 +135,7 @@ else if (IDENTITIES_LEVEL < 2) { $save_data = $plugin['record']; if ($save_data['email']) - $save_data['email'] = rcube_idn_to_ascii($save_data['email']); + $save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']); if (!$plugin['abort']) $insert_id = $save_data['email'] ? $RCMAIL->user->insert_identity($save_data) : null; @@ -152,13 +152,13 @@ else if (IDENTITIES_LEVEL < 2) { if ($_POST['_framed']) { // add a new row to the list - $OUTPUT->command('parent.update_identity_row', $insert_id, Q(trim($save_data['name'] . ' <' . rcube_idn_to_utf8($save_data['email']) .'>')), true); + $OUTPUT->command('parent.update_identity_row', $insert_id, rcube::Q(trim($save_data['name'] . ' <' . rcube_utils::idn_to_utf8($save_data['email']) .'>')), true); } } else { // show error message $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false); - rcmail_overwrite_action('edit-identity'); + $RCMAIL->overwrite_action('edit-identity'); return; } } @@ -172,10 +172,10 @@ if ($default_id) // go to next step if (!empty($_REQUEST['_framed'])) { - rcmail_overwrite_action('edit-identity'); + $RCMAIL->overwrite_action('edit-identity'); } else - rcmail_overwrite_action('identities'); + $RCMAIL->overwrite_action('identities'); /** @@ -185,14 +185,14 @@ function rcmail_wash_html($html) { // Add header with charset spec., washtml cannot work without that $html = '<html><head>' - . '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />' + . '<meta http-equiv="Content-Type" content="text/html; charset='.RCUBE_CHARSET.'" />' . '</head><body>' . $html . '</body></html>'; // clean HTML with washhtml by Frederic Motte $wash_opts = array( 'show_washed' => false, 'allow_remote' => 1, - 'charset' => RCMAIL_CHARSET, + 'charset' => RCUBE_CHARSET, 'html_elements' => array('body', 'link'), 'html_attribs' => array('rel', 'type'), ); @@ -204,7 +204,7 @@ function rcmail_wash_html($html) //$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); diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index bcd05bb85..325c66ae8 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -19,7 +19,7 @@ +-----------------------------------------------------------------------+ */ -$CURR_SECTION = get_input_value('_section', RCUBE_INPUT_POST); +$CURR_SECTION = rcube_utils::get_input_value('_section', rcube_utils::INPUT_POST); $a_user_prefs = array(); @@ -28,14 +28,14 @@ switch ($CURR_SECTION) { case 'general': $a_user_prefs = array( - 'language' => isset($_POST['_language']) ? get_input_value('_language', RCUBE_INPUT_POST) : $CONFIG['language'], - 'timezone' => isset($_POST['_timezone']) ? get_input_value('_timezone', RCUBE_INPUT_POST) : $CONFIG['timezone'], - 'date_format' => isset($_POST['_date_format']) ? get_input_value('_date_format', RCUBE_INPUT_POST) : $CONFIG['date_format'], - 'time_format' => isset($_POST['_time_format']) ? get_input_value('_time_format', RCUBE_INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'), + 'language' => isset($_POST['_language']) ? rcube_utils::get_input_value('_language', rcube_utils::INPUT_POST) : $CONFIG['language'], + 'timezone' => isset($_POST['_timezone']) ? rcube_utils::get_input_value('_timezone', rcube_utils::INPUT_POST) : $CONFIG['timezone'], + 'date_format' => isset($_POST['_date_format']) ? rcube_utils::get_input_value('_date_format', rcube_utils::INPUT_POST) : $CONFIG['date_format'], + 'time_format' => isset($_POST['_time_format']) ? rcube_utils::get_input_value('_time_format', rcube_utils::INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'), 'prettydate' => isset($_POST['_pretty_date']) ? TRUE : FALSE, 'refresh_interval' => isset($_POST['_refresh_interval']) ? intval($_POST['_refresh_interval'])*60 : $CONFIG['refresh_interval'], 'standard_windows' => isset($_POST['_standard_windows']) ? TRUE : FALSE, - 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'], + 'skin' => isset($_POST['_skin']) ? rcube_utils::get_input_value('_skin', rcube_utils::INPUT_POST) : $CONFIG['skin'], ); // compose derived date/time format strings @@ -66,7 +66,7 @@ switch ($CURR_SECTION) 'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE, 'show_images' => isset($_POST['_show_images']) ? intval($_POST['_show_images']) : 0, 'display_next' => isset($_POST['_display_next']) ? TRUE : FALSE, - 'default_charset' => get_input_value('_default_charset', RCUBE_INPUT_POST), + 'default_charset' => rcube_utils::get_input_value('_default_charset', rcube_utils::INPUT_POST), ); break; @@ -88,8 +88,8 @@ switch ($CURR_SECTION) 'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1, 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0, 'strip_existing_sig' => isset($_POST['_strip_existing_sig']), - 'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST), - 'default_font_size' => get_input_value('_default_font_size', RCUBE_INPUT_POST), + 'default_font' => rcube_utils::get_input_value('_default_font', rcube_utils::INPUT_POST), + 'default_font_size' => rcube_utils::get_input_value('_default_font_size', rcube_utils::INPUT_POST), 'reply_all_mode' => intval($_POST['_reply_all_mode']), 'forward_attachment' => !empty($_POST['_forward_attachment']), ); @@ -98,10 +98,10 @@ switch ($CURR_SECTION) case 'addressbook': $a_user_prefs = array( - 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true), + 'default_addressbook' => rcube_utils::get_input_value('_default_addressbook', rcube_utils::INPUT_POST, true), 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE, - 'addressbook_sort_col' => get_input_value('_addressbook_sort_col', RCUBE_INPUT_POST), - 'addressbook_name_listing' => intval(get_input_value('_addressbook_name_listing', RCUBE_INPUT_POST)), + 'addressbook_sort_col' => rcube_utils::get_input_value('_addressbook_sort_col', rcube_utils::INPUT_POST), + 'addressbook_name_listing' => intval(rcube_utils::get_input_value('_addressbook_name_listing', rcube_utils::INPUT_POST)), 'addressbook_pagesize' => is_numeric($_POST['_addressbook_pagesize']) ? max(2, intval($_POST['_addressbook_pagesize'])) : $CONFIG['addressbook_pagesize'], ); @@ -124,10 +124,10 @@ switch ($CURR_SECTION) $a_user_prefs = array( 'show_real_foldernames' => isset($_POST['_show_real_foldernames']) ? TRUE : FALSE, - 'drafts_mbox' => get_input_value('_drafts_mbox', RCUBE_INPUT_POST, true), - 'sent_mbox' => get_input_value('_sent_mbox', RCUBE_INPUT_POST, true), - 'junk_mbox' => get_input_value('_junk_mbox', RCUBE_INPUT_POST, true), - 'trash_mbox' => get_input_value('_trash_mbox', RCUBE_INPUT_POST, true), + 'drafts_mbox' => rcube_utils::get_input_value('_drafts_mbox', rcube_utils::INPUT_POST, true), + 'sent_mbox' => rcube_utils::get_input_value('_sent_mbox', rcube_utils::INPUT_POST, true), + 'junk_mbox' => rcube_utils::get_input_value('_junk_mbox', rcube_utils::INPUT_POST, true), + 'trash_mbox' => rcube_utils::get_input_value('_trash_mbox', rcube_utils::INPUT_POST, true), ); break; @@ -221,5 +221,4 @@ else $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); // display the form again -rcmail_overwrite_action('edit-prefs'); - +$RCMAIL->overwrite_action('edit-prefs'); |