Changeset ce988a0 in github
- Timestamp:
- Feb 9, 2011 5:33:26 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- ea23df6
- Parents:
- 829cbfe8
- Location:
- program
- Files:
-
- 4 edited
-
include/main.inc (modified) (5 diffs)
-
js/app.js (modified) (2 diffs)
-
steps/addressbook/func.inc (modified) (3 diffs)
-
steps/addressbook/save.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
program/include/main.inc
ra77cf22 rce988a0 742 742 743 743 /** 744 * Convert the given string into a valid HTML identifier 745 * Same functionality as done in app.js with this.identifier_expr 746 * 747 */ 748 function html_identifier($str) 749 { 750 return asciiwords($str, true, '_'); 751 } 752 753 /** 744 754 * Remove single and double quotes from given string 745 755 * … … 792 802 { 793 803 $zebra_class = $c % 2 ? 'even' : 'odd'; 794 $table->add_row(array('id' => 'rcmrow' . $sql_arr[$id_col], 'class' => $zebra_class));804 $table->add_row(array('id' => 'rcmrow' . html_identifier($sql_arr[$id_col]), 'class' => $zebra_class)); 795 805 796 806 // format each col … … 809 819 $zebra_class .= ' '.$row_data['class']; 810 820 811 $table->add_row(array('id' => 'rcmrow' . $row_data[$id_col], 'class' => $zebra_class));821 $table->add_row(array('id' => 'rcmrow' . html_identifier($row_data[$id_col]), 'class' => $zebra_class)); 812 822 813 823 // format each col … … 1488 1498 1489 1499 // make folder name safe for ids and class names 1490 $folder_id = asciiwords($folder['id'], true, '_');1500 $folder_id = html_identifier($folder['id']); 1491 1501 $classes = array('mailbox'); 1492 1502 … … 1523 1533 'href' => rcmail_url('', array('_mbox' => $folder['id'])), 1524 1534 'onclick' => sprintf("return %s.command('list','%s',this)", JS_OBJECT_NAME, $js_name), 1535 'rel' => $folder['id'], 1525 1536 'title' => $title, 1526 1537 ); -
program/js/app.js
r07b95dc rce988a0 3782 3782 this.update_contact_row = function(cid, cols_arr, newcid) 3783 3783 { 3784 cid = String(cid).replace(this.identifier_expr, '_'); 3785 newcid = String(newcid).replace(this.identifier_expr, '_'); 3786 3784 3787 var row; 3785 3788 if (this.contact_list.rows[cid] && (row = this.contact_list.rows[cid].obj)) { … … 3814 3817 row = document.createElement('tr'); 3815 3818 3816 row.id = 'rcmrow'+ cid;3819 row.id = 'rcmrow'+String(cid).replace(this.identifier_expr, '_'); 3817 3820 row.className = 'contact '+(even ? 'even' : 'odd'); 3818 3821 -
program/steps/addressbook/func.inc
r29aab5a rce988a0 121 121 'id' => 'rcmli%s', 'class' => 'addressbook %s'), 122 122 html::a(array('href' => '%s', 123 'rel' => '%s', 123 124 'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s')); 124 125 … … 130 131 $id = strval($source['id'] ? $source['id'] : $j); 131 132 $js_id = JQ($id); 132 $dom_id = preg_replace('/[^a-z0-9\-_]/i', '_', $id); 133 $out .= sprintf($line_templ, $dom_id, ($current === $id ? 'selected' : ''), 133 $out .= sprintf($line_templ, 134 html_identifier($id), 135 ($current === $id ? 'selected' : ''), 134 136 Q(rcmail_url(null, array('_source' => $id))), 137 $source['id'], 135 138 $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id))); 136 139 … … 159 162 'id' => 'rcmliG%s', 'class' => 'contactgroup'), 160 163 html::a(array('href' => '#', 164 'rel' => '%s:%s', 161 165 'onclick' => "return ".JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s')); 162 166 163 167 $jsdata = array(); 164 168 foreach ($groups as $group) { 165 $args['out'] .= sprintf($line_templ, asciiwords($args['source'] . $group['ID'], true, '_'), $args['source'], $group['ID'], Q($group['name'])); 169 $args['out'] .= sprintf($line_templ, 170 html_identifier($args['source'] . $group['ID']), 171 $args['source'], $group['ID'], 172 $args['source'], $group['ID'], Q($group['name']) 173 ); 166 174 $args['jsdata']['G'.$args['source'].$group['ID']] = array( 167 175 'source' => $args['source'], 'id' => $group['ID'], -
program/steps/addressbook/save.inc
r07b95dc rce988a0 250 250 251 251 rcmail_js_contacts_list($result, 'parent.'); 252 $OUTPUT->command('parent.contact_list.select', $insert_id);252 $OUTPUT->command('parent.contact_list.select', html_identifier($insert_id)); 253 253 254 254 // update record count display
Note: See TracChangeset
for help on using the changeset viewer.
