---------------------------------------------------- The following 3 snippets are the simplified headers ---------------------------------------------------- <%-- #BeginRZ-PageHeader --%> <%@ page language="java" %> <%@ include file="/util/enable_template.jsp" %> <%-- #EndRZ-PageHeader --%> <%-- #BeginRZ-PageHeader --%> <%@ page language="java" %> <%@ include file = "/util/enable_editlist.jsp" %> <%-- #EndRZ-PageHeader --%> <%-- #BeginRZ-PageHeader --%> <%@ page language="java" %> <% String rzmodule = "contact_us"; %> <%@ include file = "/util/enable_editform.jsp" %> <%-- #EndRZ-PageHeader --%>
------------------------------------------------------------------ The following snippets are the simplified action buttons. Notice they all call a single JavaScript function (RZaction) with a single parameter (a string representing the requested action). Internally RZaction generates script which implements each action. That script then gets associated with the button or image displayed on a page (and executed when clicked). The button or image is only displayed if an authorized user is logged in. This is implemented using the JavaScript document.write() function since templates are pre-assembled dynamic pages (this is the new phrase replacing dynamically generated static pages). The test for RZaction undefined is to avoid JavaScript errors when published pages are viewed by a non-Revize web server such as IIS or Apachie. Edit forms are of course traditional dynamic jsp pages that use JSP code to redirect to the login page if no user is logged in or the current user does not have permission to update the specified record. This is RZ.img is used for image type buttons (blank for grey button) RZ.caption is used for ugly grey buttons (blank for image button) RZ.img is the trigger (if non-blank an image type button is used) Note how easy the html can be extended with additional html attributes, customized images, etc. Single quotes are used to defines all JavaScript strings for the following reasons: 1) a consistant convention for defining all JavaScript strings and/or arguments, 2) html double quotes can be contained inside the string (e.g. primarily the RZ.img argument) and 3) it further differenciates the JavaScript code from JSP code. Note only the arguments applicable to each action are set prior to calling RZaction. All arguments are cleared after every call. Below is a current list: RZ.module=""; RZ.recordid=""; RZ.nexturl=""; RZ.popupwidth=0; RZ.popupheight=0; RZ.popupscroll=""; RZ.img=""; RZ.caption=""; RZ.name=""; RZ.name defined the img tag name attribute but defaults to an unique value for each button and is therefore not set by the snippet code below. ------------------------------------------------------------------ ********** FORWARD TO EDIT FORM ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=ForwardEditFormImage --%> <%-- Option:imageSrcURL=images/edit/edit-page.gif --%> <%-- #EndRZ-ActionImage --%> ********** FORWARD TO EDIT LIST ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=ForwardEditListImage --%> <%-- Option:forwardURL=@@forwardURL@@ --%> <%-- Option:imageSrcURL=@@imageSrcURL@@ --%> <%-- #EndRZ-ActionImage --%> ********** SAVE BUTTON ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditFormSaveImage --%> <%-- Option:imageSrcURL=images/edit/save.gif --%> <%-- Option:caption= --%> <%-- Option:forwardURL= --%> <%-- #EndRZ-ActionImage --%> ********** CANCEL BUTTON ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditFormCancelImage --%> <%-- Option:imageSrcURL=images/edit/cancel.gif --%> <%-- #EndRZ-ActionImage --%> ********** CHANGE IMAGE BUTTON ********** --TBD-- ********** NEW BUTTON ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditListInsertImage --%> <%-- Option:imageSrcURL=images/edit/new.gif --%> <%-- #EndRZ-ActionImage --%> ********** EXIT BUTTON ********** <%-- #EndRZ-ActionImage --%> <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditListExitImage --%> <%-- Option:imageSrcURL=images/edit/exit.gif --%> <%-- #EndRZ-ActionImage --%> ********** EDIT ITEM BUTTON ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditListEditImage --%> <%-- Option:imageSrcURL=images/edit/edit.gif --%> ********** DELETE ITEM BUTTON ********** <%-- #BeginRZ-ActionImage --%> <%-- Option:type=EditListDeleteImage --%> <%-- Option:imageSrcURL=images/edit/delete.gif --%> <%-- #EndRZ-ActionImage --%>