Split the list view code up in three pieces
1. getListContents which returns the required contents dictionary
2. _list which returns the response for a specified list of contents
3. list which constructs just one content dict and passes it to _list
This way it is easier to do step 1 and 2 in other code than list(),
which makes it possible to display multiple list pages (by calling
getListContents multiple times and passing the result to _list).
$(function() {
$('#side #menu li.expandable > a').dblclick(function() {
window.location = $(this).attr('href');
})
$('#side #menu li.expandable > span').toggle(function() {
$(this).find("img").attr('src', '/soc/content/images/plus.gif').end().parent().children("ul").toggle();
}, function() {
$(this).find("img").attr('src', '/soc/content/images/minus.gif').end().parent().children("ul").toggle();
return false;
});
$('#side #menu li.expandable > span').contents().before('<img src="/soc/content/images/minus.gif" />');
});