/[cvs]/nfo/patches/horde/turba/actions-in-listview/row.inc.patched
ViewVC logotype

Annotation of /nfo/patches/horde/turba/actions-in-listview/row.inc.patched

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Mon Oct 21 11:20:16 2002 UTC (21 years, 10 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
initial checkin

1 joko 1.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] = '&nbsp;';
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     <?
48     if ($ob->hasValue('__key') && $ob->hasValue('name')) {
49     $urlparam = 'source=' . urlencode($GLOBALS['source']) . '&key=' . urlencode($ob->getValue('__key'));
50     ?>
51     <td>
52     <?= Horde::link(Horde::applicationUrl('editobject.php?' . $urlparam),
53     sprintf(_("Edit '%s'"), $ob->getValue('name'))) . _("[Edit]") . "</a>"; ?>
54     </td>
55     <td>
56     <?= Horde::link(Horde::applicationUrl('deleteobject.php?' . $urlparam),
57     sprintf(_("Delete '%s'"), $ob->getValue('name'))) . _("[Delete]") . "</a>"; ?>
58     </td>
59     <? } ?>
60     </tr>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed