if (structKeyExists(application,"ptPageRating"))
{
application.ptPageRating.scripts.loadJQuery();
application.ptPageRating.scripts.loadJQueryUI();
application.ptPageRating.scripts.loadJQueryCookie();
application.ptPageRating.scripts.loadJQueryUIStars();
// Use debug previous jQuery version issues
//application.ptPageRating.scripts.loadJQueryMigrate();
}
CSRF_Token = application.ADF.csSecurity.getCSRF_Token();
pageRating = application.ptPageRating.DAO.getAverage(ratingPageID=request.page.id);//Rating percentage
userRating = -1;
ratingID = createUUID();
if(request.user.id){//Restore their rating!
rating = application.ptPageRating.DAO.getRating(ratingPageID=request.page.id,userID=request.user.id);
if(ArrayLen(rating)){
ratingID = rating[1].values.id;
userRating = rating[1].values.rating;
}
}
// Load the inline Styles after the libraries have loaded
application.ptPageRating.scripts.addHeaderCSS(pageRatingCSS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY
// Load the inline JavaScript after the libraries have loaded
application.ptPageRating.scripts.addFooterJS(pageRatingJS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY
// Include the style sheet
pageRatingCSSurl = "/ADF/apps/pt_page_rating/style/ptPageRating.css";
application.ptPageRating.scripts.loadUnregisteredResource(URL=pageRatingCSSurl,resourceType='StyleSheet',location='head',resourceGroup="TERTIARY",canCombine=0,canMinify=0);