Pleth, your suggestion is very useful, but what I want is to somehow 'recursively' list all documents... in a way that I can have a 'main' folder that has documents in it -or is empty- and subfolders that have documetns in them -or are empty. Then it would show the files if there are any, and any files in the subfolders as nested lists. Also it would be nice if one could specify the maximum 'depth' the list should be.
I'd try it myself, but my knowledge of PHP is at 'newbie' level... x)
So in the following example, with the folder structure in the quote and a DocMan/snippet call, it would output the code for the list below.
Main folder: Publications
Subfolders: Publications->Newspapers; Publications->Magazines
Subfolder lvl.2: Publications->Magazines->SpecialEditions
<h2>Publications</h2>
<ul>
<li>Newspapers
<ul>
<li><a href="gg-1.pdf">The grand gazette Issue 1</a></li>
<li><a href="gg-2.pdf">The grand gazette Issue 2</a></li>
<li><a href="gg-3.pdf">The grand gazette Issue 3</a></li>
</ul>
</li>
<li>Magazines
<ul>
<li><a href="bm-1.pdf">Best Mag In The World Issue 1</a></li>
<li><a href="bm-2.pdf">Best Mag In The World Issue 2</a></li>
<li>Special Editions
<ul><li><a href="bm-spsp.pdf">Best Mag In The World Spring Special</li></ul>
</li>
</ul>
</li>
</ul>