|
+-----------------------------------------------------------------------+
$Id$
*/
if ($USER->ID)
$OUTPUT->set_pagetitle(rcube_label('settingsfor') . " ". $USER->get_username());
function rcmail_user_prefs_form($attrib)
{
global $DB, $CONFIG, $sess_user_lang;
$no_override = is_array($CONFIG['dont_override']) ? array_flip($CONFIG['dont_override']) : array();
// add some labels to client
rcube_add_label('nopagesizewarning');
list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs');
unset($attrib['form']);
// allow the following attributes to be added to the
tag
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));
// return the complete edit form as tables
$out = "$form_start\n$form_end";
return $out;
}
function rcmail_identities_list($attrib)
{
global $OUTPUT, $USER;
// add id to message list table if not specified
if (!strlen($attrib['id']))
$attrib['id'] = 'rcmIdentitiesList';
// define list of cols to be displayed
$a_show_cols = array('name', 'email', 'organization', 'reply-to');
// create XHTML table
$out = rcube_table_output($attrib, $USER->list_identities(), $a_show_cols, 'identity_id');
// set client env
$OUTPUT->add_gui_object('identitieslist', $attrib['id']);
return $out;
}
// similar function as in /steps/addressbook/edit.inc
function get_form_tags($attrib, $action, $add_hidden=array())
{
global $OUTPUT, $EDIT_FORM, $SESS_HIDDEN_FIELD;
$form_start = '';
if (!strlen($EDIT_FORM))
{
$hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $GLOBALS['_task']));
$hiddenfields->add(array('name' => '_action', 'value' => $action));
if ($add_hidden)
$hiddenfields->add($add_hidden);
if ($_GET['_framed'] || $_POST['_framed'])
$hiddenfields->add(array('name' => '_framed', 'value' => 1));
$form_start = !strlen($attrib['form']) ? '' : '';
$form_name = strlen($attrib['form']) ? $attrib['form'] : 'form';
if (!strlen($EDIT_FORM))
$OUTPUT->add_gui_object('editform', $form_name);
$EDIT_FORM = $form_name;
return array($form_start, $form_end);
}
// register UI objects
$OUTPUT->add_handlers(array(
'userprefs' => 'rcmail_user_prefs_form',
'identitieslist' => 'rcmail_identities_list',
'itentitieslist' => 'rcmail_identities_list' // keep this for backward compatibility
));
?>