<%@ include file="/plugins/setup/setup_include_header.jsp" %><%-- __________________________________________________________________________________________ banners_flash Code used to include plugin on Revize page: Puts flash banner on home page or dependent template (e.g. freeform) ---------- Parameters: ---------- width (required) String that defines width of flash banner height (required) String that defines height of flash banner padding (optional) padding added to flash div style attributes usehome (optional) true to always use home section banner; otherwise false (default) If true, edit button only appears on the home section debug (optional) true to enable debug println statements; otherwise false __________________________________________________________________________________________ --%><% String VERSION = "v01-27-2012"; %><% //----- input parameters -----\\ String width = StringUtils.getParameter(request,"width"); String height = StringUtils.getParameter(request,"height"); String padding = StringUtils.getParameter(request,"padding"); // NOTE: prior to v01-27-2012, padding added as dup class attribute with an invalid name //if (!padding.equals("")) padding = " class=\"" + padding + "\""; if (!padding.equals("")) padding = " style=\"padding:" + padding + "\""; boolean usehome = StringUtils.getParameter(request,"usehome").equals("true"); boolean debug = StringUtils.getParameter(request,"debug").equals("true"); if (debug) out.println("debug enabled entering plugin: banners_flash (" + VERSION + ")"); //----- jsp code -----\\ //TODO: replace with rz.pagesectiontop when available String parentsectionid = rz.pagesectionid; String myparentid = rz.pageparentid; int cnt = 0; while (true && !rz.pagerecordid.equals("")) //not top section or home page { cnt++; rz.fetch("links","linktosectionid", "_recordid="+parentsectionid); if (rz.content.equals("0")) break; //parent section is home parentsectionid = rz.content; if (cnt == 10) break; } if (usehome) parentsectionid="0"; %><%----- html code -----%>
<% //----- Only display button on home page if always displaying home section banner // (but keep prior div so html / css structure is consistant) if (!usehome || rz.pagesectionid.equals(parentsectionid)) { %>
<%-- #BeginRZ-ActionImage --%><%-- Option:type=EditListEditImage --%><%-- Option:imageSrcURL=../images/edit/edit_this_flash.jpg --%><%-- #EndRZ-ActionImage --%>
<% } %><% if (debug) out.println("parentsectionid="+parentsectionid+" "+rz.content+" "+rz.nodata + "\n"); if (!rz.nodata && rz.content.indexOf("noimage.gif") == -1) { %>
> <% %><% if (width.equals("") || width.equals("")) out.print("both height and width are required
width=" + width + "
height=" + height); else { %>
<% } } %>