4 +-----------------------------------------------------------------------+
5 | program/steps/settings/edit_prefs.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Provide functionality for user's settings & preferences |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: func.inc 2822 2009-07-31 09:07:54Z alec $
22 if (!$OUTPUT->ajax_call)
23 $OUTPUT->set_pagetitle(rcube_label('preferences'));
26 $CURR_SECTION = get_input_value('_section', RCUBE_INPUT_GPC);
27 list($SECTIONS,) = rcmail_user_prefs($CURR_SECTION);
29 function rcmail_user_prefs_form($attrib)
31 global $RCMAIL, $CURR_SECTION, $SECTIONS;
33 // add some labels to client
34 $RCMAIL->output->add_label('nopagesizewarning');
36 unset($attrib['form']);
38 list($form_start, $form_end) = get_form_tags($attrib, 'save-prefs', null,
39 array('name' => '_section', 'value' => $CURR_SECTION));
43 foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $idx => $block) {
44 if ($block['options']) {
45 $table = new html_table(array('cols' => 2));
47 foreach ($block['options'] as $option) {
48 if ($option['advanced'])
49 $table->set_row_attribs('advanced');
51 $table->add('title', $option['title']);
52 $table->add(null, $option['content']);
55 $out .= html::tag('fieldset', null, html::tag('legend', null, $block['name']) . $table->show($attrib));
59 return $out . $form_end;
62 function rcmail_prefs_section_name()
64 global $SECTIONS, $CURR_SECTION;
66 return $SECTIONS[$CURR_SECTION]['section'];
70 // register UI objects
71 $OUTPUT->add_handlers(array(
72 'userprefs' => 'rcmail_user_prefs_form',
73 'sectionname' => 'rcmail_prefs_section_name',
76 $OUTPUT->send('settingsedit');