Changeset 1615 in subversion
- Timestamp:
- Jul 29, 2008 8:32:19 AM (5 years ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 3 edited
-
include/html.php (modified) (2 diffs)
-
steps/addressbook/edit.inc (modified) (1 diff)
-
steps/addressbook/show.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/html.php
r1595 r1615 34 34 35 35 public static $common_attrib = array('id','class','style','title','align'); 36 public static $containers = array('div','span','p','h1','h2','h3','form','textarea' );36 public static $containers = array('div','span','p','h1','h2','h3','form','textarea','table','tr','th','td'); 37 37 public static $lc_tags = true; 38 38 … … 608 608 public function show($attrib = null) 609 609 { 610 if (is_array($attrib))611 $this->attrib = array_merge($this->attrib, $attrib);610 if (is_array($attrib)) 611 $this->attrib = array_merge($this->attrib, $attrib); 612 612 613 $thead = $tbody = "";613 $thead = $tbody = ""; 614 614 615 615 // include <thead> -
trunk/roundcubemail/program/steps/addressbook/edit.inc
r1569 r1615 91 91 { 92 92 $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $RCMAIL->task)); 93 $hiddenfields->add(array('name' => '_action', 'value' => 'save' , 'source' => get_input_value('_source', RCUBE_INPUT_GPC)));93 $hiddenfields->add(array('name' => '_action', 'value' => 'save')); 94 94 $hiddenfields->add(array('name' => '_source', 'value' => get_input_value('_source', RCUBE_INPUT_GPC))); 95 95 $hiddenfields->add(array('name' => '_framed', 'value' => (empty($_REQUEST['_framed']) ? 0 : 1))); -
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.
