Changeset 499 in subversion for branches/devel-addressbook/program/steps/addressbook/func.inc
- Timestamp:
- Feb 27, 2007 6:33:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-addressbook/program/steps/addressbook/func.inc
r495 r499 46 46 // set data source env 47 47 $OUTPUT->set_env('source', $source ? $source : '0'); 48 $OUTPUT->set_env('readonly', $CONTACTS->readonly, false); 48 49 49 50 … … 63 64 ' onmouseup="return %s.folder_mouse_up(\'%s\')">%s'. 64 65 "</a></li>\n"; 66 67 $js_list = array("$local_id" => array('id' => $local_id, 'readonly' => false)); 65 68 66 69 // allow the following attributes to be added to the <ul> tag … … 83 86 { 84 87 $js_id = JQ($id); 88 $dom_id = preg_replace('/[^a-z0-9\-_]/i', '', $id); 85 89 $out .= sprintf($line_templ, 86 'rcmli'. preg_replace('/[^a-z0-9\-_]/i', '', $id),90 'rcmli'.$dom_id, 87 91 $current == $id ? 'selected' : '', 88 92 Q(rcmail_self_url('list', array('_source' => $id))), … … 96 100 $js_id, 97 101 !empty($prop['name']) ? Q($prop['name']) : Q($id)); 102 103 $js_list[$dom_id] = array('id' => $id, 'readonly' => !$prop['writeable']); 98 104 } 99 105 … … 101 107 102 108 $OUTPUT->add_gui_object('folderlist', $attrib['id']); 109 $OUTPUT->set_env('address_sources', $js_list); 103 110 104 111 return $out; … … 113 120 // count contacts for this user 114 121 $result = $CONTACTS->list_records(); 115 $rowcount = $result['count'];116 $firstrow = $result['first'];117 118 unset($result['count'], $result['first']);119 122 120 123 // add id to message list table if not specified … … 124 127 // define list of cols to be displayed 125 128 $a_show_cols = array('name'); 126 129 127 130 // create XHTML table 128 $out = rcube_table_output($attrib, $result , $a_show_cols, $CONTACTS->primary_key);131 $out = rcube_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key); 129 132 130 133 // set client env 131 134 $OUTPUT->add_gui_object('contactslist', $attrib['id']); 132 135 $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page); 133 $OUTPUT->set_env('pagecount', ceil($r owcount/$CONTACTS->page_size));136 $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size)); 134 137 $OUTPUT->include_script('list.js'); 135 138 … … 145 148 global $OUTPUT; 146 149 147 if (empty($result) || $result ['count']== 0)150 if (empty($result) || $result->count == 0) 148 151 return; 149 152 150 unset($result['count'], $result['first']);151 152 153 // define list of cols to be displayed 153 154 $a_show_cols = array('name'); 154 155 155 foreach ($result as $i => $row)156 while ($row = $result->next()) 156 157 { 157 158 $a_row_cols = array(); … … 212 213 $result = $CONTACTS->count(); 213 214 214 if ($result ['count']== 0)215 if ($result->count == 0) 215 216 $out = rcube_label('nocontactsfound'); 216 217 else … … 218 219 'name' => 'contactsfromto', 219 220 'vars' => array( 220 'from' => $result ['first']+ 1,221 'to' => min($result ['count'], $result['first']+ $CONTACTS->page_size),222 'count' => $result ['count'])221 'from' => $result->first + 1, 222 'to' => min($result->count, $result->first + $CONTACTS->page_size), 223 'count' => $result->count) 223 224 )); 224 225
Note: See TracChangeset
for help on using the changeset viewer.
