Always show address book name if multiple books are configured; fix styling

This commit is contained in:
thomascube
2011-07-26 17:21:26 +00:00
parent 210438a6be
commit da89cf2937
6 changed files with 23 additions and 12 deletions

View File

@@ -54,7 +54,7 @@ else {
}
$SOURCE_ID = $source;
rcmail_set_sourcename($CONTACTS);
function rcmail_get_edit_record()
{

View File

@@ -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)
{

View File

@@ -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') {