// this script can be static
//request.element.isStatic = 0;
appConfig = application.ptCalendar.getAppConfig();
// Set the Display View Page Mode from the config (single or multiple)
displayViewPageMode = application.ptCalendar.viewPageMode;
// Set the Active display views
activeDisplayViews = application.ptCalendar.getActiveDisplayViews();
activeDisplayViewCnt = ListLen(activeDisplayViews);
// Get the calendar view query parameter name from the config
viewParamName = application.ptCalendar.viewParamName;
currentCalendarView = application.ptCalendar.defaultView;
if ( StructKeyExists(request.params,viewParamName) )
currentCalendarView = TRIM(request.params[viewParamName]);
// Make currentCalendarView safe for output
currentCalendarView = application.ptCalendar.calRenderViewService.makeViewParamValueSafe(paramValue=currentCalendarView);
// Define a custom view link seperator
customViewLinkSeperator = " | ";
if ( StructKeyExists(attributes,"customViewLinkSeperator") )
useViewLinkSeperator = attributes.customViewLinkSeperator;
pageMap = StructNew();
detailLink = "";
dailyLink = "";
weeklyListLink = "";
weeklyGridLink = "";
monthlyListLink = "";
monthlyGridLink = "";
nextPrevLink = "";
renderedLinkCount = 0;
currentPage = cgi.script_name;
currentPageParams = ""; //cgi.query_string;
hasSelectedDatePart = 0;
qParamDelimiter = "?";
if ( application.ptCalendar.viewPageMode EQ "Single" )
{
viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct();
qParamDelimiter = "&";
}
else if ( application.ptCalendar.viewPageMode EQ "Multiple" )
{
viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct();
}
// Build the query params so the date of current view doesn't change when a new VIEW is clicked
currentPageParams = application.ptCalendar.calRenderViewService.renderCurrentViewQueryParams();
// Build the View Links
if( structKeyExists(viewLinkData, "detailPage") and LEN(TRIM(viewLinkData.detailPage)) )
detailLink = viewLinkData.detailPage & currentPageParams;
if( structKeyExists(viewLinkData, "dailyPage") and LEN(TRIM(viewLinkData.dailyPage)) )
dailyLink = viewLinkData.dailyPage & currentPageParams;
if( structKeyExists(viewLinkData, "weeklyListPage") and LEN(TRIM(viewLinkData.weeklyListPage)) )
weeklyListLink = viewLinkData.weeklyListPage & currentPageParams;
if( structKeyExists(viewLinkData, "weeklyGridPage") and LEN(TRIM(viewLinkData.weeklyGridPage)) )
weeklyGridLink = viewLinkData.weeklyGridPage & currentPageParams;
if( structKeyExists(viewLinkData, "monthlyListPage") and LEN(TRIM(viewLinkData.monthlyListPage)) )
monthlyListLink = viewLinkData.monthlyListPage & currentPageParams;
if( structKeyExists(viewLinkData, "monthlyGridPage") and LEN(TRIM(viewLinkData.monthlyGridPage)) )
monthlyGridLink = viewLinkData.monthlyGridPage & currentPageParams;