diff options
author | alecpl <alec@alec.pl> | 2011-07-02 15:27:46 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-07-02 15:27:46 +0000 |
commit | 5b3ac324154b0d29e6e14db2b06fbc3636a3e708 (patch) | |
tree | 94fdc54541279065b01dd7f61c061d3e0764bd2e /program/steps/addressbook/func.inc | |
parent | 4b1d5d6e384fc5bddff8ee1c7cb35b8ea9c84bf3 (diff) |
- Added addressbook source selector in contact create form
Diffstat (limited to 'program/steps/addressbook/func.inc')
-rw-r--r-- | program/steps/addressbook/func.inc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index d0be00dbb..4c930c80b 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -68,20 +68,22 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) { if (!strlen($source) || !isset($js_list[$source])) $source = $js_list[key($js_list)]['id']; - // find writeable source + // count writeable sources + $writeable = 0; foreach ($js_list as $s) { if (!$s['readonly']) { - $OUTPUT->set_env('writable_source', $s['id']); - break; + $writeable++; } } $search_mods = $RCMAIL->config->get('addressbook_search_mods', $SEARCH_MODS_DEFAULT); $OUTPUT->set_env('search_mods', $search_mods); $OUTPUT->set_env('address_sources', $js_list); + $OUTPUT->set_env('writable_source', $writeable); $OUTPUT->set_pagetitle(rcube_label('addressbook')); $_SESSION['addressbooks_count'] = count($js_list); + $_SESSION['addressbooks_count_writeable'] = $writeable; $CONTACTS = rcmail_contact_source($source, true); } |