Changeset 1615 in subversion for trunk/roundcubemail/program/steps/addressbook/show.inc
- Timestamp:
- Jul 29, 2008 8:32:19 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/addressbook/show.inc
r543 r1615 6 6 | | 7 7 | This file is part of the RoundCube Webmail client | 8 | Copyright (C) 2005-200 7, RoundCube Dev. - Switzerland |8 | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland | 9 9 | Licensed under the GNU GPL | 10 10 | | … … 22 22 23 23 // read contact record 24 if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true))) 24 if (($cid = get_input_value('_cid', RCUBE_INPUT_GPC)) && ($record = $CONTACTS->get_record($cid, true))) { 25 25 $OUTPUT->set_env('cid', $record['ID']); 26 26 } 27 27 28 28 function rcmail_contact_details($attrib) 29 {29 { 30 30 global $CONTACTS, $OUTPUT; 31 31 32 32 // check if we have a valid result 33 if (!(($result = $CONTACTS->get_result()) && ($record = $result->first()))) 34 { 33 if (!(($result = $CONTACTS->get_result()) && ($record = $result->first()))) { 35 34 $OUTPUT->show_message('contactnotfound'); 36 35 return false; … … 38 37 39 38 // a specific part is requested 40 if ($attrib['part']) 39 if ($attrib['part']) { 41 40 return Q($record[$attrib['part']]); 41 } 42 42 43 43 // return the complete address record as table 44 $ out = "<table>\n\n";44 $table = new html_table(array('cols' => 2)); 45 45 46 46 $a_show_cols = array('name', 'firstname', 'surname', 'email'); 47 foreach ($a_show_cols as $col) 48 { 49 if ($col=='email' && !empty($record[$col])) 50 $value = sprintf( 51 '<a href="#compose" onclick="%s.command(\'compose\', \'%s\')" title="%s">%s</a>', 52 JS_OBJECT_NAME, 53 JQ($record[$col]), 54 rcube_label('composeto'), 55 Q($record[$col])); 47 $microformats = array('name' => 'fn', 'email' => 'email'); 48 49 foreach ($a_show_cols as $col) { 50 if ($col == 'email' && !empty($record[$col])) { 51 $value = html::a(array( 52 'href' => 'mailto:' . $record[$col], 53 'onclick' => sprintf("return %s.command('compose','%s',this)", JS_OBJECT_NAME, JQ($record[$col])), 54 'title' => rcube_label('composeto'), 55 'class' => $microformats[$col], 56 ), Q($record[$col])); 57 } 58 else if (!empty($record[$col])) { 59 $value = html::span($microformats[$col], Q($record[$col])); 60 } 56 61 else 57 $value = Q($record[$col]);62 $value = ''; 58 63 59 $out .= sprintf("<tr><td class=\"title\">%s</td><td>%s</td></tr>\n", 60 Q(rcube_label($col)), 61 $value); 62 } 64 $table->add('title', Q(rcube_label($col))); 65 $table->add(null, $value); 66 } 63 67 64 $out .= "\n</table>"; 65 66 return $out; 67 } 68 return $table->show($attrib + array('class' => 'vcard')); 69 } 68 70 69 71
Note: See TracChangeset
for help on using the changeset viewer.
