X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=program%2Fsteps%2Fsettings%2Ffunc.inc;h=8df3ce8d3300ad9c5d83f6beab18d6791cd150e9;hb=76507f7c63a660742e76889ad6e3919f3dde3bb0;hp=33286dffc34a9390dd7c99c394b3867b64af1652;hpb=3adad46e27086084a8b28a32fc4fbc953dbfef6c;p=roundcube.git diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 33286df..8df3ce8 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -4,8 +4,8 @@ +-----------------------------------------------------------------------+ | program/steps/settings/func.inc | | | - | This file is part of the RoundCube Webmail client | - | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland | + | This file is part of the Roundcube Webmail client | + | Copyright (C) 2005-2007, The Roundcube Dev Team | | Licensed under the GNU GPL | | | | PURPOSE: | @@ -15,46 +15,152 @@ | Author: Thomas Bruederli | +-----------------------------------------------------------------------+ - $Id: func.inc 2164 2008-12-16 19:05:50Z thomasb $ + $Id: func.inc 5481 2011-11-24 07:53:00Z alec $ */ if (!$OUTPUT->ajax_call) $OUTPUT->set_pagetitle(rcube_label('preferences')); -function rcmail_user_prefs_form($attrib) + +// similar function as /steps/settings/identities.inc::rcmail_identity_frame() +function rcmail_preferences_frame($attrib) +{ + global $OUTPUT; + + if (!$attrib['id']) + $attrib['id'] = 'rcmprefsframe'; + + $attrib['name'] = $attrib['id']; + + $OUTPUT->set_env('contentframe', $attrib['name']); + $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/blank.gif'); + + return html::iframe($attrib); +} + + +function rcmail_sections_list($attrib) { global $RCMAIL; - $no_override = array_flip($RCMAIL->config->get('dont_override', array())); - $blocks = $attrib['parts'] ? preg_split('/[\s,;]+/', strip_quotes($attrib['parts'])) : array('general','mailbox','compose','mailview','folders','server'); - - // add some labels to client - $RCMAIL->output->add_label('nopagesizewarning'); - - list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs'); - unset($attrib['form']); - - $out = $form_start; - - foreach ($blocks as $part) - $out .= rcmail_user_prefs_block($part, $no_override, $attrib); - - return $out . $form_end; + // add id to message list table if not specified + if (!strlen($attrib['id'])) + $attrib['id'] = 'rcmsectionslist'; + + list($list, $cols) = rcmail_user_prefs(); + + // create XHTML table + $out = rcube_table_output($attrib, $list, $cols, 'id'); + + // set client env + $RCMAIL->output->add_gui_object('sectionslist', $attrib['id']); + $RCMAIL->output->include_script('list.js'); + + return $out; } -function rcmail_user_prefs_block($part, $no_override, $attrib) + +function rcmail_identities_list($attrib) +{ + global $OUTPUT, $USER, $RCMAIL; + + // add id to message list table if not specified + if (!strlen($attrib['id'])) + $attrib['id'] = 'rcmIdentitiesList'; + + // get identities list and define 'mail' column + $list = $USER->list_identities(); + foreach ($list as $idx => $row) + $list[$idx]['mail'] = trim($row['name'] . ' <' . rcube_idn_to_utf8($row['email']) .'>'); + + // get all identites from DB and define list of cols to be displayed + $plugin = $RCMAIL->plugins->exec_hook('identities_list', array( + 'list' => $list, + 'cols' => array('mail'))); + + // @TODO: use