|
Cookbook /
FileAttachListSummary: Adds a Ajax list of quickly attachable files to the edit page
Version: 0.2 May 21, 2009
Prerequisites: PmWiki
Status: Stable
Questions answered by this recipeHow can I view a list of attachable files on the edit page? Description![]() Shows a link on the edit page to dynamically load a list of attachable files. Install Instructions
Notes
Release Notes
See also
Comments(2007-08-14) When I add the code above to local/config.php and copy to cookbook/jsfilelist.php, I get PHP code when loading pmwiki.php in edit mode. Also is it "require_once" or "include_once"? I tried both, but still got the echo of PHP code from jsfilelist.php. (2007-08-21) Hi! I just tried it. The file you download when you click on the link is in fact the PHP source in HTML format. So what I did was to click on the link, this will show you the code in your browser. Just select all the code, copy-paste in a file named jsfilelist.php in your cookbook directory. Include this file in your local/config.php. Be sure that the skin you're using has a "<!--HTMLFooter-->" at the end of its code (mine hadn't), then you'll see the new link just before the buttons bar in edit mode.
The only problem I found is that $uploaddir = FmtPageName("$jsflUploadDir (2007-08-26) Thanks Jonathan. However, now I although the ajax menu loads, my Save, Preview and Cancel buttons at the bottom of the edit window does not work. Advise? (2009-05-21) Version 0.1 of this script is no longer compatible with the current version of PmWiki. The script reloads the page to get the filelist, and clobbers the URL in doing so, messing up the pagename variables. Here is a modified Version 0.2. Now it retains the original URL when loading the attachment list. Also it filters out thumbnails starting with th00. Works great with PmWiki pmwiki-2.2.1. timethy? (2009-08-09) Very nifty recipe - thanks, just what I needed! It does not seem to work with group-based upload directories, though. It only lists files in $jsflUploadDir/$group/$name/, hardcoded. Would be neat if it honored User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |