AlbumModule Class Reference

Generate photo album XML. More...

Inheritance diagram for AlbumModule:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ()
 Construct and initialize an album.
 addImageById ($imageId, $caption='')
 Add an image resource to our album by its SNAP2 path/id.
 addImageByResource ($imageRes, $caption='')
 Add an image resource to our album.
 addImageDirectory ($imageDir)
 Add an image directory to our album.
 generateAlbumXML ()
 Generate and return the XML for the album.


Detailed Description

Generate photo album XML.

Generate XML that represents an album of photos for display on the website. This is a way of encoding the album as it is passed around between different parts of the framework or stored in a file/database.

Sandy's old comments (I can't bring myself to delete them): "A class that builds album xml. More importantly, it will shock the socks off of jonathan with its ugliness."

Author:
sbrady@shodor.org (DATE)

Member Function Documentation

AlbumModule::addImageById ( imageId,
caption = '' 
)

Add an image resource to our album by its SNAP2 path/id.

Take the path or id of a SNAP2 image resource. Look up that resource from SNAP2 and add it to our album. If a caption is passed in, use that caption. Otherwise, use the description of the image from SNAP2 as the caption.

Parameters:
$imageId [mixed]: The SNAP2 path to the image resource, or the resource id
$caption [string]: A literal caption if you don't want to use the description from SNAP2 as the caption (optional)
Returns:
[bool]: True on success, false on failure

AlbumModule::addImageByResource ( imageRes,
caption = '' 
)

Add an image resource to our album.

Take a SNAP2 image resource. If a caption is passed in, use that caption. Otherwise, use the description of the image from SNAP2 as the caption.

Parameters:
$imageRes [SnapResource]: The image resource to be added to the album
$caption [string]: A literal caption if you don't want to use the description from SNAP2 as the caption (optional)
Returns:
[bool]: True on success, false on failure

AlbumModule::addImageDirectory ( imageDir  ) 

Add an image directory to our album.

Take a SnapDirectory that contains (only) a set of images. Loop through the resources (images) in this directory and add them to our album.

Parameters:
$imageDir [SnapDirectory]: A SNAP2 directory that contains only images
Returns:
[bool]: True on success, false on failure

AlbumModule::generateAlbumXML (  ) 

Generate and return the XML for the album.

Generate the Album XML, which can be stored or rendered to the screen by a PR2 translator.

Returns:
[string]: The XML representation of the album


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:01:48 2010 for Common by  doxygen 1.5.6