var photoSrcArray = ArrayNew(1);
var catData = StructNew();
var dirName = "";
var tmp = "";
if ( sizeID GT 0 )
{
// Get the category data for the photo
catData = application.ptPhotoGallery.photoService.loadCategoryData(arguments.photoDataArray[photo_i].Values.category);
//application.ADF.utils.dodump(catData, "catData", false);
dirName = "";
// Check if the value in the INITIALSIZEARRAY
if ( ArrayLen(catData.INITIALSIZEARRAY) ) {
// Loop over the array
for (cat_i = 1; cat_i LTE ArrayLen(catData.INITIALSIZEARRAY); cat_i = cat_i + 1){
// Check if this is the category we want, then get the directory name
if ( catData.INITIALSIZEARRAY[cat_i].Values.sizeID EQ arguments.sizeID )
{
dirName = catData.INITIALSIZEARRAY[cat_i].Values.directory;
break;
}
}
}
// Check if the value in the RESIZEDIMENSIONARRAY
if ( ArrayLen(catData.RESIZEDIMENSIONARRAY) AND (LEN(dirName) LTE 0) ) {
// Loop over the array
for (cat_i = 1; cat_i LTE ArrayLen(catData.RESIZEDIMENSIONARRAY); cat_i = cat_i + 1){
// Check if this is the category we want, then get the directory name
if ( catData.RESIZEDIMENSIONARRAY[cat_i].Values.sizeID EQ arguments.sizeID )
{
dirName = catData.RESIZEDIMENSIONARRAY[cat_i].Values.directory;
break;
}
}
}
//application.ADF.utils.dodump(dirName, "dirName", false);
// if we found a matching size, then get the right size photo
if ( LEN(dirName))
tmp = arrayAppend(photoSrcArray, application.ptPhotoGallery.renderService.getPhotoURL(arguments.photoDataArray[photo_i].Values.photo, dirName));
}
else
tmp = arrayAppend(photoSrcArray, arguments.photoDataArray[photo_i].Values.photo);
var xmlVars = "";
var i = 1;
// Get the data from CEData
if( ListLen(arguments.photoIDList) ) {
photoDataArray = application.ptPhotoGallery.photoDAO.getPhotoData(photoid = arguments.photoIDList);
}
// Build out the XML
xmlVars = XmlNew();
xmlVars.xmlRoot = XmlElemNew(xmlVars,"gallery");
xmlVars.gallery.XmlChildren[1] = XmlElemNew(xmlVars,"globals");
xmlVars.gallery.XmlChildren[1].XmlAttributes.currentitem="0";
xmlVars.gallery.XmlChildren[1].XmlAttributes.timer="5";
xmlVars.gallery.XmlChildren[1].XmlAttributes.radius="6";
xmlVars.gallery.XmlChildren[1].XmlAttributes.imagewidth= arguments.imgWidth;
xmlVars.gallery.XmlChildren[1].XmlAttributes.imageheight= arguments.imgHeight;
for (i = 1; i LTE arraylen(photoDataArray); i = i + 1)
{
xmlVars.gallery.XmlChildren[i+1] = XmlElemNew(xmlVars,"item");
xmlVars.gallery.item[i].XmlChildren[1] = XmlElemNew(xmlVars,"name");
xmlVars.gallery.item[i].XmlChildren[1].XmlText = photoDataArray[i].values.title;
xmlVars.gallery.item[i].XmlChildren[2] = XmlElemNew(xmlVars,"description");
xmlVars.gallery.item[i].XmlChildren[2].XmlText = photoDataArray[i].values.caption;
xmlVars.gallery.item[i].XmlChildren[3] = XmlElemNew(xmlVars,"title");
xmlVars.gallery.item[i].XmlChildren[3].XmlText = photoDataArray[i].values.title;
xmlVars.gallery.item[i].XmlChildren[4] = XmlElemNew(xmlVars,"content");
xmlVars.gallery.item[i].XmlChildren[4].XmlText = photoDataArray[i].values.abstract;
xmlVars.gallery.item[i].XmlChildren[5] = XmlElemNew(xmlVars,"image");
xmlVars.gallery.item[i].XmlChildren[5].XmlText = photoDataArray[i].values.photo;
xmlVars.gallery.item[i].XmlChildren[6] = XmlElemNew(xmlVars,"url");
xmlVars.gallery.item[i].XmlChildren[6].XmlText = "";
xmlVars.gallery.item[i].XmlChildren[7] = XmlElemNew(xmlVars,"target");
xmlVars.gallery.item[i].XmlChildren[7].XmlText = "";
}
var rhData = StructNew();
var sizeData = ArrayNew(1);
rhData.detailSize = StructNew();
rhData.photoSizeSelect = StructNew();
if ( StructKeyExists(arguments.metadataForm, "PhotoRenderSize") ){
// Get the detail size path
if ( StructKeyExists(arguments.metadataForm.PhotoRenderSize, "detailSize") AND LEN(arguments.metadataForm.PhotoRenderSize.detailSize) ){
sizeData = application.ptPhotoGallery.photoDAO.getPhotoSizeData(photoSizeid=arguments.metadataForm.PhotoRenderSize.detailSize);
if ( ArrayLen(sizeData) )
rhData.detailSize = sizeData[1].values;
}
// Get the photo size path
if ( StructKeyExists(arguments.metadataForm.PhotoRenderSize, "photoSizeSelect") AND LEN(arguments.metadataForm.PhotoRenderSize.photoSizeSelect) ){
sizeData = ArrayNew(1);
sizeData = application.ptPhotoGallery.photoDAO.getPhotoSizeData(photoSizeid=arguments.metadataForm.PhotoRenderSize.photoSizeSelect);
if ( ArrayLen(sizeData) )
rhData.photoSizeSelect = sizeData[1].values;
}
}
var loadScriptJS = '';
application.ptPhotoGallery.scripts.loadJQuery();
if ( arguments.version eq 1 )
application.ptPhotoGallery.scripts.loadJCycle();
else
application.ptPhotoGallery.scripts.loadJCycle2();
application.ptPhotoGallery.scripts.loadDropCurves();
application.ptPhotoGallery.scripts.loadJQueryMigrate();
// Load the inline JavaScript after the libraries have loaded
application.ptPhotoGallery.scripts.addFooterJS(loadScriptJS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY
var loadScriptJS = '';
application.ptPhotoGallery.scripts.loadJQuery();
if ( arguments.version eq 1 )
application.ptPhotoGallery.scripts.loadJCycle();
else
application.ptPhotoGallery.scripts.loadJCycle2();
application.ptPhotoGallery.scripts.loadDropCurves();
// Load the inline JavaScript after the libraries have loaded
application.ptPhotoGallery.scripts.addFooterJS(loadScriptJS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY