Changeset 4852 in subversion
- Timestamp:
- Jun 15, 2011 7:04:06 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/addressbook/func.inc
r4850 r4852 63 63 $js_list = $RCMAIL->get_address_sources(); 64 64 65 $source = get_input_value('_source', RCUBE_INPUT_GPC); 66 65 67 // use first directory by default 66 $source = $js_list[key($js_list)]['id']; 68 if (!strlen($source) || !isset($js_list[$source])) 69 $source = $js_list[key($js_list)]['id']; 67 70 68 71 // find writeable source … … 156 159 $local_id = '0'; 157 160 $jsdata = array(); 158 $current = get_input_value('_source', RCUBE_INPUT_GPC); 161 159 162 $line_templ = html::tag('li', array( 160 163 'id' => 'rcmli%s', 'class' => 'addressbook %s'), … … 163 166 'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s')); 164 167 165 // currently selected is the first address source in the list 166 if (!isset($current)) 167 $current = strval(key((array)$OUTPUT->env['address_sources'])); 168 169 foreach ((array)$OUTPUT->env['address_sources'] as $j => $source) { 168 $sources = (array) $OUTPUT->env['address_sources']; 169 reset($sources); 170 171 // currently selected source 172 $current = get_input_value('_source', RCUBE_INPUT_GPC); 173 if (!strlen($current) || !isset($sources[$source])) 174 $current = strval(key($sources)); 175 176 foreach ($sources as $j => $source) { 170 177 $id = strval($source['id'] ? $source['id'] : $j); 171 178 $js_id = JQ($id);
Note: See TracChangeset
for help on using the changeset viewer.
