From f1154163b0a9efb21d722bc658352739040ffd61 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 28 Apr 2007 14:07:12 -0400
Subject: [PATCH] Merged branch devel-addressbook from r443 back to trunk

---
 program/steps/settings/func.inc |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index e51f683..91212e1 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -5,7 +5,7 @@
  | program/steps/settings/func.inc                                       |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -26,7 +26,7 @@
                           $_SESSION['user_id']);
                                  
 if ($USER_DATA = $DB->fetch_assoc($sql_result))
-  $PAGE_TITLE = sprintf('%s %s@%s', rcube_label('settingsfor'), $USER_DATA['username'], $USER_DATA['mail_host']);
+  $OUTPUT->set_pagetitle(sprintf('%s %s@%s', rcube_label('settingsfor'), $USER_DATA['username'], $USER_DATA['mail_host']));
 
 
 
@@ -202,7 +202,7 @@
 
 function rcmail_identities_list($attrib)
   {
-  global $DB, $CONFIG, $OUTPUT, $JS_OBJECT_NAME;
+  global $DB, $CONFIG, $OUTPUT;
 
 
   // get contacts from DB
@@ -224,8 +224,7 @@
   $out = rcube_table_output($attrib, $sql_result, $a_show_cols, 'identity_id');
   
   // set client env
-  $javascript = sprintf("%s.gui_object('identitieslist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']);
-  $OUTPUT->add_script($javascript);    
+  $OUTPUT->add_gui_object('identitieslist', $attrib['id']);
 
   return $out;
   }
@@ -235,7 +234,7 @@
 // similar function as in /steps/addressbook/edit.inc
 function get_form_tags($attrib, $action, $add_hidden=array())
   {
-  global $OUTPUT, $JS_OBJECT_NAME, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
+  global $OUTPUT, $EDIT_FORM, $SESS_HIDDEN_FIELD;  
 
   $form_start = '';
   if (!strlen($EDIT_FORM))
@@ -258,7 +257,7 @@
   $form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
 
   if (!strlen($EDIT_FORM))
-    $OUTPUT->add_script("$JS_OBJECT_NAME.gui_object('editform', '$form_name');");
+    $OUTPUT->add_gui_object('editform', $form_name);
   
   $EDIT_FORM = $form_name;
 
@@ -266,4 +265,11 @@
   }
 
 
+// register UI objects
+$OUTPUT->add_handlers(array(
+  'userprefs' => 'rcmail_user_prefs_form',
+  'itentitieslist' => 'rcmail_identities_list'
+));
+
+
 ?>
\ No newline at end of file

--
Gitblit v1.9.1