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

release-0.6
thomascube 14 years ago
parent 210438a6be
commit da89cf2937

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

@ -160,6 +160,20 @@ function rcmail_default_source($writable=false)
return $list[key($list)]['id']; 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) function rcmail_directory_list($attrib)
{ {

@ -34,13 +34,7 @@ if ($cid && ($record = $CONTACTS->get_record($cid, true))) {
} }
// get address book name (for display) // get address book name (for display)
if ($_SESSION['addressbooks_count'] > 1) { rcmail_set_sourcename($CONTACTS);
$name = $CONTACTS->get_name();
if (!$name && $source == 0) {
$name = rcube_label('personaladrbook');
}
$OUTPUT->set_env('sourcename', $name);
}
// return raw photo of the given contact // return raw photo of the given contact
if ($RCMAIL->action == 'photo') { if ($RCMAIL->action == 'photo') {

@ -390,5 +390,5 @@ fieldset.contactfieldgroup legend
{ {
color: #666; color: #666;
font-size: 10px; font-size: 10px;
margin-left: 2px; margin: -5px 0 8px 2px;
} }

@ -10,9 +10,9 @@
<div id="contact-title" class="boxtitle"><roundcube:label name="addcontact" /></div> <div id="contact-title" class="boxtitle"><roundcube:label name="addcontact" /></div>
<div id="contact-details" class="boxcontent"> <div id="contact-details" class="boxcontent">
<form name="editform" method="post" action="./"> <form name="editform" method="post" action="./">
<div id="sourcename" style="height: 20px"> <roundcube:if condition="strlen(env:sourcename)" />
<roundcube:label name="addressbook" />: <roundcube:object name="sourceselector" class="hint" id="sourceselect" /> <div id="sourcename"><roundcube:label name="addressbook" />: <roundcube:object name="sourceselector" class="hint" id="sourceselect" /></div>
</div> <roundcube:endif />
<div id="contactphoto"> <div id="contactphoto">
<roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" /> <roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" />
<div class="formlinks"> <div class="formlinks">

@ -10,6 +10,9 @@
<div id="contact-title" class="boxtitle"><roundcube:label name="editcontact" /></div> <div id="contact-title" class="boxtitle"><roundcube:label name="editcontact" /></div>
<div id="contact-details" class="boxcontent"> <div id="contact-details" class="boxcontent">
<form name="editform" method="post" action="./"> <form name="editform" method="post" action="./">
<roundcube:if condition="strlen(env:sourcename)" />
<div id="sourcename"><roundcube:label name="addressbook" />: <roundcube:var name="env:sourcename" /></div>
<roundcube:endif />
<div id="contactphoto"> <div id="contactphoto">
<roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" /> <roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" />
<div class="formlinks"> <div class="formlinks">

Loading…
Cancel
Save