diff options
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r-- | program/steps/addressbook/func.inc | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 3a0508025..fded9a819 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -63,12 +63,6 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) { // add list of address sources to client env $js_list = $RCMAIL->get_address_sources(); - $source = get_input_value('_source', RCUBE_INPUT_GPC); - - // use first directory by default - if (!strlen($source) || !isset($js_list[$source])) - $source = $js_list[key($js_list)]['id']; - // count all/writeable sources $writeable = 0; $count = 0; @@ -93,8 +87,16 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) { $_SESSION['addressbooks_count'] = $count; $_SESSION['addressbooks_count_writeable'] = $writeable; - if (!strlen($source)) - $source = strval(key($js_list)); + // select address book + $source = get_input_value('_source', RCUBE_INPUT_GPC); + + // use first directory by default + if (!strlen($source) || !isset($js_list[$source])) { + $source = $RCMAIL->config->get('default_addressbook'); + if (!strlen($source) || !isset($js_list[$source])) { + $source = strval(key($js_list)); + } + } $CONTACTS = rcmail_contact_source($source, true); } @@ -158,17 +160,6 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false) } -function rcmail_default_source($writable=false) -{ - global $RCMAIL; - - // get list of address sources - $first = reset($RCMAIL->get_address_sources($writable)); - - // use first directory by default - return $first['id']; -} - function rcmail_set_sourcename($abook) { global $OUTPUT; @@ -367,12 +358,7 @@ function rcmail_contact_frame($attrib) if (!$attrib['id']) $attrib['id'] = 'rcmcontactframe'; - $attrib['name'] = $attrib['id']; - - $OUTPUT->set_env('contentframe', $attrib['name']); - $OUTPUT->set_env('blankpage', $attrib['src'] ? $OUTPUT->abs_url($attrib['src']) : 'program/resources/blank.gif'); - - return html::iframe($attrib); + return $OUTPUT->frame($attrib, true); } |