| 1 |
<?php |
| 2 |
// Format the address according to RFC822. |
| 3 |
// FIXME: should not rely on the imap extension. |
| 4 |
|
| 5 |
// Build the columns to display |
| 6 |
$show = array(); |
| 7 |
$address = ''; |
| 8 |
foreach ($GLOBALS['columns'] as $column) { |
| 9 |
if ($ob->hasValue($column)) { |
| 10 |
$show[$column] = $ob->getValue($column); |
| 11 |
if ($GLOBALS['attributes'][$column]['type'] == 'email') { |
| 12 |
$mailbox_host = explode('@', $show[$column]); |
| 13 |
if (!isset($mailbox_host[1])) { |
| 14 |
$mailbox_host[1] = ''; |
| 15 |
} |
| 16 |
$name = $ob->getValue('name'); |
| 17 |
$address = imap_rfc822_write_address($mailbox_host[0], $mailbox_host[1], $name); |
| 18 |
|
| 19 |
// Get rid of the trailing @ (when no host is included in the email address). |
| 20 |
$address = str_replace('@>', '>', $address); |
| 21 |
|
| 22 |
$show[$column] = '<a href="' . $GLOBALS['registry']->link('mail/compose', array('to' => addslashes($address))) . '">' . $show[$column] . '</a>'; |
| 23 |
} |
| 24 |
} else { |
| 25 |
$show[$column] = ' '; |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
if ($this->list->isFresh($ob)) { |
| 30 |
$class = 'listitem'; |
| 31 |
$hi = $css['.listitem-hi']['background-color']; |
| 32 |
$lo = $css['.listitem']['background-color']; |
| 33 |
} else { |
| 34 |
$class = 'oldlistitem'; |
| 35 |
$hi = $css['.oldlistitem-hi']['background-color']; |
| 36 |
$lo = $css['.oldlistitem']['background-color']; |
| 37 |
} |
| 38 |
?><tr class="<?= $class ?>" onmouseover="javascript:style.backgroundColor='<?= $hi ?>';" onmouseout="javascript:style.backgroundColor='<?= $lo ?>';"> |
| 39 |
<td> |
| 40 |
<?php if ($ob->hasValue('__key')): ?><?= Horde::link(Horde::applicationUrl('displayobject.php?source=' . urlencode($GLOBALS['source']) . '&key=' . urlencode($ob->getValue('__key'))), sprintf(_("Edit '%s'"), $ob->getValue('name'))); ?><?php endif; ?><?= $ob->hasValue('name') ? $ob->getValue('name') : _("[Edit]") ?><?php if ($ob->hasValue('__key')): ?></a><?php endif; ?> |
| 41 |
</td> |
| 42 |
<?php foreach ($show as $field): ?> |
| 43 |
<td> |
| 44 |
<?= $field ?> |
| 45 |
</td> |
| 46 |
<?php endforeach; ?> |
| 47 |
</tr> |