From 6b2b2eca5fa48720c4e5b31b9aae200a185dfc0e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 22 Dec 2013 14:12:15 +0100 Subject: Remove deprecated functions (these listed in bc.php file) usage --- program/steps/settings/about.inc | 24 +-- program/steps/settings/delete_identity.inc | 10 +- program/steps/settings/edit_folder.inc | 86 ++++----- program/steps/settings/edit_identity.inc | 30 ++-- program/steps/settings/edit_prefs.inc | 4 +- program/steps/settings/edit_response.inc | 14 +- program/steps/settings/folders.inc | 63 ++++--- program/steps/settings/func.inc | 278 ++++++++++++++--------------- program/steps/settings/identities.inc | 2 +- program/steps/settings/responses.inc | 16 +- program/steps/settings/save_folder.inc | 28 +-- program/steps/settings/save_identity.inc | 38 ++-- program/steps/settings/save_prefs.inc | 35 ++-- 13 files changed, 313 insertions(+), 315 deletions(-) (limited to 'program/steps/settings') 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