summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-04-30 08:21:42 +0000
committerthomascube <thomas@roundcube.net>2008-04-30 08:21:42 +0000
commit197601ef5fa2e6aaabfb6e0baaf56179f7cc1ee3 (patch)
tree464b77acd299fa37a753e384b5bc14bda0cd16fa /program/steps/settings
parent0dfae004d84f428f1af1884282d24c32d6fc3173 (diff)
Next step: introduce the application class 'rcmail' and get rid of some global vars
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/edit_identity.inc10
-rw-r--r--program/steps/settings/func.inc15
-rw-r--r--program/steps/settings/manage_folders.inc12
-rw-r--r--program/steps/settings/save_identity.inc2
-rw-r--r--program/steps/settings/save_prefs.inc5
5 files changed, 20 insertions, 24 deletions
diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc
index 2dec5b258..0f849f172 100644
--- a/program/steps/settings/edit_identity.inc
+++ b/program/steps/settings/edit_identity.inc
@@ -19,7 +19,7 @@
*/
-if (($_GET['_iid'] || $_POST['_iid']) && $_action=='edit-identity')
+if (($_GET['_iid'] || $_POST['_iid']) && $RCMAIL->action=='edit-identity')
{
$IDENTITY_RECORD = $USER->get_identity(get_input_value('_iid', RCUBE_INPUT_GPC));
@@ -37,9 +37,9 @@ $OUTPUT->include_script('list.js');
function rcube_identity_form($attrib)
{
- global $IDENTITY_RECORD, $OUTPUT;
+ global $IDENTITY_RECORD, $RCMAIL, $OUTPUT;
- $tinylang = substr($_SESSION['user_lang'], 0, 2);
+ $tinylang = substr($_SESSION['language'], 0, 2);
if (!file_exists('program/js/tiny_mce/langs/'.$tinylang.'.js'))
{
$tinylang = 'en';
@@ -58,7 +58,7 @@ function rcube_identity_form($attrib)
"theme_advanced_buttons2 : 'link,unlink,code,forecolor,fontselect,fontsizeselect'," .
"theme_advanced_buttons3 : '' });");
- if (!$IDENTITY_RECORD && $GLOBALS['_action']!='add-identity')
+ if (!$IDENTITY_RECORD && $RCMAIL->action != 'add-identity')
return rcube_label('notfound');
// add some labels to client
@@ -138,7 +138,7 @@ function rcube_identity_form($attrib)
$OUTPUT->add_handler('identityform', 'rcube_identity_form');
-if ($_action=='add-identity' && template_exists('addidentity'))
+if ($RCMAIL->action=='add-identity' && template_exists('addidentity'))
$OUTPUT->send('addidentity');
$OUTPUT->send('editidentity');
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index bf889a5dc..09ae6cf06 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -27,7 +27,7 @@ if ($USER->ID)
function rcmail_user_prefs_form($attrib)
{
- global $DB, $CONFIG, $sess_user_lang;
+ global $DB, $CONFIG;
$no_override = is_array($CONFIG['dont_override']) ? array_flip($CONFIG['dont_override']) : array();
@@ -56,7 +56,7 @@ function rcmail_user_prefs_form($attrib)
$out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
$field_id,
Q(rcube_label('language')),
- $select_lang->show($sess_user_lang));
+ $select_lang->show($_SESSION['language']));
}
@@ -251,19 +251,18 @@ function rcmail_identities_list($attrib)
// similar function as in /steps/addressbook/edit.inc
function get_form_tags($attrib, $action, $add_hidden=array())
{
- global $OUTPUT, $EDIT_FORM, $SESS_HIDDEN_FIELD;
+ global $EDIT_FORM, $RCMAIL;
$form_start = '';
if (!strlen($EDIT_FORM))
{
- $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task']));
+ $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task));
$hiddenfields->add(array('name' => '_action', 'value' => $action));
if ($add_hidden)
$hiddenfields->add($add_hidden);
- $form_start = !strlen($attrib['form']) ? '<form name="form" action="./" method="post">' : '';
- $form_start .= "\n$SESS_HIDDEN_FIELD\n";
+ $form_start = !strlen($attrib['form']) ? $RCMAIL->output->form_tag(array('name' => "form", 'method' => "post")) : '';
$form_start .= $hiddenfields->show();
}
@@ -271,11 +270,11 @@ function get_form_tags($attrib, $action, $add_hidden=array())
$form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
if (!strlen($EDIT_FORM))
- $OUTPUT->add_gui_object('editform', $form_name);
+ $RCMAIL->output->add_gui_object('editform', $form_name);
$EDIT_FORM = $form_name;
- return array($form_start, $form_end);
+ return array($form_start, $form_end);
}
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index a00ff9fd1..49f9491c5 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -20,10 +20,10 @@
*/
// init IMAP connection
-rcmail_imap_init(TRUE);
+$RCMAIL->imap_init(true);
// subscribe to one or more mailboxes
-if ($_action=='subscribe')
+if ($RCMAIL->action=='subscribe')
{
if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))
$IMAP->subscribe(array($mbox));
@@ -33,7 +33,7 @@ if ($_action=='subscribe')
}
// unsubscribe one or more mailboxes
-else if ($_action=='unsubscribe')
+else if ($RCMAIL->action=='unsubscribe')
{
if ($mbox = get_input_value('_mbox', RCUBE_INPUT_POST))
$IMAP->unsubscribe(array($mbox));
@@ -43,7 +43,7 @@ else if ($_action=='unsubscribe')
}
// create a new mailbox
-else if ($_action=='create-folder')
+else if ($RCMAIL->action=='create-folder')
{
if (!empty($_POST['_name']))
$create = $IMAP->create_mailbox(trim(get_input_value('_name', RCUBE_INPUT_POST, FALSE, 'UTF-7')), TRUE);
@@ -62,7 +62,7 @@ else if ($_action=='create-folder')
}
// rename a mailbox
-else if ($_action=='rename-folder')
+else if ($RCMAIL->action=='rename-folder')
{
if (!empty($_POST['_folder_oldname']) && !empty($_POST['_folder_newname']))
$rename = $IMAP->rename_mailbox(($oldname = get_input_value('_folder_oldname', RCUBE_INPUT_POST)), trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, FALSE, 'UTF-7')));
@@ -97,7 +97,7 @@ else if ($_action=='rename-folder')
}
// delete an existing IMAP mailbox
-else if ($_action=='delete-folder')
+else if ($RCMAIL->action=='delete-folder')
{
$a_mboxes = array_merge($IMAP->list_mailboxes(), $IMAP->list_unsubscribed());
$delimiter = $IMAP->get_hierarchy_delimiter();
diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc
index 2c2a55e49..4a7b4fb22 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -107,6 +107,6 @@ if ($default_id)
$USER->set_default($default_id);
// go to next step
-rcmail_overwrite_action($_framed ? 'edit-identity' : 'identities');
+rcmail_overwrite_action($OUTPUT->action ? 'edit-identity' : 'identities');
?> \ No newline at end of file
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 9ee30a616..8025ad8ed 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -39,10 +39,7 @@ foreach ((array)$CONFIG['dont_override'] as $p)
// switch UI language
if (isset($_POST['_language']))
- {
- $sess_user_lang = $_SESSION['user_lang'] = get_input_value('_language', RCUBE_INPUT_POST);
- rcmail_set_locale($sess_user_lang);
- }
+ $_SESSION['language'] = get_input_value('_language', RCUBE_INPUT_POST);
// force min size
if ($a_user_prefs['pagesize'] < 1)