summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-26 17:21:26 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-26 17:21:26 +0000
commit6b8edbdeeefe17fb50f337f61b9af35beeac74a0 (patch)
treed81d316ebda00af93cd7a05aa76940405acf63f9 /roundcubemail/program
parent263862c0d75dd30c6672d5b40719b54d88211e63 (diff)
Always show address book name if multiple books are configured; fix styling
git-svn-id: https://svn.roundcube.net/trunk@4969 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/steps/addressbook/edit.inc2
-rw-r--r--roundcubemail/program/steps/addressbook/func.inc14
-rw-r--r--roundcubemail/program/steps/addressbook/show.inc8
3 files changed, 16 insertions, 8 deletions
diff --git a/roundcubemail/program/steps/addressbook/edit.inc b/roundcubemail/program/steps/addressbook/edit.inc
index f9d74e4fb..69fcba93c 100644
--- a/roundcubemail/program/steps/addressbook/edit.inc
+++ b/roundcubemail/program/steps/addressbook/edit.inc
@@ -54,7 +54,7 @@ else {
}
$SOURCE_ID = $source;
-
+rcmail_set_sourcename($CONTACTS);
function rcmail_get_edit_record()
{
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc
index 6b3ebad08..0a5a02287 100644
--- a/roundcubemail/program/steps/addressbook/func.inc
+++ b/roundcubemail/program/steps/addressbook/func.inc
@@ -160,6 +160,20 @@ function rcmail_default_source($writable=false)
return $list[key($list)]['id'];
}
+function rcmail_set_sourcename($abook)
+{
+ global $OUTPUT;
+
+ // get address book name (for display)
+ if ($abook && $_SESSION['addressbooks_count'] > 1) {
+ $name = $abook->get_name();
+ if (!$name && $source == 0) {
+ $name = rcube_label('personaladrbook');
+ }
+ $OUTPUT->set_env('sourcename', $name);
+ }
+}
+
function rcmail_directory_list($attrib)
{
diff --git a/roundcubemail/program/steps/addressbook/show.inc b/roundcubemail/program/steps/addressbook/show.inc
index fc983e60b..729cb3487 100644
--- a/roundcubemail/program/steps/addressbook/show.inc
+++ b/roundcubemail/program/steps/addressbook/show.inc
@@ -34,13 +34,7 @@ if ($cid && ($record = $CONTACTS->get_record($cid, true))) {
}
// get address book name (for display)
-if ($_SESSION['addressbooks_count'] > 1) {
- $name = $CONTACTS->get_name();
- if (!$name && $source == 0) {
- $name = rcube_label('personaladrbook');
- }
- $OUTPUT->set_env('sourcename', $name);
-}
+rcmail_set_sourcename($CONTACTS);
// return raw photo of the given contact
if ($RCMAIL->action == 'photo') {