summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/steps/addressbook/edit.inc2
-rw-r--r--program/steps/addressbook/func.inc14
-rw-r--r--program/steps/addressbook/show.inc8
-rw-r--r--skins/default/addressbook.css2
-rw-r--r--skins/default/templates/contactadd.html6
-rw-r--r--skins/default/templates/contactedit.html3
6 files changed, 23 insertions, 12 deletions
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index f9d74e4fb..69fcba93c 100644
--- a/program/steps/addressbook/edit.inc
+++ b/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/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 6b3ebad08..0a5a02287 100644
--- a/program/steps/addressbook/func.inc
+++ b/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/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc
index fc983e60b..729cb3487 100644
--- a/program/steps/addressbook/show.inc
+++ b/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') {
diff --git a/skins/default/addressbook.css b/skins/default/addressbook.css
index 63c60c08a..69b913e84 100644
--- a/skins/default/addressbook.css
+++ b/skins/default/addressbook.css
@@ -390,5 +390,5 @@ fieldset.contactfieldgroup legend
{
color: #666;
font-size: 10px;
- margin-left: 2px;
+ margin: -5px 0 8px 2px;
}
diff --git a/skins/default/templates/contactadd.html b/skins/default/templates/contactadd.html
index 305940afd..67b7bcd6e 100644
--- a/skins/default/templates/contactadd.html
+++ b/skins/default/templates/contactadd.html
@@ -10,9 +10,9 @@
<div id="contact-title" class="boxtitle"><roundcube:label name="addcontact" /></div>
<div id="contact-details" class="boxcontent">
<form name="editform" method="post" action="./">
- <div id="sourcename" style="height: 20px">
- <roundcube:label name="addressbook" />: <roundcube:object name="sourceselector" class="hint" id="sourceselect" />
- </div>
+ <roundcube:if condition="strlen(env:sourcename)" />
+ <div id="sourcename"><roundcube:label name="addressbook" />: <roundcube:object name="sourceselector" class="hint" id="sourceselect" /></div>
+ <roundcube:endif />
<div id="contactphoto">
<roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" />
<div class="formlinks">
diff --git a/skins/default/templates/contactedit.html b/skins/default/templates/contactedit.html
index 681201caa..77e466141 100644
--- a/skins/default/templates/contactedit.html
+++ b/skins/default/templates/contactedit.html
@@ -10,6 +10,9 @@
<div id="contact-title" class="boxtitle"><roundcube:label name="editcontact" /></div>
<div id="contact-details" class="boxcontent">
<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">
<roundcube:object name="contactphoto" id="contactpic" placeholder="/images/contactpic.png" />
<div class="formlinks">