Changeset 5398 in subversion for trunk/roundcubemail/program/include/main.inc
- Timestamp:
- Nov 8, 2011 6:22:14 AM (19 months ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/include/main.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/main.inc
r5390 r5398 1233 1233 $select->add($p['noselection'], ''); 1234 1234 1235 rcmail_render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames'], 0, $p ['exceptions']);1235 rcmail_render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames'], 0, $p); 1236 1236 1237 1237 return $select; … … 1282 1282 1283 1283 if (!isset($arrFolders[$currentFolder])) { 1284 // Check \Noselect option (if options are in cache)1285 if (!$virtual && ($ opts = $RCMAIL->imap->mailbox_options($path))) {1286 $virtual = in_array('\\Noselect', $ opts);1284 // Check \Noselect attribute (if attributes are in cache) 1285 if (!$virtual && ($attrs = $RCMAIL->imap->mailbox_attributes($path))) { 1286 $virtual = in_array('\\Noselect', $attrs); 1287 1287 } 1288 1288 … … 1403 1403 * @return string 1404 1404 */ 1405 function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames=false, $nestLevel=0, $exceptions=array()) 1406 { 1405 function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames=false, $nestLevel=0, $opts=array()) 1406 { 1407 global $RCMAIL; 1408 1407 1409 $out = ''; 1408 1410 1409 1411 foreach ($arrFolders as $key => $folder) { 1410 if (empty($exceptions) || !in_array($folder['id'], $exceptions)) { 1411 if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id']))) 1412 $foldername = rcube_label($folder_class); 1413 else { 1414 $foldername = $folder['name']; 1415 1416 // shorten the folder name to a given length 1417 if ($maxlength && $maxlength>1) 1418 $foldername = abbreviate_string($foldername, $maxlength); 1419 } 1420 1421 $select->add(str_repeat(' ', $nestLevel*4) . $foldername, $folder['id']); 1422 } 1423 else if ($nestLevel) 1412 // skip exceptions (and its subfolders) 1413 if (!empty($opts['exceptions']) && in_array($folder['id'], $opts['exceptions'])) { 1424 1414 continue; 1415 } 1416 1417 // skip folders in which it isn't possible to create subfolders 1418 if (!empty($opts['skip_noinferiors']) && ($attrs = $RCMAIL->imap->mailbox_attributes($folder['id'])) 1419 && in_array('\\Noinferiors', $attrs) 1420 ) { 1421 continue; 1422 } 1423 1424 if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id']))) 1425 $foldername = rcube_label($folder_class); 1426 else { 1427 $foldername = $folder['name']; 1428 1429 // shorten the folder name to a given length 1430 if ($maxlength && $maxlength>1) 1431 $foldername = abbreviate_string($foldername, $maxlength); 1432 } 1433 1434 $select->add(str_repeat(' ', $nestLevel*4) . $foldername, $folder['id']); 1425 1435 1426 1436 if (!empty($folder['folders'])) 1427 1437 $out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, 1428 $select, $realnames, $nestLevel+1, $ exceptions);1438 $select, $realnames, $nestLevel+1, $opts); 1429 1439 } 1430 1440
Note: See TracChangeset
for help on using the changeset viewer.
