1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 pageEncoding="ISO-8859-1"
5 taglib prefix="s" uri="/struts-tags"
7 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
9 <!-- Initialization of the edit action, if any
10 =============================================================================================================================
12 <% String action = request.getParameter("action");
13 String type = request.getParameter("index");
14 if (action == null) action = "display";
16 <s:set var="todo"><%=action%></s:set>
19 <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
21 <script language="JavaScript" type="text/javascript" src="../rtef/lang/fr.js"></script>
22 <script language="JavaScript" type="text/javascript" src="../rtef/richtext.js"></script>
23 <script language="JavaScript" type="text/javascript" src="../rtef/xhtml.js"></script>
24 <script language="JavaScript" type="text/javascript" src="../js/popup.js"></script>
25 <script language="JavaScript" type="text/javascript" src="../js/action.js"></script>
27 <script language="JavaScript">
31 var substitutions = new Array (
32 new RegExp("[\r\n]",'g'), " ", // For removing carriage returns & line feeds
33 new RegExp("<p> "), "<p>", // For removing of the 1st paragraph
34 new RegExp(" </p>"), "</p>", // For removing of the 1st paragraph
36 new RegExp("é",'g'), "é",
37 new RegExp("è",'g'), "è",
38 new RegExp("ê",'g'), "ê",
39 new RegExp("ë",'g'), "ë",
40 new RegExp("à",'g'), "à",
41 new RegExp("â",'g'), "â",
42 new RegExp("î",'g'), "î",
43 new RegExp("ï",'g'), "ï",
44 new RegExp("ô",'g'), "ô",
45 new RegExp("ù",'g'), "ù",
46 new RegExp("û",'g'), "û",
47 new RegExp("ü",'g'), "ü",
49 new RegExp("ç",'g'), "ç"
52 function initialize (action) {
53 // ----------------------------
54 if (action == "setContext") {
55 edit.elements[2].focus();
57 if (action == "renameDocument") {
58 edoc.documentTitle.focus();
60 if (action == "renameKnowledge") {
61 edit.knowledgeTitle.focus();
63 if (action == "addKnowledge") {
64 edit.elements[1].focus();
66 if (action != "display") {
67 edit.elements[0].focus();
70 function setValue () {
71 // -------------------
72 var select = edit.elements[0].value; // contextValue select input
73 if (select == "0") { // Creation of a new context type
74 tds = document.getElementById("select");
75 tde = document.getElementById("enter");
76 tds.style.display = "none"; // Hides the select input
77 tde.style.display = "block"; // Displays the text input
79 edit.elements[2].focus();
81 function clean (html) {
82 // ---------------------
84 for (i=0; i<substitutions.length; i = i+2) {
85 html = html.replace(substitutions[i], substitutions[i+1]);
89 function submitEdit () {
90 // ----------------------
91 updateRTEs(); // Sets the value of knowledgeValue input
92 edit.knowledgeValue.value = clean(edit.knowledgeValue.value);
97 <body onLoad="initialize('<%=action%>')">
101 <!-- Description and simulation context sections
102 =============================================================================================================================
107 <div id="tab-description">
108 <span id="tab-front"> <s:text name="title.description"/> </span>
110 <div id="tab-context">
111 <span id="tab-front"> <s:text name="title.context"/> </span>
115 <!-- Display of contents
117 <div id="article-box">
118 <table width=100% border=0 cellspacing=0 cellpadding=0>
120 <td width=38%> <!-- Must conform to the width of above tab-description -->
121 <div id="top-spacer"></div>
122 <div id=article-body class=text>
123 <jsp:include page="/jsp/readDescription.jsp">
124 <jsp:param name="entity" value="study" />
128 <td width=1></td> <!-- Trick for aligning the vertical separator with the tab -->
129 <td width=1 bgcolor=#AAAAAA></td>
131 <div id="top-spacer"></div>
132 <div id="article-body">
133 <s:if test="%{#todo == 'newContext' || #todo == 'selectContext' || #todo == 'setContext'}">
134 <form name="edit" action="<%=action%>?selection=<s:property value="selection"/>" method="post">
135 <jsp:include page="/jsp/editContext.jsp">
136 <jsp:param name="action" value="<%=action%>" />
137 <jsp:param name="type" value="<%=type%>" />
142 <jsp:include page="/jsp/readContext.jsp" />
150 <!-- Knowledge elements section
151 =============================================================================================================================
153 <s:if test="knowledges != null">
155 <div id=section><s:text name="title.knowledge"/></div>
156 <div id=article-body class=text>
157 <s:if test="%{#todo == 'addKnowledge' || #todo == 'renameKnowledge' || #todo == 'editKnowledge'}">
158 <form name="edit" action="setKnowledge" method="post">
159 <jsp:include page="/jsp/editKnowledge.jsp">
160 <jsp:param name="action" value="<%=action%>" />
161 <jsp:param name="index" value="<%=type%>" />
166 <jsp:include page="/jsp/readKnowledge.jsp">
167 <jsp:param name="entity" value="study" />
174 <!-- Documents section
175 =============================================================================================================================
177 <s:if test="documents != null">
179 <div id=section><s:text name="title.document"/></div>
180 <div id=article-body class=text>
181 <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
182 <form name="edoc" action="setDocument" method="post">
183 <jsp:include page="/jsp/editContents.jsp">
184 <jsp:param name="action" value="<%=action%>" />
185 <jsp:param name="index" value="<%=type%>" />
190 <jsp:include page="/jsp/readContents.jsp">
191 <jsp:param name="entity" value="study" />
198 =============================================================================================================================
200 <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
202 <div id=section><s:text name="title.comment"/></div>
203 <div id=article-body class=text>
204 <jsp:include page="/jsp/readComment.jsp"/>