// This script MUST remain dynamic since the data and the generated HTML is modified with a URL parameters request.element.isStatic = 0; // Get the Configuration and Page Map Values // appConfig = application.ptCalendar.getAppConfig(); // cfDateDisplayMask = application.ptCalendar.getDisplayCFdateMask(); // "M/D/YYYY" - DATE FORMAT FOR DISPLAY // cfDateLongDisplayMask = application.ptCalendar.getDisplayCFdateLongMask(); // "dddd mmmm d, yyyy" - DATE FORMAT FOR DISPLAY // cfTimeDisplayMask = application.ptCalendar.getDisplayCFtimeMask(); // "h:mm tt" - TIME FORMAT FOR DISPLAY // Set the Event Cache status from the configuration element useEventsCache = application.ptCalendar.getEventCacheStatus(); daysFilter = 30; if (structKeyExists(request.params,"days") AND IsNumeric(request.params.days) AND request.params.days GT 0 ) daysFilter = request.params.days; pastdaysFilter = 0; //Use 0 to only go back to the current day's events. if (structKeyExists(request.params,"pastdays") AND IsNumeric(request.params.pastdays) AND request.params.pastdays GTE 0 ) pastdaysFilter = request.params.pastdays; maxRecordsFilter = 0; //Use 0 for unlimited. if (structKeyExists(request.params,"maxevents") AND IsNumeric(request.params.maxevents) AND request.params.maxevents GTE 0 ) maxRecordsFilter = request.params.maxevents; orgsFilter = ""; if (structKeyExists(request.params,"orgs") AND LEN(TRIM(request.params.orgs)) ) orgsFilter = request.params.orgs; catsFilter = ""; if (structKeyExists(request.params,"cats") AND LEN(TRIM(request.params.cats)) ) catsFilter = request.params.cats; activeFilter = ""; if (structKeyExists(request.params,"active") AND IsBoolean(request.params.active) ) activeFilter = request.params.active; showElementData = false; if (structKeyExists(request.params,"elementdata") AND IsBoolean(request.params.elementdata) ) showElementData = request.params.elementdata; showFeedData = false; if (structKeyExists(request.params,"feeddata") AND IsBoolean(request.params.feeddata) ) showFeedData = request.params.feeddata; outputRSS = false; if ( !showFeedData AND !showElementData AND StructKeyExists(request.params,"rss") AND IsBoolean(request.params.rss) AND request.params.rss EQ 1 ) outputRSS = true; // Get the items from the Display Properties Custom Element //items = attributes.elementInfo.elementData.propertyValues; items = ArrayNew(1); propsData = StructNew(); propsData.values = StructNew(); propsData.values.pastDaysRange = pastdaysFilter; //Use 0 to only go back to the current day's events. propsData.values.futureDaysRange = daysFilter; propsData.values.maxEventRecords = maxRecordsFilter; //Use 0 for unlimited. propsData.values.organization = ""; propsData.values.category = ""; propsData.values.eventApproved = ""; // PageURL or PageID of the page the RSS content will link to propsData.values.linkedCalendarPage = 5089; // PageID of the main Calendar View page propsData.values.linkedCalendarSubsite = ""; ArrayAppend(items,propsData); linkedCalendarPage = ""; linkedCalendarSubsite = ""; if ( ArrayLen(items) AND StructKeyExists(items[1],"values") ) { if ( StructKeyExists(items[1].values,"linkedCalendarPage") ) linkedCalendarPage = items[1].values.linkedCalendarPage; if ( StructKeyExists(items[1].values,"linkedCalendarSubsite") ) linkedCalendarSubsite = items[1].values.linkedCalendarSubsite; } // - ptCalendar EventsCache designation (generally this will be true. May need to set to false for debugging) // useEventsCache = false; // (true/false) - Use this as an override for the Global setting that is managed via the Configuration element /* ** getRenderUpcomingEventsData *** */ // ptCalendar date and data processing returned as CF query object // -- THIS MUST BE INCLUDED AT THE TOP OF THE ptCalendar Upcoming Events RenderHandler (after the getRenderEventData Settings) eventData = application.ptCalendar.calRenderController.getRenderUpcomingEventsData( displayPropsArray=items ,useEventsCache=useEventsCache ); if ( showElementData ) application.ADF.utils.doDUMP(eventData,"eventData",0); feedData = application.ptCalendar.calEventsRssService.generateEventFeedData(eventsDataArray=eventData,linkedPage=linkedCalendarPage,linkedView="monthlist",renderFeedData=showFeedData); if ( outputRSS ) application.ptCalendar.calEventsRssService.renderEventRSS(rssEventStruct=feedData,killPageOutput=true);