Photo Album
Actions
Edit
Add New Page
Add New Child Page
Copy
Move
Refresh
History
Delete
Set Access
Printable
Create Attachment
Referring Pages
Extensions
Tags
Extension
Page Template
Default Template
Information
Documentation
Release Notes
Support
License
About
Home
My Pages
My Journal
My Photo Album
My Notes
Sandbox
Site Reference
Pages Index
Wiki Journal
Missing Pages
Site Explorer
Deleted Pages
Look & Feel
Left Menu
Top Menu
Page
Styles
Images and Icons
Administration
Users & Groups
Access Rights
System
OpenForum Settings
Documentation
Actions
Extensions
Jar Manager
Issue Tracking
Source Code
Displays a pages images as a Photo Album
Parameters
pageName - the page where the images are to be found
optional
fileName - the initial image to show
optional
Usage:
[{PhotoAlbum}]
Example Page
renderer.sjs
newPageName = extension.getAttributeValueByName("pageName"); firstFileName = extension.getAttributeValueByName("fileName"); if(newPageName!=null) { pageName = newPageName; } while(pageName.charAt(0)=='/') { pageName = pageName.substring(1); } page = "
"; files = file.getAttachmentsForPage(pageName); fileNames = files.keys(); while(fileNames.hasMoreElements()) { fileName = fileNames.nextElement(); if(fileName.charAt(0)=='+') { continue; } if(fileName.indexOf(".thumbnail.")!=-1) { continue; } if(fileName.indexOf(".icon.")!=-1) { continue; } if(file.isImageAttachment(fileName)) { filePath = files.get(fileName); if(firstFileName==null) { firstFileName = pageName+"\",\""+fileName; } parts = new String(fileName).split("."); thumbnail = parts[0]+".thumbnail.png"; //thumbnail = fileName+".thumbnail.png"; imageToShow = filePath; if( file.attachmentExists(pageName,thumbnail) ) { imageToShow = pageName+"/"+thumbnail; page += "
"; } else { page += "
"; } } } page += "
"; page += "
"; page += "" return page;
by Admin on 21/04/2008 at 10:08 PM