1 | <% |
---|
2 | var specialFolders = { |
---|
3 | INBOX: {name:'Caixa de Entrada', classe:'inbox'}, |
---|
4 | Inbox: {name:'Caixa de Entrada', classe:'inbox'}, |
---|
5 | Trash: {name:'Lixeira', classe:'trash'}, |
---|
6 | Drafts:{name:'Rascunhos', classe:'drafts'}, |
---|
7 | Spam: {name:'Spam', classe:'spam'}, |
---|
8 | Sent: {name:'Enviados', classe:'sent'} |
---|
9 | }; |
---|
10 | |
---|
11 | function recursive_forest(array_trees) |
---|
12 | { |
---|
13 | %><ul><% |
---|
14 | |
---|
15 | for(var i=0; i<array_trees.length; i++) |
---|
16 | { |
---|
17 | folder_class = ''; |
---|
18 | folder_name = array_trees[i].commonName; |
---|
19 | |
---|
20 | if( specialFolders[folder_name] ){ |
---|
21 | folder_class = specialFolders[folder_name].classe; |
---|
22 | folder_name = specialFolders[folder_name].name; |
---|
23 | } |
---|
24 | |
---|
25 | %><li id="<%= array_trees[i].id %>" class="closed"><span class="folder <%= folder_class %>" title="<%= folder_name %>"><%= folder_name %></span> |
---|
26 | <% |
---|
27 | |
---|
28 | if (array_trees[i].children.length>0) |
---|
29 | recursive_forest(array_trees[i].children); |
---|
30 | |
---|
31 | %></li><% |
---|
32 | } |
---|
33 | |
---|
34 | %></ul><% |
---|
35 | } |
---|
36 | %> |
---|
37 | <ul id="foldertree" class="filetree foldertree-skin-prognus"> |
---|
38 | <li><span class="folder">Minhas Pastas</span> |
---|
39 | <% recursive_forest(data.folders[0]); %> |
---|
40 | </li> |
---|
41 | <% if(data.folders[1].length > 0) { %> |
---|
42 | <li><span class="folder">Pastas compartilhadas</span> |
---|
43 | <% recursive_forest(data.folders[1]); %> |
---|
44 | </li> |
---|
45 | <%}%> |
---|
46 | <% if(preferences.use_local_messages == 1) { %> |
---|
47 | <li><span class="folder">Pastas locais</span> |
---|
48 | <% recursive_forest(data.folders[2]); %> |
---|
49 | </li> |
---|
50 | <%}%> |
---|
51 | </ul> |
---|