summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/addressbook/func.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-02 15:27:46 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-02 15:27:46 +0000
commit530c964d88c744f36a67e0ccce53b23a6735c6b4 (patch)
tree8c004899b74ca3442eb11f5c64fd9704ae2e9321 /roundcubemail/program/steps/addressbook/func.inc
parenteccfeed034824cd659a5a175ba4246718f3ba03c (diff)
- Added addressbook source selector in contact create form
git-svn-id: https://svn.roundcube.net/trunk@4901 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/addressbook/func.inc')
-rw-r--r--roundcubemail/program/steps/addressbook/func.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc
index d0be00dbb..4c930c80b 100644
--- a/roundcubemail/program/steps/addressbook/func.inc
+++ b/roundcubemail/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);
}