4 +-----------------------------------------------------------------------+
5 | program/steps/addressbook/show.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Show contact details |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com> |
16 +-----------------------------------------------------------------------+
18 $Id: show.inc 543 2007-04-28 18:07:12Z thomasb $
23 // read contact record
24 if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true)))
25 $OUTPUT->set_env('cid', $record['ID']);
28 function rcmail_contact_details($attrib)
30 global $CONTACTS, $OUTPUT;
32 // check if we have a valid result
33 if (!(($result = $CONTACTS->get_result()) && ($record = $result->first())))
35 $OUTPUT->show_message('contactnotfound');
39 // a specific part is requested
41 return Q($record[$attrib['part']]);
43 // return the complete address record as table
46 $a_show_cols = array('name', 'firstname', 'surname', 'email');
47 foreach ($a_show_cols as $col)
49 if ($col=='email' && !empty($record[$col]))
51 '<a href="#compose" onclick="%s.command(\'compose\', \'%s\')" title="%s">%s</a>',
54 rcube_label('composeto'),
57 $value = Q($record[$col]);
59 $out .= sprintf("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n",
70 //$OUTPUT->framed = $_framed;
71 $OUTPUT->add_handler('contactdetails', 'rcmail_contact_details');
72 $OUTPUT->send('showcontact');